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.

(cherry picked from commit 49c6fa2ba7)
This commit is contained in:
Thomas Haller 2019-06-13 11:26:31 +02:00
parent 0ed8baa00f
commit 173e6bbffb

View file

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