From 30f1230c10d6a9e17f893762051d83d9c3aad815 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 17 Oct 2019 08:51:55 -0700 Subject: [PATCH 1/2] Remove unused parameter warning (16 of 20) --- test/cpp/end2end/message_allocator_end2end_test.cc | 2 +- test/cpp/end2end/mock_test.cc | 9 +++++---- test/cpp/end2end/port_sharing_end2end_test.cc | 2 +- test/cpp/end2end/server_builder_plugin_test.cc | 9 ++++++--- test/cpp/end2end/server_crash_test.cc | 5 +++-- test/cpp/end2end/server_interceptors_end2end_test.cc | 4 ++-- test/cpp/end2end/shutdown_test.cc | 4 ++-- test/cpp/end2end/streaming_throughput_test.cc | 2 +- test/cpp/end2end/thread_stress_test.cc | 2 +- test/cpp/end2end/xds_end2end_test.cc | 3 ++- 10 files changed, 24 insertions(+), 18 deletions(-) diff --git a/test/cpp/end2end/message_allocator_end2end_test.cc b/test/cpp/end2end/message_allocator_end2end_test.cc index e46453c0282..c7e197f2043 100644 --- a/test/cpp/end2end/message_allocator_end2end_test.cc +++ b/test/cpp/end2end/message_allocator_end2end_test.cc @@ -70,7 +70,7 @@ class CallbackTestServiceImpl allocator_mutator_ = mutator; } - void Echo(ServerContext* context, const EchoRequest* request, + void Echo(ServerContext* /*context*/, const EchoRequest* request, EchoResponse* response, experimental::ServerCallbackRpcController* controller) override { response->set_message(request->message()); diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc index 0196c9de7e0..d708c05235c 100644 --- a/test/cpp/end2end/mock_test.cc +++ b/test/cpp/end2end/mock_test.cc @@ -163,13 +163,13 @@ class FakeClient { class TestServiceImpl : public EchoTestService::Service { public: - Status Echo(ServerContext* context, const EchoRequest* request, + Status Echo(ServerContext* /*context*/, const EchoRequest* request, EchoResponse* response) override { response->set_message(request->message()); return Status::OK; } - Status RequestStream(ServerContext* context, + Status RequestStream(ServerContext* /*context*/, ServerReader* reader, EchoResponse* response) override { EchoRequest request; @@ -182,7 +182,8 @@ class TestServiceImpl : public EchoTestService::Service { return Status::OK; } - Status ResponseStream(ServerContext* context, const EchoRequest* request, + Status ResponseStream(ServerContext* /*context*/, + const EchoRequest* request, ServerWriter* writer) override { EchoResponse response; vector tokens = split(request->message()); @@ -194,7 +195,7 @@ class TestServiceImpl : public EchoTestService::Service { } Status BidiStream( - ServerContext* context, + ServerContext* /*context*/, ServerReaderWriter* stream) override { EchoRequest request; EchoResponse response; diff --git a/test/cpp/end2end/port_sharing_end2end_test.cc b/test/cpp/end2end/port_sharing_end2end_test.cc index 1d6944f1f64..8398517eee3 100644 --- a/test/cpp/end2end/port_sharing_end2end_test.cc +++ b/test/cpp/end2end/port_sharing_end2end_test.cc @@ -154,7 +154,7 @@ class TestTcpServer { } private: - void OnConnect(grpc_endpoint* tcp, grpc_pollset* accepting_pollset, + void OnConnect(grpc_endpoint* tcp, grpc_pollset* /*accepting_pollset*/, grpc_tcp_server_acceptor* acceptor) { char* peer = grpc_endpoint_get_peer(tcp); gpr_log(GPR_INFO, "Got incoming connection! from %s", peer); diff --git a/test/cpp/end2end/server_builder_plugin_test.cc b/test/cpp/end2end/server_builder_plugin_test.cc index 1ba7a9b5c58..c7343b30abd 100644 --- a/test/cpp/end2end/server_builder_plugin_test.cc +++ b/test/cpp/end2end/server_builder_plugin_test.cc @@ -61,9 +61,12 @@ class TestServerBuilderPlugin : public ServerBuilderPlugin { } } - void Finish(ServerInitializer* si) override { finish_is_called_ = true; } + void Finish(ServerInitializer* /*si*/) override { + finish_is_called_ = true; + } - void ChangeArguments(const grpc::string& name, void* value) override { + void ChangeArguments(const grpc::string& /*name*/, + void* /*value*/) override { change_arguments_is_called_ = true; } @@ -99,7 +102,7 @@ class InsertPluginServerBuilderOption : public ServerBuilderOption { public: InsertPluginServerBuilderOption() { register_service_ = false; } - void UpdateArguments(ChannelArguments* arg) override {} + void UpdateArguments(ChannelArguments* /*arg*/) override {} void UpdatePlugins( std::vector>* plugins) override { diff --git a/test/cpp/end2end/server_crash_test.cc b/test/cpp/end2end/server_crash_test.cc index 353ebf713a0..22a0d4485b7 100644 --- a/test/cpp/end2end/server_crash_test.cc +++ b/test/cpp/end2end/server_crash_test.cc @@ -50,7 +50,7 @@ class ServiceImpl final : public ::grpc::testing::EchoTestService::Service { ServiceImpl() : bidi_stream_count_(0), response_stream_count_(0) {} Status BidiStream( - ServerContext* context, + ServerContext* /*context*/, ServerReaderWriter* stream) override { bidi_stream_count_++; EchoRequest request; @@ -65,7 +65,8 @@ class ServiceImpl final : public ::grpc::testing::EchoTestService::Service { return Status::OK; } - Status ResponseStream(ServerContext* context, const EchoRequest* request, + Status ResponseStream(ServerContext* /*context*/, + const EchoRequest* /*request*/, ServerWriter* writer) override { EchoResponse response; response_stream_count_++; diff --git a/test/cpp/end2end/server_interceptors_end2end_test.cc b/test/cpp/end2end/server_interceptors_end2end_test.cc index 34409fe375c..70697275c3a 100644 --- a/test/cpp/end2end/server_interceptors_end2end_test.cc +++ b/test/cpp/end2end/server_interceptors_end2end_test.cc @@ -147,7 +147,7 @@ class LoggingInterceptorFactory // Test if SendMessage function family works as expected for sync/callback apis class SyncSendMessageTester : public experimental::Interceptor { public: - SyncSendMessageTester(experimental::ServerRpcInfo* info) {} + SyncSendMessageTester(experimental::ServerRpcInfo* /*info*/) {} void Intercept(experimental::InterceptorBatchMethods* methods) override { if (methods->QueryInterceptionHookPoint( @@ -177,7 +177,7 @@ class SyncSendMessageTesterFactory // Test if SendMessage function family works as expected for sync/callback apis class SyncSendMessageVerifier : public experimental::Interceptor { public: - SyncSendMessageVerifier(experimental::ServerRpcInfo* info) {} + SyncSendMessageVerifier(experimental::ServerRpcInfo* /*info*/) {} void Intercept(experimental::InterceptorBatchMethods* methods) override { if (methods->QueryInterceptionHookPoint( diff --git a/test/cpp/end2end/shutdown_test.cc b/test/cpp/end2end/shutdown_test.cc index 0105dee24b3..ec8597f3e72 100644 --- a/test/cpp/end2end/shutdown_test.cc +++ b/test/cpp/end2end/shutdown_test.cc @@ -46,8 +46,8 @@ class TestServiceImpl : public ::grpc::testing::EchoTestService::Service { public: explicit TestServiceImpl(gpr_event* ev) : ev_(ev) {} - Status Echo(ServerContext* context, const EchoRequest* request, - EchoResponse* response) override { + Status Echo(ServerContext* context, const EchoRequest* /*request*/, + EchoResponse* /*response*/) override { gpr_event_set(ev_, (void*)1); while (!context->IsCancelled()) { } diff --git a/test/cpp/end2end/streaming_throughput_test.cc b/test/cpp/end2end/streaming_throughput_test.cc index 0c10957eb77..f2252063fb1 100644 --- a/test/cpp/end2end/streaming_throughput_test.cc +++ b/test/cpp/end2end/streaming_throughput_test.cc @@ -106,7 +106,7 @@ class TestServiceImpl : public ::grpc::testing::EchoTestService::Service { // Only implement the one method we will be calling for brevity. Status BidiStream( - ServerContext* context, + ServerContext* /*context*/, ServerReaderWriter* stream) override { EchoRequest request; gpr_atm should_exit; diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc index fee20c82679..cd2254e79ea 100644 --- a/test/cpp/end2end/thread_stress_test.cc +++ b/test/cpp/end2end/thread_stress_test.cc @@ -57,7 +57,7 @@ class TestServiceImpl : public ::grpc::testing::EchoTestService::Service { public: TestServiceImpl() {} - Status Echo(ServerContext* context, const EchoRequest* request, + Status Echo(ServerContext* /*context*/, const EchoRequest* request, EchoResponse* response) override { response->set_message(request->message()); return Status::OK; diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 69b92504bb8..14be8c3ad83 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -423,7 +423,8 @@ class LrsServiceImpl : public LrsService { : client_load_reporting_interval_seconds_( client_load_reporting_interval_seconds) {} - Status StreamLoadStats(ServerContext* context, Stream* stream) override { + Status StreamLoadStats(ServerContext* /*context*/, + Stream* stream) override { gpr_log(GPR_INFO, "LB[%p]: LRS StreamLoadStats starts", this); // Read request. LoadStatsRequest request; From fbfaffaf5acb6d4cb0457503a22b846da8ec6ee5 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 17 Oct 2019 09:07:46 -0700 Subject: [PATCH 2/2] clang-format --- test/cpp/end2end/mock_test.cc | 3 +-- test/cpp/end2end/server_builder_plugin_test.cc | 7 ++----- test/cpp/end2end/xds_end2end_test.cc | 3 +-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc index d708c05235c..cce4b11f07d 100644 --- a/test/cpp/end2end/mock_test.cc +++ b/test/cpp/end2end/mock_test.cc @@ -182,8 +182,7 @@ class TestServiceImpl : public EchoTestService::Service { return Status::OK; } - Status ResponseStream(ServerContext* /*context*/, - const EchoRequest* request, + Status ResponseStream(ServerContext* /*context*/, const EchoRequest* request, ServerWriter* writer) override { EchoResponse response; vector tokens = split(request->message()); diff --git a/test/cpp/end2end/server_builder_plugin_test.cc b/test/cpp/end2end/server_builder_plugin_test.cc index c7343b30abd..5f3c5cefd89 100644 --- a/test/cpp/end2end/server_builder_plugin_test.cc +++ b/test/cpp/end2end/server_builder_plugin_test.cc @@ -61,12 +61,9 @@ class TestServerBuilderPlugin : public ServerBuilderPlugin { } } - void Finish(ServerInitializer* /*si*/) override { - finish_is_called_ = true; - } + void Finish(ServerInitializer* /*si*/) override { finish_is_called_ = true; } - void ChangeArguments(const grpc::string& /*name*/, - void* /*value*/) override { + void ChangeArguments(const grpc::string& /*name*/, void* /*value*/) override { change_arguments_is_called_ = true; } diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 14be8c3ad83..7aea97e49ff 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -423,8 +423,7 @@ class LrsServiceImpl : public LrsService { : client_load_reporting_interval_seconds_( client_load_reporting_interval_seconds) {} - Status StreamLoadStats(ServerContext* /*context*/, - Stream* stream) override { + Status StreamLoadStats(ServerContext* /*context*/, Stream* stream) override { gpr_log(GPR_INFO, "LB[%p]: LRS StreamLoadStats starts", this); // Read request. LoadStatsRequest request;