diff options
author | Craig Tiller <ctiller@google.com> | 2016-05-06 14:26:12 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-05-06 14:26:12 -0700 |
commit | f707d62db625e3929680d165f2fbc67f9c8d3f9c (patch) | |
tree | 0741e3319b8a90ffe177752e8743db416de4f066 /test/core/util | |
parent | ddad97899654c1eb3805ec165e842f8f465702a1 (diff) |
Convert tests to new error scheme
Diffstat (limited to 'test/core/util')
-rw-r--r-- | test/core/util/test_tcp_server.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.c index e39a95712c..fc89c41907 100644 --- a/test/core/util/test_tcp_server.c +++ b/test/core/util/test_tcp_server.c @@ -46,7 +46,7 @@ #include "test/core/util/port.h" static void on_server_destroyed(grpc_exec_ctx *exec_ctx, void *data, - bool success) { + grpc_error *error) { test_tcp_server *server = data; server->shutdown = 1; } @@ -72,9 +72,12 @@ void test_tcp_server_start(test_tcp_server *server, int port) { addr.sin_port = htons((uint16_t)port); memset(&addr.sin_addr, 0, sizeof(addr.sin_addr)); - server->tcp_server = grpc_tcp_server_create(&server->shutdown_complete); - port_added = - grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr)); + grpc_error *error = + grpc_tcp_server_create(&server->shutdown_complete, &server->tcp_server); + GPR_ASSERT(error == GRPC_ERROR_NONE); + error = grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr), + &port_added); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(port_added == port); grpc_tcp_server_start(&exec_ctx, server->tcp_server, &server->pollset, 1, @@ -97,7 +100,7 @@ void test_tcp_server_poll(test_tcp_server *server, int seconds) { grpc_exec_ctx_finish(&exec_ctx); } -static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, bool success) {} +static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {} void test_tcp_server_destroy(test_tcp_server *server) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; |