From 6a68e1c3f38e6e41301904ca8f7cffa51d634978 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Jan 2019 12:13:52 +0100 Subject: [PATCH] test/net/TestIPv6Address: work around failure on macOS --- test/net/TestIPv6Address.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/net/TestIPv6Address.cxx b/test/net/TestIPv6Address.cxx index 69a9dc1b1..325d25bbf 100644 --- a/test/net/TestIPv6Address.cxx +++ b/test/net/TestIPv6Address.cxx @@ -77,6 +77,9 @@ TEST(IPv6Address, MaskFromPrefix) EXPECT_EQ(ToString(IPv6Address::MaskFromPrefix(17).GetAddress()), "ffff:8000::"); 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(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"); }