Diff between 30d3b6d4691ec7ceeae75f2574c7cb9b43497897 and 6600b2585b7672b8cbba6d7cf7ba7e1d70baf642

Changed Files

File Additions Deletions Status
unit/test-gdbus-client.c +11 -1 modified

Full Patch

diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c
index 7c849f0..aaf8342 100644
--- a/unit/test-gdbus-client.c
+++ b/unit/test-gdbus-client.c
@@ -53,6 +53,7 @@ static const GDBusPropertyTable properties[] = {
 static struct context *create_context(void)
 {
 	struct context *context = g_new0(struct context, 1);
+	DBusError err;
 
 	context->main_loop = g_main_loop_new(NULL, FALSE);
 	if (context->main_loop == NULL) {
@@ -60,9 +61,18 @@ static struct context *create_context(void)
 		return NULL;
 	}
 
+	dbus_error_init(&err);
+
 	context->dbus_conn = g_dbus_setup_private(DBUS_BUS_SESSION,
-							SERVICE_NAME, NULL);
+							SERVICE_NAME, &err);
 	if (context->dbus_conn == NULL) {
+		if (dbus_error_is_set(&err)) {
+			if (g_test_verbose())
+				g_printerr("D-Bus setup failed: %s\n",
+								err.message);
+			dbus_error_free(&err);
+		}
+
 		g_main_loop_unref(context->main_loop);
 		g_free(context);
 		return NULL;