diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-01-22 04:46:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-22 04:46:27 +0000 |
commit | e001a6e4b9f965c18750f66e7648cd103cca7b2a (patch) | |
tree | 8b67c843925cd72906f51476d622374a67ecf69b /harmony-tests/src/test | |
parent | 71a87d6cdcea216c7760d88dea4ebf002994595b (diff) | |
parent | 26bb48032cdcc8d69484ff168389c34e1f873250 (diff) | |
download | libcore-e001a6e4b9f965c18750f66e7648cd103cca7b2a.zip libcore-e001a6e4b9f965c18750f66e7648cd103cca7b2a.tar.gz libcore-e001a6e4b9f965c18750f66e7648cd103cca7b2a.tar.bz2 |
am 26bb4803: Merge "Use the IPv6 instead of the IPv4 wildcard address in sockets."
* commit '26bb48032cdcc8d69484ff168389c34e1f873250':
Use the IPv6 instead of the IPv4 wildcard address in sockets.
Diffstat (limited to 'harmony-tests/src/test')
-rw-r--r-- | harmony-tests/src/test/java/org/apache/harmony/tests/java/net/DatagramSocketTest.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/DatagramSocketTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/DatagramSocketTest.java index e585b14..d9f3d91 100644 --- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/DatagramSocketTest.java +++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/DatagramSocketTest.java @@ -745,12 +745,13 @@ public class DatagramSocketTest extends junit.framework.TestCase { public void test_getLocalSocketAddress_ANY() throws Exception { DatagramSocket s = new DatagramSocket(0); - try { - assertTrue("ANY address not IPv6: " + s.getLocalSocketAddress(), - ((InetSocketAddress) s.getLocalSocketAddress()).getAddress() instanceof Inet6Address); - } finally { - s.close(); - } + assertEquals("ANY address not IPv6: " + s.getLocalSocketAddress(), + Inet6Address.ANY, s.getLocalAddress()); + s.close(); + s = new DatagramSocket(0, null); + assertEquals(Inet6Address.ANY, s.getLocalAddress()); + assertFalse(0 == s.getLocalPort()); + s.close(); } public void test_setReuseAddressZ() throws Exception { |