diff options
Diffstat (limited to 'test/core/end2end/connection_refused_test.c')
-rw-r--r-- | test/core/end2end/connection_refused_test.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/test/core/end2end/connection_refused_test.c b/test/core/end2end/connection_refused_test.c index 728d6dca59..16a3005539 100644 --- a/test/core/end2end/connection_refused_test.c +++ b/test/core/end2end/connection_refused_test.c @@ -40,6 +40,7 @@ #include <grpc/support/string_util.h> #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/transport/metadata.h" #include "src/core/lib/transport/service_config.h" @@ -52,15 +53,14 @@ static void *tag(intptr_t i) { return (void *)i; } static void run_test(bool wait_for_ready, bool use_service_config) { grpc_channel *chan; grpc_call *call; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(2); grpc_completion_queue *cq; cq_verifier *cqv; grpc_op ops[6]; grpc_op *op; grpc_metadata_array trailing_metadata_recv; grpc_status_code status; - char *details = NULL; - size_t details_capacity = 0; + grpc_slice details; gpr_log(GPR_INFO, "TEST: wait_for_ready=%d use_service_config=%d", wait_for_ready, use_service_config); @@ -97,9 +97,10 @@ static void run_test(bool wait_for_ready, bool use_service_config) { gpr_join_host_port(&addr, "127.0.0.1", port); gpr_log(GPR_INFO, "server: %s", addr); chan = grpc_insecure_channel_create(addr, args, NULL); - call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, - "/service/method", "nonexistant", deadline, - NULL); + grpc_slice host = grpc_slice_from_static_string("nonexistant"); + call = grpc_channel_create_call( + chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, + grpc_slice_from_static_string("/service/method"), &host, deadline, NULL); gpr_free(addr); @@ -116,7 +117,6 @@ static void run_test(bool wait_for_ready, bool use_service_config) { op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; op->data.recv_status_on_client.status = &status; op->data.recv_status_on_client.status_details = &details; - op->data.recv_status_on_client.status_details_capacity = &details_capacity; op->flags = 0; op->reserved = NULL; op++; @@ -142,10 +142,14 @@ static void run_test(bool wait_for_ready, bool use_service_config) { grpc_channel_destroy(chan); cq_verifier_destroy(cqv); - gpr_free(details); + grpc_slice_unref(details); grpc_metadata_array_destroy(&trailing_metadata_recv); - if (args != NULL) grpc_channel_args_destroy(args); + { + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + if (args != NULL) grpc_channel_args_destroy(&exec_ctx, args); + grpc_exec_ctx_finish(&exec_ctx); + } grpc_shutdown(); } |