From 49c6fa2ba763955cd2a2aeab6517e7105f3e4931 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 13 Jun 2019 11:26:31 +0200 Subject: [PATCH] src/tests: show exit status in test failure of test_nm_utils_kill_child() This test keeps randomly failing. Rework is, so that we see the actual exit status in the output of the failed test. --- src/tests/test-core-with-expect.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tests/test-core-with-expect.c b/src/tests/test-core-with-expect.c index 19e5a342d4..d38025ecb1 100644 --- a/src/tests/test-core-with-expect.c +++ b/src/tests/test-core-with-expect.c @@ -384,7 +384,12 @@ test_nm_utils_kill_child (void) err = waitpid (child_pid, &exit_status, 0); } while (err == -1 && errno == EINTR); g_assert (err == child_pid); - g_assert (WIFEXITED (exit_status) && WEXITSTATUS(exit_status) == 0); + if (WIFEXITED (exit_status)) + g_assert_cmpint (WEXITSTATUS (exit_status), ==, 0); + else { + g_assert_cmpint (exit_status, ==, 0); + g_assert_not_reached (); + } } /*****************************************************************************/