mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 10:42:11 +01:00
tests: Fix a minor leak in a new GSubprocess test
And also rearrange the asserts so that the error is checked first (since that’s the more informative failure to receive if the test did fail). Spotted by Marco in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4494#note_2352013 and by The Machines in https://gitlab.gnome.org/GNOME/glib/-/jobs/4768121. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
e46d54074b
commit
9d81da62f2
@ -1356,16 +1356,16 @@ static void
|
||||
test_fail_initialization (void)
|
||||
{
|
||||
GError *local_error = NULL;
|
||||
GError **error = &local_error;
|
||||
GSubprocess *proc;
|
||||
|
||||
proc = g_subprocess_new (G_SUBPROCESS_FLAGS_NONE,
|
||||
error,
|
||||
&local_error,
|
||||
"thisprogramshouldnotexistprettyplease",
|
||||
NULL);
|
||||
|
||||
g_assert_null (proc);
|
||||
g_assert_error (local_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT);
|
||||
g_assert_null (proc);
|
||||
g_clear_error (&local_error);
|
||||
}
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
|
Loading…
x
Reference in New Issue
Block a user