This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: New java.net.Socet test.


This is a patch I have had in my local tree for a while.  I wrote it
when I was hacking around on libgcj's Socket code.

Commited.

2008-03-12  David Daney  <ddaney@avtrex.com>

    * gnu/testlet/java/net/Socket/jdk14.java (test): Add 'bind to any
    local address' test.


Index: gnu/testlet/java/net/Socket/jdk14.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/net/Socket/jdk14.java,v
retrieving revision 1.6
diff -u -p -r1.6 jdk14.java
--- gnu/testlet/java/net/Socket/jdk14.java	8 Nov 2005 21:49:39 -0000	1.6
+++ gnu/testlet/java/net/Socket/jdk14.java	13 Mar 2008 04:50:10 -0000
@@ -78,5 +78,29 @@ public class jdk14 implements Testlet
 	server.close();
       } catch(IOException ignored) {}
     }
+
+    try
+      {
+        harness.checkPoint("bind to any local address");
+	sock = new Socket();
+	InetAddress ia = null;
+	InetSocketAddress sa = new InetSocketAddress(ia, 30006);
+	sock.bind(sa);
+	harness.check(true);
+      }
+    catch (Exception e)
+      {
+	harness.debug(e);
+	harness.fail("unexpected error: bind() threw an exception");
+      }
+    finally
+      {
+	try
+	  {
+	    if (sock != null)
+	      sock.close();
+	  }
+	catch(IOException ignored) {}
+      }
   }
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]