diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-03-30 18:29:59 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-03-30 18:29:59 +0100 |
commit | da11ecf68c73bc39c513a1f360729f08731390ec (patch) | |
tree | a850cbc40a879860b31e25bbf84bb2fa7d3a3419 /tests/lib | |
parent | 46e86bf970a82c4a0f069c84b8dfebd04c8ffce4 (diff) | |
download | telepathy-glib-da11ecf68c73bc39c513a1f360729f08731390ec.tar.gz |
test_dbus_daemon_dup_or_die: convenience function for tests
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/util.c | 16 | ||||
-rw-r--r-- | tests/lib/util.h | 2 |
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); |