Skip to content

Commit

Permalink
test: fix RawConnectionDriver (envoyproxy#122)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuchen Dai <[email protected]>
  • Loading branch information
lambdai authored May 4, 2020
1 parent 998b349 commit b6dccb7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions echo2_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ INSTANTIATE_TEST_SUITE_P(IpVersions, Echo2IntegrationTest,
testing::ValuesIn(TestEnvironment::getIpVersionsForTest()));

TEST_P(Echo2IntegrationTest, Echo) {
Buffer::OwnedImpl buffer("hello");
std::string response;
RawConnectionDriver connection(
lookupPort("listener_0"), buffer,
[&](Network::ClientConnection&, const Buffer::Instance& data) -> void {
auto connection = createConnectionDriver(
lookupPort("listener_0"), "hello",
[&](Network::ClientConnection& conn, const Buffer::Instance& data) -> void {
response.append(data.toString());
connection.close();
},
GetParam());
conn.close(Network::ConnectionCloseType::FlushWrite);
});

connection.run();
connection->run();
EXPECT_EQ("hello", response);
}
} // namespace Envoy

0 comments on commit b6dccb7

Please sign in to comment.