summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-02-01 19:46:28 +0000
committerSimon McVittie <smcv@collabora.com>2018-02-06 19:14:27 +0000
commitbd31f268e2531029ca3f3586b0a1a68b8e82171b (patch)
tree9c4e26e1e416be314fdeab6fd509ae6e0c1d2e1e
parent3c73f2e8f379b3d1f4f8c0db9382472b3a8c3fb9 (diff)
downloaddbus-bd31f268e2531029ca3f3586b0a1a68b8e82171b.tar.gz
test_connect_to_bus: Allow skipping the use of a DBusLoop
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]
-rw-r--r--test/test-utils-glib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c
index 9dc58b97..2fc1573d 100644
--- a/test/test-utils-glib.c
+++ b/test/test-utils-glib.c
@@ -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;
}