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

Method TestSofaCompress

test/brpc_sofa_pbrpc_protocol_unittest.cpp:183–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181 }
182
183 void TestSofaCompress(brpc::CompressType type) {
184 butil::IOBuf request_buf;
185 butil::IOBuf total_buf;
186 brpc::Controller cntl;
187 test::EchoRequest req;
188 test::EchoResponse res;
189 cntl._response = &res;
190
191 req.set_message(EXP_REQUEST);
192 cntl.set_request_compress_type(type);
193 brpc::SerializeRequestDefault(&request_buf, &cntl, &req);
194 ASSERT_FALSE(cntl.Failed());
195 brpc::policy::PackSofaRequest(
196 &total_buf, NULL, cntl.call_id().value,
197 test::EchoService::descriptor()->method(0),
198 &cntl, request_buf, &_auth);
199 ASSERT_FALSE(cntl.Failed());
200
201 brpc::ParseResult req_pr =
202 brpc::policy::ParseSofaMessage(&total_buf, NULL, false, NULL);
203 ASSERT_EQ(brpc::PARSE_OK, req_pr.error());
204 brpc::InputMessageBase* req_msg = req_pr.message();
205 ProcessMessage(brpc::policy::ProcessSofaRequest, req_msg, false);
206 CheckResponseCode(false, 0);
207 }
208
209 int _pipe_fds[2];
210 brpc::SocketUniquePtr _socket;

Callers

nothing calls this directly

Calls 9

SerializeRequestDefaultFunction · 0.85
PackSofaRequestFunction · 0.85
ParseSofaMessageFunction · 0.85
call_idMethod · 0.80
FailedMethod · 0.45
methodMethod · 0.45
errorMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected