This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
FYI: New java.net.Socet test.
- From: David Daney <ddaney at avtrex dot com>
- To: mauve-patches <mauve-patches at sources dot redhat dot com>
- Date: Wed, 12 Mar 2008 21:56:54 -0700
- Subject: 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) {}
+ }
}
}