diff options
author | Ola Bini <ola@olabini.se> | 2015-10-05 14:07:55 -0500 |
---|---|---|
committer | Ola Bini <ola@olabini.se> | 2015-10-05 14:07:55 -0500 |
commit | c31791b79886dd697f02af78b86281ad6d5e407d (patch) | |
tree | 7c38c195684ee44d064f83cb8ff210ac6f4a84fe /src/test/test_util_process.c | |
parent | cf4f50f94332615abcf6dd345ee1e8fce69232ca (diff) | |
download | tor-c31791b79886dd697f02af78b86281ad6d5e407d.tar.gz tor-c31791b79886dd697f02af78b86281ad6d5e407d.zip |
Test behavior on success, and fix spaces
Diffstat (limited to 'src/test/test_util_process.c')
-rw-r--r-- | src/test/test_util_process.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/test/test_util_process.c b/src/test/test_util_process.c index 5d6c072f3f..5d45b58d3e 100644 --- a/src/test/test_util_process.c +++ b/src/test/test_util_process.c @@ -13,8 +13,8 @@ #define NS_MODULE util_process -static -void temp_callback(int r, void *s) +static void +temp_callback(int r, void *s) { (void)r; (void)s; @@ -33,13 +33,14 @@ test_util_process_set_waitpid_callback(void *ignored) res = set_waitpid_callback(pid, temp_callback, NULL); tt_assert(res); - tt_str_op(mock_saved_log_at(0), OP_EQ, "Replaced a waitpid monitor on pid 42. That should be impossible.\n"); + tt_str_op(mock_saved_log_at(0), OP_EQ, + "Replaced a waitpid monitor on pid 42. That should be " + "impossible.\n"); done: teardown_capture_of_logs(previous_log); } - static void test_util_process_clear_waitpid_callback(void *ignored) { @@ -52,16 +53,20 @@ test_util_process_clear_waitpid_callback(void *ignored) res = set_waitpid_callback(pid, temp_callback, NULL); clear_waitpid_callback(res); + tt_int_op(mock_saved_log_number(), OP_EQ, 0); + clear_waitpid_callback(res); + tt_str_op(mock_saved_log_at(0), OP_EQ, + "Couldn't remove waitpid monitor for pid 43.\n"); - // done: + done: teardown_capture_of_logs(previous_log); } - - struct testcase_t util_process_tests[] = { - { "set_waitpid_callback", test_util_process_set_waitpid_callback, 0, NULL, NULL }, - { "clear_waitpid_callback", test_util_process_clear_waitpid_callback, 0, NULL, NULL }, + { "set_waitpid_callback", test_util_process_set_waitpid_callback, 0, + NULL, NULL }, + { "clear_waitpid_callback", test_util_process_clear_waitpid_callback, 0, + NULL, NULL }, END_OF_TESTCASES }; |