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

Function TestBaiduStdAuth

test/brpc_server_unittest.cpp:2004–2020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2002}
2003
2004void TestBaiduStdAuth(const butil::EndPoint& ep,
2005 brpc::Controller& cntl,
2006 int error_code, bool failed) {
2007 brpc::Channel chan;
2008 brpc::ChannelOptions copt;
2009 copt.max_retry = 0;
2010 copt.protocol = "baidu_std";
2011 ASSERT_EQ(0, chan.Init(ep, &copt));
2012
2013 test::EchoRequest req;
2014 test::EchoResponse res;
2015 req.set_message(EXP_REQUEST);
2016 test::EchoService_Stub stub(&chan);
2017 stub.Echo(&cntl, &req, &res, NULL);
2018 ASSERT_EQ(cntl.Failed(), failed) << cntl.ErrorText();
2019 ASSERT_EQ(cntl.ErrorCode(), error_code);
2020}
2021
2022void TestHttpAuth(const butil::EndPoint& ep,
2023 brpc::Controller& cntl,

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