[next] telepathy-glib: Tests: stop using InspectHandles

Xavier Claessens xclaesse at kemper.freedesktop.org
Fri Jun 8 08:11:23 PDT 2012


Module: telepathy-glib
Branch: next
Commit: a3d6c10df83861adae3507c0b651cae061788c20
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=a3d6c10df83861adae3507c0b651cae061788c20

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Fri Jun  8 14:36:16 2012 +0200

Tests: stop using InspectHandles

---

 tests/dbus/channel-manager-request-properties.c |   35 ++---------------------
 1 files changed, 3 insertions(+), 32 deletions(-)

diff --git a/tests/dbus/channel-manager-request-properties.c b/tests/dbus/channel-manager-request-properties.c
index 9c3fa26..1e7826e 100644
--- a/tests/dbus/channel-manager-request-properties.c
+++ b/tests/dbus/channel-manager-request-properties.c
@@ -109,28 +109,6 @@ test_wait (Test *test)
 }
 
 static void
-connection_inspect_handles_cb (TpConnection *conn,
-    const gchar **ids,
-    const GError *error,
-    gpointer user_data,
-    GObject *weak_object)
-{
-  Test *test = user_data;
-  const gchar *id;
-
-  g_assert_no_error (error);
-
-  g_assert_cmpuint (g_strv_length ((gchar **) ids), ==, 1);
-
-  id = ids[0];
-
-  g_assert_cmpstr (id, ==, "lolbags");
-
-  test->waiting--;
-  g_main_loop_quit (test->mainloop);
-}
-
-static void
 channel_manager_request_cb (TpTestsSimpleChannelManager *channel_manager,
     GHashTable *request_properties,
     Test *test)
@@ -139,7 +117,8 @@ channel_manager_request_cb (TpTestsSimpleChannelManager *channel_manager,
       TP_PROP_CHANNEL_TARGET_ID);
   TpHandle handle = tp_asv_get_uint32 (request_properties,
       TP_PROP_CHANNEL_TARGET_HANDLE, NULL);
-  GArray *handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 1);
+  TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
+      (TpBaseConnection *) test->service_conn, TP_HANDLE_TYPE_CONTACT);
 
   tp_asv_dump (request_properties);
 
@@ -147,15 +126,7 @@ channel_manager_request_cb (TpTestsSimpleChannelManager *channel_manager,
   g_assert (target_id != NULL);
 
   g_assert_cmpstr (target_id, ==, "lolbags#dingdong");
-
-  g_array_append_val (handles, handle);
-
-  tp_cli_connection_call_inspect_handles (test->conn, -1,
-      TP_HANDLE_TYPE_CONTACT, handles,
-      connection_inspect_handles_cb, test, NULL, NULL);
-  test->waiting++;
-
-  g_array_unref (handles);
+  g_assert_cmpstr (tp_handle_inspect (contact_repo, handle), ==, "lolbags");
 
   test->waiting--;
   g_main_loop_quit (test->mainloop);



More information about the telepathy-commits mailing list