aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/slice
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-28 13:23:36 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-28 13:23:36 -0800
commit81fc8c9c336fab7a71b448f748a32d680301277c (patch)
tree5cd64fd191db0f87d59ef53768c1b6760b4f1654 /test/core/slice
parent3285f4c7329bf4305133be74f88dd4b10d5e2052 (diff)
Fix tests to call grpc_init and grpc_shutdown before using exec_ctx
Diffstat (limited to 'test/core/slice')
-rw-r--r--test/core/slice/b64_test.cc3
-rw-r--r--test/core/slice/percent_encoding_test.cc3
-rw-r--r--test/core/slice/slice_buffer_test.cc3
-rw-r--r--test/core/slice/slice_hash_table_test.cc2
-rw-r--r--test/core/slice/slice_string_helpers_test.cc3
-rw-r--r--test/core/slice/slice_test.cc2
6 files changed, 16 insertions, 0 deletions
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 <string.h>
+#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -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 <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -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 <grpc/grpc.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/log.h>
#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 <stdlib.h>
#include <string.h>
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -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;
}