diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-09-28 19:34:25 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-03-30 18:30:27 +0100 |
commit | 3bbe40db970dc0a11c6b58d1bbf27060deafd7de (patch) | |
tree | 35b0d32289f1cb13381792975433c36a139ac6b4 /tests | |
parent | da11ecf68c73bc39c513a1f360729f08731390ec (diff) | |
download | telepathy-glib-3bbe40db970dc0a11c6b58d1bbf27060deafd7de.tar.gz |
test channels: don't use tp_get_bus to register on bus
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/textchan-group.c | 8 | ||||
-rw-r--r-- | tests/lib/textchan-null.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tests/lib/textchan-group.c b/tests/lib/textchan-group.c index 82c3f4631..a018f5fa4 100644 --- a/tests/lib/textchan-group.c +++ b/tests/lib/textchan-group.c @@ -106,9 +106,15 @@ constructor (GType type, (self->conn, TP_HANDLE_TYPE_CONTACT); DBusGConnection *bus; TpChannelGroupFlags flags = 0; + TpDBusDaemon *dbus_daemon; - bus = tp_get_bus (); + /* we're attached to a Connection that has registered on D-Bus, so + * t_d_d_d can't fail */ + dbus_daemon = tp_dbus_daemon_dup (NULL); + g_assert (dbus_daemon != NULL); + bus = tp_proxy_get_dbus_connection (dbus_daemon); dbus_g_connection_register_g_object (bus, self->priv->object_path, object); + g_object_unref (dbus_daemon); tp_text_mixin_init (object, G_STRUCT_OFFSET (TestTextChannelGroup, text), contact_repo); diff --git a/tests/lib/textchan-null.c b/tests/lib/textchan-null.c index 507cd867d..b35ec2f25 100644 --- a/tests/lib/textchan-null.c +++ b/tests/lib/textchan-null.c @@ -95,11 +95,17 @@ constructor (GType type, TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); DBusGConnection *bus; + TpDBusDaemon *dbus_daemon; tp_handle_ref (contact_repo, self->priv->handle); - bus = tp_get_bus (); + /* we're attached to a Connection that has registered on D-Bus, so + * t_d_d_d can't fail */ + dbus_daemon = tp_dbus_daemon_dup (NULL); + g_assert (dbus_daemon != NULL); + bus = tp_proxy_get_dbus_connection (dbus_daemon); dbus_g_connection_register_g_object (bus, self->priv->object_path, object); + g_object_unref (dbus_daemon); tp_text_mixin_init (object, G_STRUCT_OFFSET (TestTextChannelNull, text), contact_repo); |