Log the address of the IPv4 address that causes the test to fail.

Bug: 29231261
Change-Id: I6aac389d2c234091a284486422ee663119d021a9
This commit is contained in:
Lorenzo Colitti
2016-06-09 14:23:21 +09:00
parent d1f3d68694
commit 1d75845bd5

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());
}