Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh352 committed Dec 27, 2024
1 parent ee16733 commit 2be799d
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions test/ares-test-mock-ai.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1007,9 +1007,9 @@ CONTAINED_TEST_P(ContainedMockChannelAISysConfig, NoHostsLocalHostv4,
ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result);
Process();
EXPECT_TRUE(result.done_);
std::stringstream ss;
ss << result.ai_;
EXPECT_EQ("{addr=[127.0.0.1]}", ss.str());
EXPECT_EQ(result.status_, ARES_SUCCESS);
EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1"));
return HasFailure();
}

Expand All @@ -1022,9 +1022,9 @@ CONTAINED_TEST_P(ContainedMockChannelAISysConfig, NoHostsLocalHostv6,
ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result);
Process();
EXPECT_TRUE(result.done_);
std::stringstream ss;
ss << result.ai_;
EXPECT_EQ("{addr=[0000:0000:0000:0000:0000:0000:0000:0001]}", ss.str());
EXPECT_EQ(result.status_, ARES_SUCCESS);
EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001"));
return HasFailure();
}

Expand All @@ -1037,9 +1037,10 @@ CONTAINED_TEST_P(ContainedMockChannelAISysConfig, NoHostsLocalHostUnspec,
ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result);
Process();
EXPECT_TRUE(result.done_);
std::stringstream ss;
ss << result.ai_;
EXPECT_EQ("{addr=[127.0.0.1], addr=[0000:0000:0000:0000:0000:0000:0000:0001]}", ss.str());
EXPECT_EQ(result.status_, ARES_SUCCESS);
EXPECT_THAT(result.ai_, IncludesNumAddresses(2));
EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1"));
EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001"));
return HasFailure();
}

Expand All @@ -1061,9 +1062,9 @@ CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v4OnlyLocalHostv4,
ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result);
Process();
EXPECT_TRUE(result.done_);
std::stringstream ss;
ss << result.ai_;
EXPECT_EQ("{addr=[127.0.0.1]}", ss.str());
EXPECT_EQ(result.status_, ARES_SUCCESS);
EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1"));
return HasFailure();
}

Expand All @@ -1076,9 +1077,9 @@ CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v4OnlyLocalHostv6,
ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result);
Process();
EXPECT_TRUE(result.done_);
std::stringstream ss;
ss << result.ai_;
EXPECT_EQ("{addr=[0000:0000:0000:0000:0000:0000:0000:0001]}", ss.str());
EXPECT_EQ(result.status_, ARES_SUCCESS);
EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001"));
return HasFailure();
}

Expand All @@ -1091,9 +1092,10 @@ CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v4OnlyLocalHostUnspec,
ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result);
Process();
EXPECT_TRUE(result.done_);
std::stringstream ss;
ss << result.ai_;
EXPECT_EQ("{addr=[127.0.0.1], addr=[0000:0000:0000:0000:0000:0000:0000:0001]}", ss.str());
EXPECT_EQ(result.status_, ARES_SUCCESS);
EXPECT_THAT(result.ai_, IncludesNumAddresses(2));
EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1"));
EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001"));
return HasFailure();
}

Expand Down

0 comments on commit 2be799d

Please sign in to comment.