diff options
author | Mark D. Roth <roth@google.com> | 2018-02-08 10:26:46 -0800 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2018-02-08 10:26:46 -0800 |
commit | 209f644f047ccf8ab13b207ebb145dadc0d37a42 (patch) | |
tree | 60e67580c734d75a4761e2a0b300a1a976b226cb /test/cpp/client | |
parent | 7bd5e18fea0201fed3edd74e3c3d7caf9040609c (diff) |
Convert resolver API to C++.
Diffstat (limited to 'test/cpp/client')
-rw-r--r-- | test/cpp/client/client_channel_stress_test.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/cpp/client/client_channel_stress_test.cc b/test/cpp/client/client_channel_stress_test.cc index 80d1583333..bb8553f56a 100644 --- a/test/cpp/client/client_channel_stress_test.cc +++ b/test/cpp/client/client_channel_stress_test.cc @@ -36,6 +36,7 @@ #include <grpc/support/time.h> #include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" +#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/sockaddr.h" #include "test/core/util/port.h" @@ -230,8 +231,7 @@ class ClientChannelStressTest { } grpc_arg fake_addresses = grpc_lb_addresses_create_channel_arg(addresses); grpc_channel_args fake_result = {1, &fake_addresses}; - grpc_fake_resolver_response_generator_set_response(response_generator_, - &fake_result); + response_generator_->SetResponse(&fake_result); grpc_lb_addresses_destroy(addresses); } @@ -253,9 +253,10 @@ class ClientChannelStressTest { void CreateStub() { ChannelArguments args; - response_generator_ = grpc_fake_resolver_response_generator_create(); + response_generator_ = + grpc_core::MakeRefCounted<grpc_core::FakeResolverResponseGenerator>(); args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR, - response_generator_); + response_generator_.get()); std::ostringstream uri; uri << "fake:///servername_not_used"; channel_ = @@ -298,7 +299,6 @@ class ClientChannelStressTest { for (size_t i = 0; i < backends_.size(); ++i) { backend_servers_[i].Shutdown(); } - grpc_fake_resolver_response_generator_unref(response_generator_); } std::atomic_bool shutdown_{false}; @@ -310,7 +310,8 @@ class ClientChannelStressTest { std::vector<std::unique_ptr<BalancerServiceImpl>> balancers_; std::vector<ServerThread<BackendServiceImpl>> backend_servers_; std::vector<ServerThread<BalancerServiceImpl>> balancer_servers_; - grpc_fake_resolver_response_generator* response_generator_; + grpc_core::RefCountedPtr<grpc_core::FakeResolverResponseGenerator> + response_generator_; std::vector<std::thread> client_threads_; }; |