diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2020-05-15 10:09:51 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-07-11 12:18:32 +0100 |
| commit | 373e8237dbf7d9a4e7c6a76258b413674978dae0 (patch) | |
| tree | 28efd5d5930f18da0f79fd5af929e6450cce318b | |
| parent | ddeb3f5080ef58497e700a123e36266cb40dde13 (diff) | |
| download | libgit2-373e8237dbf7d9a4e7c6a76258b413674978dae0.tar.gz | |
thread: restore the git_thread_exit tests
We were never properly testing git_thread_exit. Do so.
| -rw-r--r-- | tests/threads/basic.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/threads/basic.c b/tests/threads/basic.c index ed4fd2f9b..2d7ddc26b 100644 --- a/tests/threads/basic.c +++ b/tests/threads/basic.c @@ -54,6 +54,12 @@ static void *return_normally(void *param) { return param; } + +static void *exit_abruptly(void *param) +{ + git_thread_exit(param); + return NULL; +} #endif void test_threads_basic__exit(void) @@ -70,7 +76,7 @@ void test_threads_basic__exit(void) cl_assert_equal_sz(424242, (size_t)result); /* Ensure that the return value of `git_thread_exit` is returned. */ - cl_git_pass(git_thread_create(&thread, return_normally, (void *)232323)); + cl_git_pass(git_thread_create(&thread, exit_abruptly, (void *)232323)); cl_git_pass(git_thread_join(&thread, &result)); cl_assert_equal_sz(232323, (size_t)result); #endif |
