Skip to content

Commit c40d2dc

Browse files
committed
thread: restore the git_thread_exit tests
We were never properly testing git_thread_exit. Do so.
1 parent 4853d94 commit c40d2dc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/threads/basic.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ static void *return_normally(void *param)
5454
{
5555
return param;
5656
}
57+
58+
static void *exit_abruptly(void *param)
59+
{
60+
git_thread_exit(param);
61+
return NULL;
62+
}
5763
#endif
5864

5965
void test_threads_basic__exit(void)
@@ -70,7 +76,7 @@ void test_threads_basic__exit(void)
7076
cl_assert_equal_sz(424242, (size_t)result);
7177

7278
/* Ensure that the return value of `git_thread_exit` is returned. */
73-
cl_git_pass(git_thread_create(&thread, return_normally, (void *)232323));
79+
cl_git_pass(git_thread_create(&thread, exit_abruptly, (void *)232323));
7480
cl_git_pass(git_thread_join(&thread, &result));
7581
cl_assert_equal_sz(232323, (size_t)result);
7682
#endif

0 commit comments

Comments
 (0)