Try getting around clang tidy issue

reviewable/pr18946/r7
Yash Tibrewal 6 years ago
parent 3c4e8a9be2
commit 1984b34797
  1. 28
      test/cpp/end2end/service_config_end2end_test.cc

@ -222,8 +222,16 @@ class ServiceConfigEnd2endTest : public ::testing::Test {
return grpc::testing::EchoTestService::NewStub(channel); return grpc::testing::EchoTestService::NewStub(channel);
} }
std::shared_ptr<Channel> BuildChannel( std::shared_ptr<Channel> BuildChannel() {
ChannelArguments args = ChannelArguments()) { ChannelArguments args;
args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR,
response_generator_.get());
return ::grpc::CreateCustomChannel("fake:///", creds_, args);
}
std::shared_ptr<Channel> BuildChannelWithDefaultServiceConfig() {
ChannelArguments args;
args.SetServiceConfigJSON(ValidDefaultServiceConfig());
args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR, args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR,
response_generator_.get()); response_generator_.get());
return ::grpc::CreateCustomChannel("fake:///", creds_, args); return ::grpc::CreateCustomChannel("fake:///", creds_, args);
@ -417,9 +425,7 @@ TEST_F(ServiceConfigEnd2endTest, NoServiceConfigTest) {
TEST_F(ServiceConfigEnd2endTest, NoServiceConfigWithDefaultConfigTest) { TEST_F(ServiceConfigEnd2endTest, NoServiceConfigWithDefaultConfigTest) {
StartServers(1); StartServers(1);
ChannelArguments args; auto channel = BuildChannelWithDefaultServiceConfig();
args.SetServiceConfigJSON(ValidDefaultServiceConfig());
auto channel = BuildChannel(args);
auto stub = BuildStub(channel); auto stub = BuildStub(channel);
SetNextResolutionNoServiceConfig(GetServersPorts()); SetNextResolutionNoServiceConfig(GetServersPorts());
CheckRpcSendOk(stub, DEBUG_LOCATION); CheckRpcSendOk(stub, DEBUG_LOCATION);
@ -437,9 +443,7 @@ TEST_F(ServiceConfigEnd2endTest, InvalidServiceConfigTest) {
TEST_F(ServiceConfigEnd2endTest, InvalidServiceConfigWithDefaultConfigTest) { TEST_F(ServiceConfigEnd2endTest, InvalidServiceConfigWithDefaultConfigTest) {
StartServers(1); StartServers(1);
ChannelArguments args; auto channel = BuildChannelWithDefaultServiceConfig();
args.SetServiceConfigJSON(ValidDefaultServiceConfig());
auto channel = BuildChannel(args);
auto stub = BuildStub(channel); auto stub = BuildStub(channel);
SetNextResolutionInvalidServiceConfig(GetServersPorts()); SetNextResolutionInvalidServiceConfig(GetServersPorts());
CheckRpcSendOk(stub, DEBUG_LOCATION); CheckRpcSendOk(stub, DEBUG_LOCATION);
@ -475,9 +479,7 @@ TEST_F(ServiceConfigEnd2endTest,
TEST_F(ServiceConfigEnd2endTest, TEST_F(ServiceConfigEnd2endTest,
NoServiceConfigUpdateAfterValidServiceConfigWithDefaultConfigTest) { NoServiceConfigUpdateAfterValidServiceConfigWithDefaultConfigTest) {
StartServers(1); StartServers(1);
ChannelArguments args; auto channel = BuildChannelWithDefaultServiceConfig();
args.SetServiceConfigJSON(ValidDefaultServiceConfig());
auto channel = BuildChannel(args);
auto stub = BuildStub(channel); auto stub = BuildStub(channel);
SetNextResolutionWithServiceConfig(GetServersPorts(), ValidServiceConfigV1()); SetNextResolutionWithServiceConfig(GetServersPorts(), ValidServiceConfigV1());
CheckRpcSendOk(stub, DEBUG_LOCATION); CheckRpcSendOk(stub, DEBUG_LOCATION);
@ -504,9 +506,7 @@ TEST_F(ServiceConfigEnd2endTest,
TEST_F(ServiceConfigEnd2endTest, TEST_F(ServiceConfigEnd2endTest,
InvalidServiceConfigUpdateAfterValidServiceConfigWithDefaultConfigTest) { InvalidServiceConfigUpdateAfterValidServiceConfigWithDefaultConfigTest) {
StartServers(1); StartServers(1);
ChannelArguments args; auto channel = BuildChannelWithDefaultServiceConfig();
args.SetServiceConfigJSON(ValidDefaultServiceConfig());
auto channel = BuildChannel(args);
auto stub = BuildStub(channel); auto stub = BuildStub(channel);
SetNextResolutionWithServiceConfig(GetServersPorts(), ValidServiceConfigV1()); SetNextResolutionWithServiceConfig(GetServersPorts(), ValidServiceConfigV1());
CheckRpcSendOk(stub, DEBUG_LOCATION); CheckRpcSendOk(stub, DEBUG_LOCATION);

Loading…
Cancel
Save