Skip to content

Commit

Permalink
Fixed unit test error
Browse files Browse the repository at this point in the history
  • Loading branch information
yhirose committed Dec 31, 2021
1 parent 65a8f4c commit e6e4068
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions test/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,31 +404,26 @@ TEST(ChunkedEncodingTest, FromHTTPWatch_Online) {
TEST(HostnameToIPConversionTest, HTTPWatch_Online) {
auto host = "www.httpwatch.com";

{
auto ip = hosted_at(host);
EXPECT_EQ("191.236.16.12", ip);
}
auto ip = hosted_at(host);
EXPECT_EQ("191.236.16.12", ip);

{
std::vector<std::string> addrs;
hosted_at(host, addrs);
EXPECT_EQ(1u, addrs.size());
}
std::vector<std::string> addrs;
hosted_at(host, addrs);
EXPECT_EQ(1u, addrs.size());
}

TEST(HostnameToIPConversionTest, YouTube_Online) {
auto host = "www.youtube.com";

{
auto ip = hosted_at(host);
EXPECT_EQ("2607:f8b0:4006:809::200e", ip);
}
std::vector<std::string> addrs;
hosted_at(host, addrs);

{
std::vector<std::string> addrs;
hosted_at(host, addrs);
EXPECT_EQ(20u, addrs.size());
}
EXPECT_EQ(20u, addrs.size());

#if 0 // It depends on each test environment...
auto it = std::find(addrs.begin(), addrs.end(), "2607:f8b0:4006:809::200e");
EXPECT_TRUE(it != addrs.end());
#endif
}

TEST(ChunkedEncodingTest, WithContentReceiver_Online) {
Expand Down

0 comments on commit e6e4068

Please sign in to comment.