diff options
author | Craig Tiller <ctiller@google.com> | 2017-08-30 09:41:41 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-08-30 09:41:41 -0700 |
commit | 413e95b8ed8eda45b28d2f81835d5777097b8259 (patch) | |
tree | 79cb9d4e1cbde418a47aea2ba49ef959833d551b | |
parent | a0116f36ec3980f39d16b173ed61cc48f47ccbcf (diff) |
Fix crash
-rw-r--r-- | test/core/iomgr/fd_posix_test.c | 6 | ||||
-rw-r--r-- | test/core/iomgr/resolve_address_posix_test.c | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c index 85d5d9c07f..5791d17af6 100644 --- a/test/core/iomgr/fd_posix_test.c +++ b/test/core/iomgr/fd_posix_test.c @@ -35,6 +35,7 @@ #include <sys/time.h> #include <unistd.h> +#include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/sync.h> @@ -530,8 +531,7 @@ int main(int argc, char **argv) { grpc_closure destroyed; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_test_init(argc, argv); - grpc_iomgr_init(&exec_ctx); - grpc_iomgr_start(&exec_ctx); + grpc_init(); g_pollset = gpr_zalloc(grpc_pollset_size()); grpc_pollset_init(g_pollset, &g_mu); test_grpc_fd(); @@ -541,8 +541,8 @@ int main(int argc, char **argv) { grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed); grpc_exec_ctx_flush(&exec_ctx); gpr_free(g_pollset); - grpc_iomgr_shutdown(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx); + grpc_shutdown(); return 0; } diff --git a/test/core/iomgr/resolve_address_posix_test.c b/test/core/iomgr/resolve_address_posix_test.c index 9cc09ed5d3..e4be99f03c 100644 --- a/test/core/iomgr/resolve_address_posix_test.c +++ b/test/core/iomgr/resolve_address_posix_test.c @@ -21,12 +21,14 @@ #include <string.h> #include <sys/un.h> +#include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/sync.h> #include <grpc/support/thd.h> #include <grpc/support/time.h> #include <grpc/support/useful.h> + #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/iomgr.h" #include "test/core/util/test_config.h" @@ -159,13 +161,12 @@ static void test_unix_socket_path_name_too_long(void) { int main(int argc, char **argv) { grpc_test_init(argc, argv); + grpc_init(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_iomgr_init(&exec_ctx); - grpc_iomgr_start(&exec_ctx); test_unix_socket(); test_unix_socket_path_name_too_long(); grpc_executor_shutdown(&exec_ctx); - grpc_iomgr_shutdown(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx); + grpc_shutdown(); return 0; } |