test_connect_to_bus: Allow skipping the use of a DBusLoop
authorSimon McVittie <smcv@collabora.com>
Thu, 1 Feb 2018 19:46:28 +0000 (19:46 +0000)
committerSimon McVittie <smcv@collabora.com>
Tue, 6 Feb 2018 19:14:27 +0000 (19:14 +0000)
DBusLoop isn't thread-safe, so we can't use it to test multi-threaded
situations.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
(cherry picked from commit f127c8e110faed76039f96dbc53a87f093fea312)
[smcv: Adjust for older codebase]

test/test-utils-glib.c

index 9dc58b9..2fc1573 100644 (file)
@@ -332,7 +332,9 @@ test_connect_to_bus (TestMainContext *ctx,
   g_assert (ok);
   g_assert (dbus_bus_get_unique_name (conn) != NULL);
 
-  test_connection_setup (ctx, conn);
+  if (ctx != NULL)
+    test_connection_setup (ctx, conn);
+
   return conn;
 }