Added InetAddressTests to cover different layouts in different OpenJDK 6. development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 28 Aug 2013 09:16:36 +0100
branchdevelopment
changeset 2674 8b3736c87626
parent 2673 26941db6892d
child 2675 287841eb1564
Added InetAddressTests to cover different layouts in different OpenJDK 6. There seems to be at least two different clas layouts for Inet4Address and Inet6Address. This testcase should test whether native methods handle both layouts correctly.
tests/libjava/src/stx/libjava/tests/lib/java/net/InetAddressTests.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/libjava/src/stx/libjava/tests/lib/java/net/InetAddressTests.java	Wed Aug 28 09:16:36 2013 +0100
@@ -0,0 +1,24 @@
+package stx.libjava.tests.lib.java.net;
+
+import static org.junit.Assert.*;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import org.junit.Test;
+
+public class InetAddressTests {
+
+    @Test
+    public void test() {
+        try {
+            InetAddress addr = InetAddress.getLocalHost();
+            addr.getAddress();
+        } catch (UnknownHostException e) {
+            // TODO Auto-generated catch block
+            assertTrue(false);
+        }
+        
+    }
+
+}