From 473ff83facfadc823523d3f833924c661432a943 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 14 Dec 2016 08:21:12 -0800 Subject: Fix filter_end2end_test. --- test/cpp/end2end/filter_end2end_test.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'test/cpp/end2end') diff --git a/test/cpp/end2end/filter_end2end_test.cc b/test/cpp/end2end/filter_end2end_test.cc index ab6ed46de5..28bd6baab8 100644 --- a/test/cpp/end2end/filter_end2end_test.cc +++ b/test/cpp/end2end/filter_end2end_test.cc @@ -114,20 +114,17 @@ int GetCallCounterValue() { class ChannelDataImpl : public ChannelData { public: - ChannelDataImpl(const grpc_channel_args& args, const char* peer) - : ChannelData(args, peer) { + grpc_error *Init(grpc_exec_ctx *exec_ctx, grpc_channel_element_args *args) { IncrementConnectionCounter(); + return GRPC_ERROR_NONE; } }; class CallDataImpl : public CallData { public: - explicit CallDataImpl(const ChannelDataImpl& channel_data) - : CallData(channel_data) {} - void StartTransportStreamOp(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, TransportStreamOp* op) override { - // Incrementing the counter could be done from the ctor, but we want + // Incrementing the counter could be done from Init(), but we want // to test that the individual methods are actually called correctly. if (op->recv_initial_metadata() != nullptr) IncrementCallCounter(); grpc_call_next_op(exec_ctx, elem, op->op()); -- cgit v1.2.3 From 13f35746426b9dcca3d751b3f7f298859ae18936 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 14 Dec 2016 12:39:03 -0800 Subject: clang-format --- src/cpp/common/channel_filter.h | 6 ++---- test/cpp/common/channel_filter_test.cc | 8 ++++---- test/cpp/end2end/filter_end2end_test.cc | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'test/cpp/end2end') diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h index f4652cee77..c9f50df732 100644 --- a/src/cpp/common/channel_filter.h +++ b/src/cpp/common/channel_filter.h @@ -216,8 +216,7 @@ class TransportStreamOp { /// Represents channel data. class ChannelData { public: - virtual ~ChannelData() { - } + virtual ~ChannelData() {} /// Initializes the call data. virtual grpc_error *Init(grpc_exec_ctx *exec_ctx, @@ -309,8 +308,7 @@ class ChannelFilter final { static grpc_error *InitCallElement(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_call_element_args *args) { - ChannelDataType *channel_data = - (ChannelDataType *)elem->channel_data; + ChannelDataType *channel_data = (ChannelDataType *)elem->channel_data; // Construct the object in the already-allocated memory. CallDataType *call_data = new (elem->call_data) CallDataType(); return call_data->Init(exec_ctx, channel_data, args); diff --git a/test/cpp/common/channel_filter_test.cc b/test/cpp/common/channel_filter_test.cc index 0859cc024b..32246a4b76 100644 --- a/test/cpp/common/channel_filter_test.cc +++ b/test/cpp/common/channel_filter_test.cc @@ -43,8 +43,8 @@ class MyChannelData : public ChannelData { public: MyChannelData() {} - grpc_error *Init(grpc_exec_ctx *exec_ctx, grpc_channel_element_args *args) - override { + grpc_error* Init(grpc_exec_ctx* exec_ctx, + grpc_channel_element_args* args) override { (void)args->channel_args; // Make sure field is available. return GRPC_ERROR_NONE; } @@ -54,8 +54,8 @@ class MyCallData : public CallData { public: MyCallData() {} - grpc_error *Init(grpc_exec_ctx *exec_ctx, ChannelData *channel_data, - grpc_call_element_args *args) override { + grpc_error* Init(grpc_exec_ctx* exec_ctx, ChannelData* channel_data, + grpc_call_element_args* args) override { (void)args->path; // Make sure field is available. return GRPC_ERROR_NONE; } diff --git a/test/cpp/end2end/filter_end2end_test.cc b/test/cpp/end2end/filter_end2end_test.cc index 28bd6baab8..bd384f68b4 100644 --- a/test/cpp/end2end/filter_end2end_test.cc +++ b/test/cpp/end2end/filter_end2end_test.cc @@ -114,7 +114,7 @@ int GetCallCounterValue() { class ChannelDataImpl : public ChannelData { public: - grpc_error *Init(grpc_exec_ctx *exec_ctx, grpc_channel_element_args *args) { + grpc_error* Init(grpc_exec_ctx* exec_ctx, grpc_channel_element_args* args) { IncrementConnectionCounter(); return GRPC_ERROR_NONE; } -- cgit v1.2.3