From f707d62db625e3929680d165f2fbc67f9c8d3f9c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 6 May 2016 14:26:12 -0700 Subject: Convert tests to new error scheme --- test/core/transport/connectivity_state_test.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test/core/transport/connectivity_state_test.c') diff --git a/test/core/transport/connectivity_state_test.c b/test/core/transport/connectivity_state_test.c index 6bb7c3b06b..0b7a7013b3 100644 --- a/test/core/transport/connectivity_state_test.c +++ b/test/core/transport/connectivity_state_test.c @@ -43,14 +43,15 @@ int g_counter; -static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - GPR_ASSERT(success); +static void must_succeed(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(arg == THE_ARG); g_counter++; } -static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, bool success) { - GPR_ASSERT(!success); +static void must_fail(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { + GPR_ASSERT(error != GRPC_ERROR_NONE); GPR_ASSERT(arg == THE_ARG); g_counter++; } @@ -74,9 +75,12 @@ static void test_connectivity_state_name(void) { static void test_check(void) { grpc_connectivity_state_tracker tracker; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_error *error; gpr_log(GPR_DEBUG, "test_check"); grpc_connectivity_state_init(&tracker, GRPC_CHANNEL_IDLE, "xxx"); - GPR_ASSERT(grpc_connectivity_state_check(&tracker) == GRPC_CHANNEL_IDLE); + GPR_ASSERT(grpc_connectivity_state_check(&tracker, &error) == + GRPC_CHANNEL_IDLE); + GPR_ASSERT(error == GRPC_ERROR_NONE); grpc_connectivity_state_destroy(&exec_ctx, &tracker); grpc_exec_ctx_finish(&exec_ctx); } -- cgit v1.2.3 From 16ebf5a124026f8e9d59894b214d2e743590a93e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Jun 2016 15:40:53 -0700 Subject: Fix transitional typo --- test/core/transport/connectivity_state_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/core/transport/connectivity_state_test.c') diff --git a/test/core/transport/connectivity_state_test.c b/test/core/transport/connectivity_state_test.c index 69c00a8ea0..1050059eff 100644 --- a/test/core/transport/connectivity_state_test.c +++ b/test/core/transport/connectivity_state_test.c @@ -68,7 +68,7 @@ static void test_connectivity_state_name(void) { 0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_TRANSIENT_FAILURE), "TRANSIENT_FAILURE")); GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_SHUTDOWN), - "FATAL_FAILURE")); + "SHUTDOWN")); } static void test_check(void) { -- cgit v1.2.3