Index: webrtc/base/ipaddress_unittest.cc |
diff --git a/webrtc/base/ipaddress_unittest.cc b/webrtc/base/ipaddress_unittest.cc |
index 3a8087a5d44e79147b683ddca76d4d7e00bb8f36..d5cb6f709c6b93f47309c1aba18285bd1269745d 100644 |
--- a/webrtc/base/ipaddress_unittest.cc |
+++ b/webrtc/base/ipaddress_unittest.cc |
@@ -544,6 +544,19 @@ TEST(IPAddressTest, TestIsPrivate) { |
EXPECT_TRUE(IPIsPrivate(IPAddress(kIPv6LinkLocalAddr))); |
} |
+TEST(IPAddressTest, TestIsNil) { |
+ IPAddress addr; |
+ EXPECT_TRUE(IPAddress().IsNil()); |
+ |
+ EXPECT_TRUE(IPFromString(kIPv6AnyAddrString, &addr)); |
+ EXPECT_FALSE(addr.IsNil()); |
+ |
+ EXPECT_TRUE(IPFromString(kIPv4AnyAddrString, &addr)); |
+ EXPECT_FALSE(addr.IsNil()); |
+ |
+ EXPECT_FALSE(IPAddress(kIPv4PublicAddr).IsNil()); |
+} |
+ |
TEST(IPAddressTest, TestIsLoopback) { |
EXPECT_FALSE(IPIsLoopback(IPAddress(INADDR_ANY))); |
EXPECT_FALSE(IPIsLoopback(IPAddress(kIPv4PublicAddr))); |