From bd31f268e2531029ca3f3586b0a1a68b8e82171b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 1 Feb 2018 19:46:28 +0000 Subject: [PATCH] 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 Reviewed-by: Philip Withnall (cherry picked from commit f127c8e110faed76039f96dbc53a87f093fea312) [smcv: Adjust for older codebase] --- test/test-utils-glib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.16.1