From 81fc8c9c336fab7a71b448f748a32d680301277c Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Tue, 28 Nov 2017 13:23:36 -0800 Subject: Fix tests to call grpc_init and grpc_shutdown before using exec_ctx --- test/core/slice/b64_test.cc | 3 +++ test/core/slice/percent_encoding_test.cc | 3 +++ test/core/slice/slice_buffer_test.cc | 3 +++ test/core/slice/slice_hash_table_test.cc | 2 ++ test/core/slice/slice_string_helpers_test.cc | 3 +++ test/core/slice/slice_test.cc | 2 ++ 6 files changed, 16 insertions(+) (limited to 'test/core/slice') diff --git a/test/core/slice/b64_test.cc b/test/core/slice/b64_test.cc index 08a5770b2a..e0c7ed361d 100644 --- a/test/core/slice/b64_test.cc +++ b/test/core/slice/b64_test.cc @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -201,6 +202,7 @@ static void test_unpadded_decode(void) { int main(int argc, char** argv) { grpc_test_init(argc, argv); + grpc_init(); test_simple_encode_decode_b64_no_multiline(); test_simple_encode_decode_b64_multiline(); test_simple_encode_decode_b64_urlsafe_no_multiline(); @@ -212,5 +214,6 @@ int main(int argc, char** argv) { test_url_safe_unsafe_mismatch_failure(); test_rfc4648_test_vectors(); test_unpadded_decode(); + grpc_shutdown(); return 0; } diff --git a/test/core/slice/percent_encoding_test.cc b/test/core/slice/percent_encoding_test.cc index 253240faad..11f3995f98 100644 --- a/test/core/slice/percent_encoding_test.cc +++ b/test/core/slice/percent_encoding_test.cc @@ -18,6 +18,7 @@ #include "src/core/lib/slice/percent_encoding.h" +#include #include #include @@ -118,6 +119,7 @@ static void test_nonconformant_vector(const char* encoded, int main(int argc, char** argv) { grpc_test_init(argc, argv); + grpc_init(); TEST_VECTOR( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~", @@ -140,5 +142,6 @@ int main(int argc, char** argv) { grpc_url_percent_encoding_unreserved_bytes); TEST_NONCONFORMANT_VECTOR("\0", "\0", grpc_url_percent_encoding_unreserved_bytes); + grpc_shutdown(); return 0; } diff --git a/test/core/slice/slice_buffer_test.cc b/test/core/slice/slice_buffer_test.cc index 338e8079dc..e59986730b 100644 --- a/test/core/slice/slice_buffer_test.cc +++ b/test/core/slice/slice_buffer_test.cc @@ -16,6 +16,7 @@ * */ +#include #include #include #include "test/core/util/test_config.h" @@ -106,9 +107,11 @@ void test_slice_buffer_move_first() { int main(int argc, char** argv) { grpc_test_init(argc, argv); + grpc_init(); test_slice_buffer_add(); test_slice_buffer_move_first(); + grpc_shutdown(); return 0; } diff --git a/test/core/slice/slice_hash_table_test.cc b/test/core/slice/slice_hash_table_test.cc index 26c2938782..1cbb241a98 100644 --- a/test/core/slice/slice_hash_table_test.cc +++ b/test/core/slice/slice_hash_table_test.cc @@ -231,8 +231,10 @@ static void test_slice_hash_table_not_eq() { int main(int argc, char** argv) { grpc_test_init(argc, argv); + grpc_core::ExecCtx::GlobalInit(); test_slice_hash_table(); test_slice_hash_table_eq(); test_slice_hash_table_not_eq(); + grpc_core::ExecCtx::GlobalShutdown(); return 0; } diff --git a/test/core/slice/slice_string_helpers_test.cc b/test/core/slice/slice_string_helpers_test.cc index 260f8c80d5..f1d470461a 100644 --- a/test/core/slice/slice_string_helpers_test.cc +++ b/test/core/slice/slice_string_helpers_test.cc @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -130,7 +131,9 @@ static void test_strsplit(void) { int main(int argc, char** argv) { grpc_test_init(argc, argv); + grpc_init(); test_dump_slice(); test_strsplit(); + grpc_shutdown(); return 0; } diff --git a/test/core/slice/slice_test.cc b/test/core/slice/slice_test.cc index 02f6b1ea79..e40154dd0e 100644 --- a/test/core/slice/slice_test.cc +++ b/test/core/slice/slice_test.cc @@ -292,6 +292,7 @@ static void test_static_slice_copy_interning(void) { int main(int argc, char** argv) { unsigned length; grpc_test_init(argc, argv); + grpc_init(); test_slice_malloc_returns_something_sensible(); test_slice_new_returns_something_sensible(); test_slice_new_with_user_data(); @@ -305,5 +306,6 @@ int main(int argc, char** argv) { test_slice_interning(); test_static_slice_interning(); test_static_slice_copy_interning(); + grpc_shutdown(); return 0; } -- cgit v1.2.3