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

Method ChannelTest

test/brpc_channel_unittest.cpp:221–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219class ChannelTest : public ::testing::Test{
220protected:
221 ChannelTest()
222 : _ep(butil::IP_ANY, 8787)
223 , _close_fd_once(false) {
224 if (!_dummy.options().rpc_pb_message_factory) {
225 _dummy._options.rpc_pb_message_factory = new brpc::DefaultRpcPBMessageFactory();
226 }
227
228 pthread_once(&register_mock_protocol, register_protocol);
229 const brpc::InputMessageHandler pairs[] = {
230 { brpc::policy::ParseRpcMessage,
231 ProcessRpcRequest, VerifyMyRequest, this, "baidu_std" }
232 };
233 EXPECT_EQ(0, _messenger.AddHandler(pairs[0]));
234
235 EXPECT_EQ(0, _server_list.save(butil::endpoint2str(_ep).c_str()));
236 _naming_url = std::string("File://") + _server_list.fname();
237 };
238
239 virtual ~ChannelTest(){};
240 virtual void SetUp() {

Callers

nothing calls this directly

Calls 6

endpoint2strFunction · 0.85
optionsMethod · 0.80
AddHandlerMethod · 0.80
saveMethod · 0.80
fnameMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected