aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_channel/resolvers
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/client_channel/resolvers')
-rw-r--r--test/core/client_channel/resolvers/dns_resolver_connectivity_test.c11
-rw-r--r--test/core/client_channel/resolvers/sockaddr_resolver_test.c5
2 files changed, 4 insertions, 12 deletions
diff --git a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c
index 5ba8ef85e7..66e55fb01d 100644
--- a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c
+++ b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c
@@ -63,8 +63,8 @@ static grpc_error *my_resolve_address(const char *name, const char *addr,
}
}
-static grpc_resolver *create_resolver(const char *name) {
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+static grpc_resolver *create_resolver(grpc_exec_ctx *exec_ctx,
+ const char *name) {
grpc_resolver_factory *factory = grpc_resolver_factory_lookup("dns");
grpc_uri *uri = grpc_uri_parse(name, 0);
GPR_ASSERT(uri);
@@ -72,10 +72,9 @@ static grpc_resolver *create_resolver(const char *name) {
memset(&args, 0, sizeof(args));
args.uri = uri;
grpc_resolver *resolver =
- grpc_resolver_factory_create_resolver(&exec_ctx, factory, &args);
+ grpc_resolver_factory_create_resolver(exec_ctx, factory, &args);
grpc_resolver_factory_unref(factory);
grpc_uri_destroy(uri);
- grpc_exec_ctx_finish(&exec_ctx);
return resolver;
}
@@ -103,12 +102,10 @@ int main(int argc, char **argv) {
grpc_init();
gpr_mu_init(&g_mu);
grpc_blocking_resolve_address = my_resolve_address;
-
- grpc_resolver *resolver = create_resolver("dns:test");
-
grpc_channel_args *result = (grpc_channel_args *)1;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_resolver *resolver = create_resolver(&exec_ctx, "dns:test");
gpr_event ev1;
gpr_event_init(&ev1);
grpc_resolver_next(&exec_ctx, resolver, &result,
diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.c b/test/core/client_channel/resolvers/sockaddr_resolver_test.c
index bf49fb155d..378307ff67 100644
--- a/test/core/client_channel/resolvers/sockaddr_resolver_test.c
+++ b/test/core/client_channel/resolvers/sockaddr_resolver_test.c
@@ -49,11 +49,6 @@ typedef struct on_resolution_arg {
void on_resolution_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
on_resolution_arg *res = arg;
- const grpc_arg *channel_arg =
- grpc_channel_args_find(res->resolver_result, GRPC_ARG_SERVER_NAME);
- GPR_ASSERT(channel_arg != NULL);
- GPR_ASSERT(channel_arg->type == GRPC_ARG_STRING);
- GPR_ASSERT(strcmp(res->expected_server_name, channel_arg->value.string) == 0);
grpc_channel_args_destroy(exec_ctx, res->resolver_result);
}