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.
This commit is contained in:
Thomas Haller 2019-06-13 11:26:31 +02:00
parent a3e75f3294
commit 49c6fa2ba7

View file

@ -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 ();
}
}
/*****************************************************************************/