test: avoid in6addr_* constants
These aren't available on MinGW, so use explicit addresses instead.
This commit is contained in:
parent
6917640336
commit
23b9ad9ede
|
@ -157,7 +157,9 @@ TEST_P(DefaultChannelModeTest, LiveGetLocalhostByAddrV4) {
|
|||
|
||||
TEST_P(DefaultChannelModeTest, LiveGetLocalhostByAddrV6) {
|
||||
HostResult result;
|
||||
struct in6_addr addr = in6addr_loopback;
|
||||
struct in6_addr addr;
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.s6_addr[15] = 1; // in6addr_loopback
|
||||
ares_gethostbyaddr(channel_, &addr, sizeof(addr), AF_INET6, HostCallback, &result);
|
||||
Process();
|
||||
EXPECT_TRUE(result.done_);
|
||||
|
|
|
@ -180,7 +180,7 @@ MockServer::MockServer(int family, int port, int tcpport)
|
|||
struct sockaddr_in6 addr;
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sin6_family = AF_INET6;
|
||||
addr.sin6_addr = in6addr_any;
|
||||
memset(&addr.sin6_addr, 0, sizeof(addr.sin6_addr)); // in6addr_any
|
||||
addr.sin6_port = htons(tcpport_);
|
||||
int tcprc = bind(tcpfd_, (struct sockaddr*)&addr, sizeof(addr));
|
||||
EXPECT_EQ(0, tcprc) << "Failed to bind AF_INET6 to TCP port " << tcpport_;
|
||||
|
|
Loading…
Reference in New Issue