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

Method CallMethod

test/brpc_grpc_protocol_unittest.cpp:106–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 virtual void TearDown() {};
105
106 void CallMethod(bool req_gzip, bool res_gzip) {
107 test::GrpcRequest req;
108 test::GrpcResponse res;
109 brpc::Controller cntl;
110 if (req_gzip) {
111 cntl.set_request_compress_type(brpc::COMPRESS_TYPE_GZIP);
112 }
113 req.set_message(g_req);
114 req.set_gzip(res_gzip);
115 req.set_return_error(false);
116
117 test::GrpcService_Stub stub(&_channel);
118 stub.Method(&cntl, &req, &res, NULL);
119 EXPECT_FALSE(cntl.Failed()) << cntl.ErrorCode() << ": " << cntl.ErrorText();
120 EXPECT_EQ(res.message(), g_prefix + g_req);
121 }
122
123 brpc::Server _server;
124 MyGrpcService _svc;

Callers

nothing calls this directly

Calls 6

MethodMethod · 0.80
ErrorCodeMethod · 0.80
ErrorTextMethod · 0.80
FailedMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected