Commit ec1cb4c0 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Access the individual words of an IPv6 address correctly in IPAddressTest on Windows

Summary: Winsock defines the internals of `in6_addr` in its own way, so we have to account for that.

Reviewed By: jsedgwick

Differential Revision: D4099453

fbshipit-source-id: c0ebb4e2017f61bed7d5d63058161ef3f16f9a65
parent 210b5664
......@@ -891,7 +891,12 @@ TEST(IPAddress, InvalidBBitAccess) {
TEST(IPAddress, StringFormat) {
in6_addr a6;
for (int i = 0; i < 8; ++i) {
a6.s6_addr16[i] = htons(0x0123 + ((i%4) * 0x4444));
auto t = htons(0x0123 + ((i % 4) * 0x4444));
#ifdef _WIN32
a6.u.Word[i] = t;
#else
a6.s6_addr16[i] = t;
#endif
}
EXPECT_EQ("0123:4567:89ab:cdef:0123:4567:89ab:cdef",
detail::fastIpv6ToString(a6));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment