diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2013-02-08 11:38:59 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-02-08 11:38:59 -0500 |
commit | adcb2d73b3377c749efcae5ae0e5471e10b6646f (patch) | |
tree | e79d696f05a4a0b375b316dacc8ab0b0410db916 /tests | |
parent | f02f82ef7802c4961c784121c4475e8958c8e41f (diff) |
queue-test: WEXITSTATUS() is undefined if WIFEXITED() is false
If a child process dies from a signal, WIFEXITED() returns false and
WEXITSTATUS() isn't well-defined. In this case, if the client segfaults,
the status is 134 and WEXITSTATUS(134) is EXIT_SUCCESS, so we mask the error.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/queue-test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/queue-test.c b/tests/queue-test.c index 681ac24..3abb71f 100644 --- a/tests/queue-test.c +++ b/tests/queue-test.c @@ -212,7 +212,7 @@ sigchld_handler(int signal_number, void *data) int status; waitpid(-1, &status, 0); - display->child_exit_status = WEXITSTATUS(status); + display->child_exit_status = status; wl_display_terminate(display->display); @@ -282,5 +282,6 @@ TEST(queue) wl_event_source_remove(signal_source); wl_display_destroy(display.display); - assert(display.child_exit_status == EXIT_SUCCESS); + assert(WIFEXITED(display.child_exit_status) && + WEXITSTATUS(display.child_exit_status) == EXIT_SUCCESS); } |