summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/util.c16
-rw-r--r--tests/lib/util.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/util.c b/tests/lib/util.c
index 9702ad91f..0ccf1052f 100644
--- a/tests/lib/util.c
+++ b/tests/lib/util.c
@@ -111,6 +111,22 @@ test_connection_manager_run_until_ready (TpConnectionManager *cm)
g_main_loop_unref (loop);
}
+TpDBusDaemon *
+test_dbus_daemon_dup_or_die (void)
+{
+ TpDBusDaemon *d = tp_dbus_daemon_dup (NULL);
+
+ /* In a shared library, this would be very bad (see fd.o #18832), but in a
+ * regression test that's going to be run under a temporary session bus,
+ * it's just what we want. */
+ if (d == NULL)
+ {
+ g_error ("Unable to connect to session bus");
+ }
+
+ return d;
+}
+
void
test_proxy_run_until_dbus_queue_processed (gpointer proxy)
{
diff --git a/tests/lib/util.h b/tests/lib/util.h
index 7f1a446aa..6146e1e94 100644
--- a/tests/lib/util.h
+++ b/tests/lib/util.h
@@ -13,6 +13,8 @@
#include <telepathy-glib/telepathy-glib.h>
+TpDBusDaemon *test_dbus_daemon_dup_or_die (void);
+
void test_proxy_run_until_dbus_queue_processed (gpointer proxy);
void test_connection_run_until_dbus_queue_processed (TpConnection *connection);