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

Function TestBaiduMasterService

test/brpc_server_unittest.cpp:1747–1759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1745};
1746
1747void TestBaiduMasterService(brpc::Channel& channel, brpc::CompressType compress_type) {
1748 brpc::Controller cntl;
1749 test::EchoRequest req;
1750 test::EchoResponse res;
1751 req.set_message(EXP_REQUEST);
1752 cntl.request_attachment().append(EXP_REQUEST);
1753 cntl.set_request_compress_type(compress_type);
1754 test::EchoService_Stub stub(&channel);
1755 stub.Echo(&cntl, &req, &res, NULL);
1756 ASSERT_FALSE(cntl.Failed()) << cntl.ErrorText();
1757 ASSERT_EQ(EXP_RESPONSE, res.message());
1758 ASSERT_EQ(EXP_RESPONSE, cntl.response_attachment().to_string());
1759}
1760
1761TEST_F(ServerTest, baidu_master_service) {
1762 butil::EndPoint ep;

Callers 1

TEST_FFunction · 0.85

Calls 7

ErrorTextMethod · 0.80
appendMethod · 0.45
EchoMethod · 0.45
FailedMethod · 0.45
messageMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected