From a7e5a0bd9cbb3f8625a23fdc0987dbef90648921 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 13 Jul 2017 10:17:11 -0700 Subject: [PATCH 1/2] Add a test of repeatedly calling grpc_init then grpc_shutdown --- test/core/surface/init_test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/core/surface/init_test.c b/test/core/surface/init_test.c index 47900c51d73..78789824512 100644 --- a/test/core/surface/init_test.c +++ b/test/core/surface/init_test.c @@ -52,6 +52,13 @@ static void test_plugin() { GPR_ASSERT(g_flag == 2); } +static void test_repeatedly() { + for (int i=0; i<100000; i++) { + grpc_init(); + grpc_shutdown(); + } +} + int main(int argc, char **argv) { grpc_test_init(argc, argv); test(1); @@ -59,5 +66,6 @@ int main(int argc, char **argv) { test(3); test_mixed(); test_plugin(); + test_repeatedly(); return 0; } From e251fbac20bd27d0b57c3a87696cc300575e04f2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 13 Jul 2017 10:41:17 -0700 Subject: [PATCH 2/2] clang-format --- test/core/surface/init_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/surface/init_test.c b/test/core/surface/init_test.c index 78789824512..a9e80575af1 100644 --- a/test/core/surface/init_test.c +++ b/test/core/surface/init_test.c @@ -53,7 +53,7 @@ static void test_plugin() { } static void test_repeatedly() { - for (int i=0; i<100000; i++) { + for (int i = 0; i < 100000; i++) { grpc_init(); grpc_shutdown(); }