tests: Add additional assertions to gsubprocess test

This should quell a scan-build warning about passing `NULL` to
`strlen()`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-11-18 16:34:06 +00:00
parent c1a4aca743
commit 0781e12f45

View File

@ -757,11 +757,15 @@ on_communicate_complete (GObject *proc,
{
if (data->is_utf8)
{
g_assert_nonnull (stdout_str);
stdout_data = (guint8*)stdout_str;
stdout_len = strlen (stdout_str);
}
else
stdout_data = g_bytes_get_data (stdout_bytes, &stdout_len);
{
g_assert_nonnull (stdout_bytes);
stdout_data = g_bytes_get_data (stdout_bytes, &stdout_len);
}
g_assert_cmpmem (stdout_data, stdout_len, "# hello world" LINEEND, 13 + strlen (LINEEND));
}