1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 04:54:28 +01:00

Added is_private and is_loopback methods to IPv4 and IPv6 addresses.

This commit is contained in:
Matias Fontanini
2013-09-04 12:57:36 -03:00
parent b26f353e46
commit 15f2896811
7 changed files with 161 additions and 67 deletions

View File

@@ -85,3 +85,9 @@ TEST(IPv6AddressTest, Copy) {
addr1.copy(addr2.begin());
EXPECT_EQ(addr1, addr2);
}
TEST(IPv6AddressTest, IsLoopback) {
EXPECT_TRUE(IPv6Address("::1").is_loopback());
EXPECT_FALSE(IPv6Address("::2").is_loopback());
EXPECT_FALSE(IPv6Address("ffff::2").is_loopback());
}