| 2002 | } |
| 2003 | |
| 2004 | void 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 | |
| 2022 | void TestHttpAuth(const butil::EndPoint& ep, |
| 2023 | brpc::Controller& cntl, |