diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-12-06 09:47:49 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-06 09:47:49 -0800 |
commit | 1d4e99508409be052bd129ba507bae1fbe7eb7fa (patch) | |
tree | 6a657f8c6179d873b34505cdc24bce9462ca68eb /test/core/client_channel/resolvers/sockaddr_resolver_test.cc | |
parent | a3df36cc2505a89c2f481eea4a66a87b3002844a (diff) | |
parent | ad4d2dde0052efbbf49d64b0843c45f0381cfeb3 (diff) |
Merge pull request #13658 from grpc/revert-13058-execctx
Revert "All instances of exec_ctx being passed around in src/core removed"
Diffstat (limited to 'test/core/client_channel/resolvers/sockaddr_resolver_test.cc')
-rw-r--r-- | test/core/client_channel/resolvers/sockaddr_resolver_test.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc index 4d16a77924..dfa2d12b5e 100644 --- a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc +++ b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc @@ -35,14 +35,14 @@ typedef struct on_resolution_arg { grpc_channel_args* resolver_result; } on_resolution_arg; -void on_resolution_cb(void* arg, grpc_error* error) { +void on_resolution_cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { on_resolution_arg* res = static_cast<on_resolution_arg*>(arg); - grpc_channel_args_destroy(res->resolver_result); + grpc_channel_args_destroy(exec_ctx, res->resolver_result); } static void test_succeeds(grpc_resolver_factory* factory, const char* string) { - grpc_core::ExecCtx exec_ctx; - grpc_uri* uri = grpc_uri_parse(string, 0); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_uri* uri = grpc_uri_parse(&exec_ctx, string, 0); grpc_resolver_args args; grpc_resolver* resolver; gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", string, @@ -51,7 +51,7 @@ static void test_succeeds(grpc_resolver_factory* factory, const char* string) { memset(&args, 0, sizeof(args)); args.uri = uri; args.combiner = g_combiner; - resolver = grpc_resolver_factory_create_resolver(factory, &args); + resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args); GPR_ASSERT(resolver != nullptr); on_resolution_arg on_res_arg; @@ -60,16 +60,16 @@ static void test_succeeds(grpc_resolver_factory* factory, const char* string) { grpc_closure* on_resolution = GRPC_CLOSURE_CREATE( on_resolution_cb, &on_res_arg, grpc_schedule_on_exec_ctx); - grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result, + grpc_resolver_next_locked(&exec_ctx, resolver, &on_res_arg.resolver_result, on_resolution); - GRPC_RESOLVER_UNREF(resolver, "test_succeeds"); - + GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds"); + grpc_exec_ctx_finish(&exec_ctx); grpc_uri_destroy(uri); } static void test_fails(grpc_resolver_factory* factory, const char* string) { - grpc_core::ExecCtx exec_ctx; - grpc_uri* uri = grpc_uri_parse(string, 0); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_uri* uri = grpc_uri_parse(&exec_ctx, string, 0); grpc_resolver_args args; grpc_resolver* resolver; gpr_log(GPR_DEBUG, "test: '%s' should be invalid for '%s'", string, @@ -78,9 +78,10 @@ static void test_fails(grpc_resolver_factory* factory, const char* string) { memset(&args, 0, sizeof(args)); args.uri = uri; args.combiner = g_combiner; - resolver = grpc_resolver_factory_create_resolver(factory, &args); + resolver = grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args); GPR_ASSERT(resolver == nullptr); grpc_uri_destroy(uri); + grpc_exec_ctx_finish(&exec_ctx); } int main(int argc, char** argv) { @@ -111,8 +112,9 @@ int main(int argc, char** argv) { grpc_resolver_factory_unref(ipv6); { - grpc_core::ExecCtx exec_ctx; - GRPC_COMBINER_UNREF(g_combiner, "test"); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_COMBINER_UNREF(&exec_ctx, g_combiner, "test"); + grpc_exec_ctx_finish(&exec_ctx); } grpc_shutdown(); |