test/net/TestIPv6Address: work around failure on macOS

This commit is contained in:
Max Kellermann 2019-01-21 12:13:52 +01:00
parent 85f77ec81d
commit 6a68e1c3f3
1 changed files with 4 additions and 1 deletions

View File

@ -77,6 +77,9 @@ TEST(IPv6Address, MaskFromPrefix)
EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(17).GetAddress()), "ffff:8000::"); EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(17).GetAddress()), "ffff:8000::");
EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(32).GetAddress()), "ffff:ffff::"); EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(32).GetAddress()), "ffff:ffff::");
EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(64).GetAddress()), "ffff:ffff:ffff:ffff::"); EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(64).GetAddress()), "ffff:ffff:ffff:ffff::");
EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(112).GetAddress()), "ffff:ffff:ffff:ffff:ffff:ffff:ffff:0"); EXPECT_TRUE(/* glibc: */
ToString(IPv6Address::MaskFromPrefix(112).GetAddress()) == "ffff:ffff:ffff:ffff:ffff:ffff:ffff:0" ||
/* macOS: */
ToString(IPv6Address::MaskFromPrefix(112).GetAddress()) == "ffff:ffff:ffff:ffff:ffff:ffff:ffff::");
EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(128).GetAddress()), "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"); EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(128).GetAddress()), "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff");
} }