[next] telepathy-logger: test library: use a client factory instead of creating TpConnections manually
Jonny Lamb
jonny at kemper.freedesktop.org
Wed Aug 8 03:41:19 PDT 2012
Module: telepathy-logger
Branch: next
Commit: f379163914b62a357330330754e1a55e9ea18036
URL: http://cgit.freedesktop.org/telepathy/telepathy-logger/commit/?id=f379163914b62a357330330754e1a55e9ea18036
Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date: Wed Aug 8 11:35:40 2012 +0100
test library: use a client factory instead of creating TpConnections manually
Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
tests/lib/util.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/lib/util.c b/tests/lib/util.c
index 653abef..1928915 100644
--- a/tests/lib/util.c
+++ b/tests/lib/util.c
@@ -222,6 +222,7 @@ tp_tests_create_and_connect_conn (GType conn_type,
gchar *conn_path;
GError *error = NULL;
GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 };
+ TpClientFactory *factory;
g_assert (service_conn != NULL);
g_assert (client_conn != NULL);
@@ -239,8 +240,10 @@ tp_tests_create_and_connect_conn (GType conn_type,
&name, &conn_path, &error));
g_assert_no_error (error);
- *client_conn = tp_connection_new (dbus, name, conn_path,
- &error);
+ factory = tp_automatic_client_factory_new (dbus);
+
+ *client_conn = tp_client_factory_ensure_connection (TP_CLIENT_FACTORY (factory),
+ conn_path, NULL, &error);
g_assert (*client_conn != NULL);
g_assert_no_error (error);
@@ -250,6 +253,7 @@ tp_tests_create_and_connect_conn (GType conn_type,
g_free (name);
g_free (conn_path);
+ g_object_unref (factory);
g_object_unref (dbus);
}
More information about the telepathy-commits
mailing list