mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-14 12:37:38 +00:00
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.
This commit is contained in:
parent
82f15896de
commit
99479062db
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user