From 1984b3479795d66c3d87e7158b51fc0417b8cc7a Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Wed, 8 May 2019 16:22:10 -0700 Subject: [PATCH] Try getting around clang tidy issue --- .../end2end/service_config_end2end_test.cc | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/cpp/end2end/service_config_end2end_test.cc b/test/cpp/end2end/service_config_end2end_test.cc index 9b259bd6342..2d05fd42635 100644 --- a/test/cpp/end2end/service_config_end2end_test.cc +++ b/test/cpp/end2end/service_config_end2end_test.cc @@ -222,8 +222,16 @@ class ServiceConfigEnd2endTest : public ::testing::Test { return grpc::testing::EchoTestService::NewStub(channel); } - std::shared_ptr BuildChannel( - ChannelArguments args = ChannelArguments()) { + std::shared_ptr BuildChannel() { + ChannelArguments args; + args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR, + response_generator_.get()); + return ::grpc::CreateCustomChannel("fake:///", creds_, args); + } + + std::shared_ptr BuildChannelWithDefaultServiceConfig() { + ChannelArguments args; + args.SetServiceConfigJSON(ValidDefaultServiceConfig()); args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR, response_generator_.get()); return ::grpc::CreateCustomChannel("fake:///", creds_, args); @@ -417,9 +425,7 @@ TEST_F(ServiceConfigEnd2endTest, NoServiceConfigTest) { TEST_F(ServiceConfigEnd2endTest, NoServiceConfigWithDefaultConfigTest) { StartServers(1); - ChannelArguments args; - args.SetServiceConfigJSON(ValidDefaultServiceConfig()); - auto channel = BuildChannel(args); + auto channel = BuildChannelWithDefaultServiceConfig(); auto stub = BuildStub(channel); SetNextResolutionNoServiceConfig(GetServersPorts()); CheckRpcSendOk(stub, DEBUG_LOCATION); @@ -437,9 +443,7 @@ TEST_F(ServiceConfigEnd2endTest, InvalidServiceConfigTest) { TEST_F(ServiceConfigEnd2endTest, InvalidServiceConfigWithDefaultConfigTest) { StartServers(1); - ChannelArguments args; - args.SetServiceConfigJSON(ValidDefaultServiceConfig()); - auto channel = BuildChannel(args); + auto channel = BuildChannelWithDefaultServiceConfig(); auto stub = BuildStub(channel); SetNextResolutionInvalidServiceConfig(GetServersPorts()); CheckRpcSendOk(stub, DEBUG_LOCATION); @@ -475,9 +479,7 @@ TEST_F(ServiceConfigEnd2endTest, TEST_F(ServiceConfigEnd2endTest, NoServiceConfigUpdateAfterValidServiceConfigWithDefaultConfigTest) { StartServers(1); - ChannelArguments args; - args.SetServiceConfigJSON(ValidDefaultServiceConfig()); - auto channel = BuildChannel(args); + auto channel = BuildChannelWithDefaultServiceConfig(); auto stub = BuildStub(channel); SetNextResolutionWithServiceConfig(GetServersPorts(), ValidServiceConfigV1()); CheckRpcSendOk(stub, DEBUG_LOCATION); @@ -504,9 +506,7 @@ TEST_F(ServiceConfigEnd2endTest, TEST_F(ServiceConfigEnd2endTest, InvalidServiceConfigUpdateAfterValidServiceConfigWithDefaultConfigTest) { StartServers(1); - ChannelArguments args; - args.SetServiceConfigJSON(ValidDefaultServiceConfig()); - auto channel = BuildChannel(args); + auto channel = BuildChannelWithDefaultServiceConfig(); auto stub = BuildStub(channel); SetNextResolutionWithServiceConfig(GetServersPorts(), ValidServiceConfigV1()); CheckRpcSendOk(stub, DEBUG_LOCATION);