public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: New java.net.Socet test.
@ 2008-03-13  4:57 David Daney
  0 siblings, 0 replies; only message in thread
From: David Daney @ 2008-03-13  4:57 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

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.



[-- Attachment #2: mauve.patch --]
[-- Type: text/x-patch, Size: 993 bytes --]

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) {}
+      }
   }
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-13  4:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-13  4:57 FYI: New java.net.Socet test David Daney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).