aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_channel/resolvers/sockaddr_resolver_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/client_channel/resolvers/sockaddr_resolver_test.cc')
-rw-r--r--test/core/client_channel/resolvers/sockaddr_resolver_test.cc28
1 files changed, 13 insertions, 15 deletions
diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc
index dfa2d12b5e..4d16a77924 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(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+void on_resolution_cb(void* arg, grpc_error* error) {
on_resolution_arg* res = static_cast<on_resolution_arg*>(arg);
- grpc_channel_args_destroy(exec_ctx, res->resolver_result);
+ grpc_channel_args_destroy(res->resolver_result);
}
static void test_succeeds(grpc_resolver_factory* factory, const char* string) {
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_uri* uri = grpc_uri_parse(&exec_ctx, string, 0);
+ grpc_core::ExecCtx exec_ctx;
+ grpc_uri* uri = grpc_uri_parse(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(&exec_ctx, factory, &args);
+ resolver = grpc_resolver_factory_create_resolver(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(&exec_ctx, resolver, &on_res_arg.resolver_result,
+ grpc_resolver_next_locked(resolver, &on_res_arg.resolver_result,
on_resolution);
- GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");
- grpc_exec_ctx_finish(&exec_ctx);
+ GRPC_RESOLVER_UNREF(resolver, "test_succeeds");
+
grpc_uri_destroy(uri);
}
static void test_fails(grpc_resolver_factory* factory, const char* string) {
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_uri* uri = grpc_uri_parse(&exec_ctx, string, 0);
+ grpc_core::ExecCtx exec_ctx;
+ grpc_uri* uri = grpc_uri_parse(string, 0);
grpc_resolver_args args;
grpc_resolver* resolver;
gpr_log(GPR_DEBUG, "test: '%s' should be invalid for '%s'", string,
@@ -78,10 +78,9 @@ 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(&exec_ctx, factory, &args);
+ resolver = grpc_resolver_factory_create_resolver(factory, &args);
GPR_ASSERT(resolver == nullptr);
grpc_uri_destroy(uri);
- grpc_exec_ctx_finish(&exec_ctx);
}
int main(int argc, char** argv) {
@@ -112,9 +111,8 @@ int main(int argc, char** argv) {
grpc_resolver_factory_unref(ipv6);
{
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- GRPC_COMBINER_UNREF(&exec_ctx, g_combiner, "test");
- grpc_exec_ctx_finish(&exec_ctx);
+ grpc_core::ExecCtx exec_ctx;
+ GRPC_COMBINER_UNREF(g_combiner, "test");
}
grpc_shutdown();