summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-01-08 12:46:51 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-01-08 12:46:51 +0000
commite36ddc14e96ddce85427062f1f223535e903050e (patch)
treea16b0bfc93946305b6087ced124e186773f34b25 /tests
parentc1b16adcbac200b3115638d6e46bf85bef24d716 (diff)
Change gabble_handle_for_contact, etc. to take the appropriate TpHandleRepoIface*. Remove gabble_handle_unref etc. in favour of the tp_ _ versions.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-handles.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/test-handles.c b/tests/test-handles.c
index a56d9b167..e8287052d 100644
--- a/tests/test-handles.c
+++ b/tests/test-handles.c
@@ -9,6 +9,7 @@
void test_handles (guint handle_type)
{
GabbleHandleRepo *repo = NULL;
+ TpHandleRepoIface *tp_repo = NULL;
GError *error = NULL;
TpHandle handle = 0;
@@ -17,6 +18,8 @@ void test_handles (guint handle_type)
repo = gabble_handle_repo_new ();
g_assert (repo != NULL);
+ tp_repo = gabble_handle_repo_get_tp_repo (repo, handle_type);
+ g_assert (tp_repo != NULL);
/* Handle zero is never valid */
g_assert (gabble_handle_is_valid (repo, handle_type, 0, &error) == FALSE);
@@ -38,23 +41,22 @@ void test_handles (guint handle_type)
switch (handle_type)
{
case TP_HANDLE_TYPE_CONTACT:
- handle = gabble_handle_for_contact (repo, jid, FALSE);
+ handle = gabble_handle_for_contact (tp_repo, jid, FALSE);
break;
case TP_HANDLE_TYPE_LIST:
jid = "deny";
/* fall through */
case TP_HANDLE_TYPE_ROOM:
- handle = tp_handle_request (
- gabble_handle_repo_get_tp_repo(repo, handle_type), jid, TRUE);
+ handle = tp_handle_request (tp_repo, jid, TRUE);
break;
}
g_assert (handle != 0);
/* Ref it */
- g_assert (gabble_handle_ref (repo, handle_type, handle) == TRUE);
+ g_assert (tp_handle_ref (tp_repo, handle) == TRUE);
/* Try to inspect it */
- return_jid = gabble_handle_inspect (repo, handle_type, handle);
+ return_jid = tp_handle_inspect (tp_repo, handle);
g_assert (!strcmp (return_jid, jid));
if (handle_type != TP_HANDLE_TYPE_LIST)
@@ -63,25 +65,25 @@ void test_handles (guint handle_type)
g_assert (gabble_handle_client_hold (repo, "TestSuite", handle, handle_type, NULL) == TRUE);
/* Now unref it */
- g_assert (gabble_handle_unref (repo, handle_type, handle) == TRUE);
+ g_assert (tp_handle_unref (tp_repo, handle) == TRUE);
/* Validate it, should be all healthy because client holds it still */
g_assert (gabble_handle_is_valid (repo, handle_type, handle, NULL) == TRUE);
/* Ref it again */
- g_assert (gabble_handle_ref (repo, handle_type, handle) == TRUE);
+ g_assert (tp_handle_ref (tp_repo, handle) == TRUE);
/* Client releases it */
g_assert (gabble_handle_client_release (repo, "TestSuite", handle, handle_type, NULL) == TRUE);
}
/* Now unref it */
- g_assert (gabble_handle_unref (repo, handle_type, handle) == TRUE);
+ g_assert (tp_handle_unref (tp_repo, handle) == TRUE);
if (handle_type != TP_HANDLE_TYPE_LIST)
{
/* Try to unref it again, should fail */
- g_assert (gabble_handle_unref (repo, handle_type, handle) == FALSE);
+ g_assert (tp_handle_unref (tp_repo, handle) == FALSE);
}
gabble_handle_repo_destroy (repo);