projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
210b566
)
Access the individual words of an IPv6 address correctly in IPAddressTest on Windows
author
Christopher Dykes
<cdykes@fb.com>
Mon, 31 Oct 2016 19:00:28 +0000
(12:00 -0700)
committer
Facebook Github Bot
<facebook-github-bot-bot@fb.com>
Mon, 31 Oct 2016 19:08:34 +0000
(12:08 -0700)
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
folly/test/IPAddressTest.cpp
patch
|
blob
|
history
diff --git
a/folly/test/IPAddressTest.cpp
b/folly/test/IPAddressTest.cpp
index 9fc746d7aedffe63f90b3dba9b1d7627935c45a5..93f2aa1c3964ba2ff0ec3cdad94c4204f6032982 100644
(file)
--- a/
folly/test/IPAddressTest.cpp
+++ b/
folly/test/IPAddressTest.cpp
@@
-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));