test_try_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>
This commit is contained in:
Simon McVittie 2018-02-01 19:46:28 +00:00
parent 57a0cf1d14
commit f127c8e110

View file

@ -346,7 +346,7 @@ test_try_connect_to_bus (TestMainContext *ctx,
g_assert (dbus_bus_get_unique_name (conn) != NULL);
if (!test_connection_try_setup (ctx, conn))
if (ctx != NULL && !test_connection_try_setup (ctx, conn))
{
_DBUS_SET_OOM (&error);
goto fail;