From 99479062dbb738ebc5892e163b701680cea91980 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Fri, 18 Nov 2016 16:50:34 +0000 Subject: [PATCH] core::init tests: reverse init/shutdown We want a predictable number of initializations in our multithreaded init test, but we also want to make sure that we have _actually_ initialized `git_libgit2_init` before calling `git_thread_create` (since it now has a sanity check that `git_libgit2_init` has been called). Since `git_thread_create` is internal-only, keep this sanity check. Flip the invocation so that we `git_libgit2_init` before our thread tests and `git_libgit2_shutdown` again after. --- tests/core/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/core/init.c b/tests/core/init.c index cd90b378d..a8cbd930b 100644 --- a/tests/core/init.c +++ b/tests/core/init.c @@ -39,14 +39,14 @@ void test_core_init__concurrent_init_succeeds(void) git_thread threads[10]; unsigned i; - cl_assert_equal_i(0, git_libgit2_shutdown()); + cl_assert_equal_i(2, git_libgit2_init()); for (i = 0; i < ARRAY_SIZE(threads); i++) git_thread_create(&threads[i], reinit, NULL); for (i = 0; i < ARRAY_SIZE(threads); i++) git_thread_join(&threads[i], NULL); - cl_assert_equal_i(1, git_libgit2_init()); + cl_assert_equal_i(1, git_libgit2_shutdown()); cl_sandbox_set_search_path_defaults(); #else cl_skip();