Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
  • Loading branch information
alyssawilk committed Jan 12, 2021
1 parent e8431b8 commit a6ae41f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/common/network/connection_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1884,18 +1884,15 @@ TEST_P(ConnectionImplTest, NetworkSocketDumpsWithoutAllocatingMemory) {
std::array<char, 1024> buffer;
OutputBufferStream ostream{buffer.data(), buffer.size()};
IoHandlePtr io_handle = std::make_unique<IoSocketHandleImpl>(0);
// Avoid setting noDelay on the fake fd of 0.
auto local_addr = std::make_shared<Network::Address::PipeInstance>("/pipe/path");
Address::InstanceConstSharedPtr server_addr;
Address::InstanceConstSharedPtr local_addr;
if (GetParam() == Network::Address::IpVersion::v4) {
server_addr = Network::Address::InstanceConstSharedPtr{
new Network::Address::Ipv4Instance("1.1.1.1", 80, nullptr)};
local_addr = Network::Address::InstanceConstSharedPtr{
new Network::Address::Ipv4Instance("1.2.3.4", 56789, nullptr)};
} else {
server_addr = Network::Address::InstanceConstSharedPtr{
new Network::Address::Ipv6Instance("::1", 80, nullptr)};
local_addr = Network::Address::InstanceConstSharedPtr{
new Network::Address::Ipv6Instance("::1:2:3:4", 56789, nullptr)};
}

auto connection_socket =
Expand All @@ -1917,12 +1914,12 @@ TEST_P(ConnectionImplTest, NetworkSocketDumpsWithoutAllocatingMemory) {
contents,
HasSubstr(
"remote_address_: 1.1.1.1:80, direct_remote_address_: 1.1.1.1:80, local_address_: "
"1.2.3.4:56789"));
"/pipe/path"));
} else {
EXPECT_THAT(
contents,
HasSubstr("remote_address_: [::1]:80, direct_remote_address_: [::1]:80, local_address_: "
"[::1:2:3:4]:56789"));
"/pipe/path"));
}
}

Expand Down

0 comments on commit a6ae41f

Please sign in to comment.