MCPcopy Create free account
hub / github.com/apache/brpc / TestClientHost

Function TestClientHost

test/brpc_server_unittest.cpp:2073–2088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2071}
2072
2073void TestClientHost(const butil::EndPoint& ep,
2074 brpc::Controller& cntl,
2075 int error_code, bool failed,
2076 brpc::ChannelOptions& copt) {
2077 brpc::Channel chan;
2078 copt.max_retry = 0;
2079 ASSERT_EQ(0, chan.Init(ep, &copt));
2080
2081 test::EchoRequest req;
2082 test::EchoResponse res;
2083 req.set_message(EXP_REQUEST);
2084 test::EchoService_Stub stub(&chan);
2085 stub.Echo(&cntl, &req, &res, NULL);
2086 ASSERT_EQ(cntl.Failed(), failed) << cntl.ErrorText();
2087 ASSERT_EQ(cntl.ErrorCode(), error_code);
2088}
2089
2090TEST_F(ServerTest, bind_client_host_and_network_device) {
2091 butil::EndPoint ep;

Callers 1

TEST_FFunction · 0.85

Calls 5

ErrorTextMethod · 0.80
ErrorCodeMethod · 0.80
InitMethod · 0.45
EchoMethod · 0.45
FailedMethod · 0.45

Tested by

no test coverage detected