summaryrefslogtreecommitdiff
path: root/test/internals
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-10-25 16:58:15 +0100
committerSimon McVittie <smcv@collabora.com>2018-10-31 16:56:36 +0000
commite8cdb9171e989fb0f9d89f42832455800a17079e (patch)
treea95498c67ab43ab8584970e9be972120381a7508 /test/internals
parent47fc3ed2a9da3bbeb8b4004c8482ca56f69dcf55 (diff)
downloaddbus-e8cdb9171e989fb0f9d89f42832455800a17079e.tar.gz
tests: Assert that _dbus_command_for_pid() has correct error behaviour
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'test/internals')
-rw-r--r--test/internals/sysdeps.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/internals/sysdeps.c b/test/internals/sysdeps.c
index f2e75e06..992c4619 100644
--- a/test/internals/sysdeps.c
+++ b/test/internals/sysdeps.c
@@ -60,6 +60,7 @@ test_command_for_pid (Fixture *f,
GError *error = NULL;
GPid process = NO_PROCESS;
unsigned long pid;
+ DBusError d_error = DBUS_ERROR_INIT;
DBusString string;
argv[0] = test_get_helper_executable ("test-sleep-forever" DBUS_EXEEXT);
@@ -81,7 +82,7 @@ test_command_for_pid (Fixture *f,
if (!_dbus_string_init (&string))
g_error ("out of memory");
- if (_dbus_command_for_pid (pid, &string, strlen (argv[0]) + 1024, NULL))
+ if (_dbus_command_for_pid (pid, &string, strlen (argv[0]) + 1024, &d_error))
{
gchar *expected;
@@ -98,7 +99,11 @@ test_command_for_pid (Fixture *f,
}
else
{
- g_test_message ("Unable to get command for process ID");
+ g_test_message ("Unable to get command for process ID: %s: %s",
+ d_error.name, d_error.message);
+ g_assert_nonnull (d_error.name);
+ g_assert_nonnull (d_error.message);
+ dbus_error_free (&d_error);
}
if (!_dbus_string_set_length (&string, 0))