summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-08-08 11:35:40 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-08-08 11:35:40 +0100
commitf379163914b62a357330330754e1a55e9ea18036 (patch)
treeb1aa81a97b8ebbd80840868a76320142c8754194
parentada0da141c5aa3518944848d534120d2eeea2d92 (diff)
downloadtelepathy-logger-f379163914b62a357330330754e1a55e9ea18036.tar.gz
test library: use a client factory instead of creating TpConnections manually
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--tests/lib/util.c8
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);
}