Merge \"Log the address of the IPv4 address that causes the test to fail.\" into nyc-dev

am: db3485a45e

Change-Id: Id3818163f9fef1b2ba9d7b29f6b0f84c6659625d
This commit is contained in:
Lorenzo Colitti
2016-06-09 07:53:30 +00:00
committed by android-build-merger

View File

@@ -89,17 +89,15 @@ public class DnsTest extends AndroidTestCase {
addrs = InetAddress.getAllByName("ipv6.google.com");
} catch (UnknownHostException e) {}
assertTrue(addrs.length != 0);
foundV4 = false;
foundV6 = false;
for (InetAddress addr : addrs) {
if (addr instanceof Inet4Address) foundV4 = true;
else if (addr instanceof Inet6Address) foundV6 = true;
assertFalse ("[RERUN] ipv6.google.com returned IPv4 address: " + addr.getHostAddress() +
", check your network's DNS connection", addr instanceof Inet4Address);
foundV6 |= (addr instanceof Inet6Address);
if (DBG) Log.e(TAG, "ipv6.google.com gave " + addr.toString());
}
assertTrue("[RERUN] ipv6.google.com returned an ipv4 address, check your network's DNS connection.",
foundV4 == false);
assertTrue(foundV6 == true);
assertTrue(foundV6);
assertTrue(testNativeDns());
}