summaryrefslogtreecommitdiffstats
path: root/harmony-tests/src/test
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2015-01-22 04:35:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-22 04:35:55 +0000
commit26bb48032cdcc8d69484ff168389c34e1f873250 (patch)
treee79edd5aa194674287f0b2798da4ce9e12346700 /harmony-tests/src/test
parent1d5df1fbd8c786e0f936cb0175e4a3f288fc1890 (diff)
parent72ed50d1e9048b79efdb5b9e4ffb07c99a302d84 (diff)
downloadlibcore-26bb48032cdcc8d69484ff168389c34e1f873250.zip
libcore-26bb48032cdcc8d69484ff168389c34e1f873250.tar.gz
libcore-26bb48032cdcc8d69484ff168389c34e1f873250.tar.bz2
Merge "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.java13
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 {