diff options
author | heretic <heretic@yandex-team.ru> | 2022-02-10 16:45:43 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:43 +0300 |
commit | 397cbe258b9e064f49c4ca575279f02f39fef76e (patch) | |
tree | a0b0eb3cca6a14e4e8ea715393637672fa651284 /contrib/libs/grpc/include/grpcpp/test | |
parent | 43f5a35593ebc9f6bcea619bb170394ea7ae468e (diff) | |
download | ydb-397cbe258b9e064f49c4ca575279f02f39fef76e.tar.gz |
Restoring authorship annotation for <heretic@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/grpc/include/grpcpp/test')
4 files changed, 59 insertions, 59 deletions
diff --git a/contrib/libs/grpc/include/grpcpp/test/channel_test_peer.h b/contrib/libs/grpc/include/grpcpp/test/channel_test_peer.h index e41bbfa460..9ef9d39b14 100644 --- a/contrib/libs/grpc/include/grpcpp/test/channel_test_peer.h +++ b/contrib/libs/grpc/include/grpcpp/test/channel_test_peer.h @@ -1,44 +1,44 @@ -/* - * - * Copyright 2020 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPCPP_TEST_CHANNEL_TEST_PEER_H -#define GRPCPP_TEST_CHANNEL_TEST_PEER_H - -#include <grpcpp/channel.h> - -namespace grpc { -namespace testing { - -/// A test-only class to access private members of Channel. -class ChannelTestPeer { - public: - explicit ChannelTestPeer(Channel* channel) : channel_(channel) {} - - /// Provide the gRPC Core channel - grpc_channel* channel() const { return channel_->c_channel_; } - int registered_calls() const; - int registration_attempts() const; - - private: - Channel* channel_; // not owned -}; - -} // namespace testing -} // namespace grpc - -#endif // GRPCPP_TEST_CHANNEL_TEST_PEER_H +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPCPP_TEST_CHANNEL_TEST_PEER_H +#define GRPCPP_TEST_CHANNEL_TEST_PEER_H + +#include <grpcpp/channel.h> + +namespace grpc { +namespace testing { + +/// A test-only class to access private members of Channel. +class ChannelTestPeer { + public: + explicit ChannelTestPeer(Channel* channel) : channel_(channel) {} + + /// Provide the gRPC Core channel + grpc_channel* channel() const { return channel_->c_channel_; } + int registered_calls() const; + int registration_attempts() const; + + private: + Channel* channel_; // not owned +}; + +} // namespace testing +} // namespace grpc + +#endif // GRPCPP_TEST_CHANNEL_TEST_PEER_H diff --git a/contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h b/contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h index a792e6f94a..93de30da5a 100644 --- a/contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h +++ b/contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h @@ -29,9 +29,9 @@ namespace testing { /// DefaultReactor. It is intended for allow unit-testing of a callback API /// service via direct invocation of the service methods rather than through /// RPCs. It is only applicable for unary RPC methods that use the -/// DefaultReactor rather than any user-defined reactor. If it is used, it must -/// be created before the RPC is invoked so that it can bind the reactor into a -/// test mode rather than letting it follow the normal paths. +/// DefaultReactor rather than any user-defined reactor. If it is used, it must +/// be created before the RPC is invoked so that it can bind the reactor into a +/// test mode rather than letting it follow the normal paths. class DefaultReactorTestPeer { public: explicit DefaultReactorTestPeer(experimental::CallbackServerContext* ctx) @@ -42,8 +42,8 @@ class DefaultReactorTestPeer { ctx->SetupTestDefaultReactor(std::move(finish_func)); } ::grpc::experimental::ServerUnaryReactor* reactor() const { - return reinterpret_cast<experimental::ServerUnaryReactor*>( - &ctx_->default_reactor_); + return reinterpret_cast<experimental::ServerUnaryReactor*>( + &ctx_->default_reactor_); } bool test_status_set() const { return ctx_->test_status_set(); } Status test_status() const { return ctx_->test_status(); } diff --git a/contrib/libs/grpc/include/grpcpp/test/mock_stream.h b/contrib/libs/grpc/include/grpcpp/test/mock_stream.h index e33595d709..056d3b2c35 100644 --- a/contrib/libs/grpc/include/grpcpp/test/mock_stream.h +++ b/contrib/libs/grpc/include/grpcpp/test/mock_stream.h @@ -31,7 +31,7 @@ namespace grpc { namespace testing { template <class R> -class MockClientReader : public ::grpc::ClientReaderInterface<R> { +class MockClientReader : public ::grpc::ClientReaderInterface<R> { public: MockClientReader() = default; @@ -47,7 +47,7 @@ class MockClientReader : public ::grpc::ClientReaderInterface<R> { }; template <class W> -class MockClientWriter : public ::grpc::ClientWriterInterface<W> { +class MockClientWriter : public ::grpc::ClientWriterInterface<W> { public: MockClientWriter() = default; @@ -63,7 +63,7 @@ class MockClientWriter : public ::grpc::ClientWriterInterface<W> { template <class W, class R> class MockClientReaderWriter - : public ::grpc::ClientReaderWriterInterface<W, R> { + : public ::grpc::ClientReaderWriterInterface<W, R> { public: MockClientReaderWriter() = default; @@ -86,7 +86,7 @@ class MockClientReaderWriter template <class R> class MockClientAsyncResponseReader - : public ::grpc::ClientAsyncResponseReaderInterface<R> { + : public ::grpc::ClientAsyncResponseReaderInterface<R> { public: MockClientAsyncResponseReader() = default; @@ -108,7 +108,7 @@ class MockClientAsyncReader : public ClientAsyncReaderInterface<R> { }; template <class W> -class MockClientAsyncWriter : public ::grpc::ClientAsyncWriterInterface<W> { +class MockClientAsyncWriter : public ::grpc::ClientAsyncWriterInterface<W> { public: MockClientAsyncWriter() = default; diff --git a/contrib/libs/grpc/include/grpcpp/test/server_context_test_spouse.h b/contrib/libs/grpc/include/grpcpp/test/server_context_test_spouse.h index 00c19dc4b8..28b1816bee 100644 --- a/contrib/libs/grpc/include/grpcpp/test/server_context_test_spouse.h +++ b/contrib/libs/grpc/include/grpcpp/test/server_context_test_spouse.h @@ -33,9 +33,9 @@ class ServerContextTestSpouse { /// Inject client metadata to the ServerContext for the test. The test spouse /// must be alive when \a ServerContext::client_metadata is called. - void AddClientMetadata(const TString& key, const TString& value) { + void AddClientMetadata(const TString& key, const TString& value) { client_metadata_storage_.insert( - std::pair<TString, TString>(key, value)); + std::pair<TString, TString>(key, value)); ctx_->client_metadata_.map()->clear(); for (const auto& item : client_metadata_storage_) { ctx_->client_metadata_.map()->insert( @@ -45,17 +45,17 @@ class ServerContextTestSpouse { } } - std::multimap<TString, TString> GetInitialMetadata() const { + std::multimap<TString, TString> GetInitialMetadata() const { return ctx_->initial_metadata_; } - std::multimap<TString, TString> GetTrailingMetadata() const { + std::multimap<TString, TString> GetTrailingMetadata() const { return ctx_->trailing_metadata_; } private: ServerContext* ctx_; // not owned - std::multimap<TString, TString> client_metadata_storage_; + std::multimap<TString, TString> client_metadata_storage_; }; } // namespace testing |