diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-10-28 13:27:03 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-11 16:49:08 +0000 |
commit | 1c491dae9d8f6a90b4d1398dfc8914d8f4ff20a7 (patch) | |
tree | 12d2647df35487b2bfee1279486351cf1882d041 /tests | |
parent | a48cf1a835d94ea6220d67883eca4071e686a4a7 (diff) | |
download | telepathy-glib-1c491dae9d8f6a90b4d1398dfc8914d8f4ff20a7.tar.gz |
TpProtocol: add high-level API for the Addressing interface
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048
Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dbus/protocol-objects.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/dbus/protocol-objects.c b/tests/dbus/protocol-objects.c index fee4afe4b..b1c0fdaca 100644 --- a/tests/dbus/protocol-objects.c +++ b/tests/dbus/protocol-objects.c @@ -565,6 +565,66 @@ test_normalize (Test *test, g_assert_cmpstr (s, ==, NULL); g_clear_object (&result); g_clear_error (&test->error); + + tp_protocol_normalize_contact_uri_async (test->protocol, + "xmpp:MiXeDcAsE", NULL, tp_tests_result_ready_cb, &result); + tp_tests_run_until_result (&result); + s = tp_protocol_normalize_contact_uri_finish (test->protocol, result, + &test->error); + g_assert_no_error (test->error); + g_assert_cmpstr (s, ==, "xmpp:mixedcase"); + g_clear_object (&result); + g_free (s); + + tp_protocol_normalize_contact_uri_async (test->protocol, + "xmpp:", NULL, tp_tests_result_ready_cb, &result); + tp_tests_run_until_result (&result); + s = tp_protocol_normalize_contact_uri_finish (test->protocol, result, + &test->error); + g_assert_cmpstr (s, ==, NULL); + g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); + g_clear_object (&result); + g_clear_error (&test->error); + + tp_protocol_normalize_contact_uri_async (test->protocol, + "http://example.com", NULL, tp_tests_result_ready_cb, &result); + tp_tests_run_until_result (&result); + s = tp_protocol_normalize_contact_uri_finish (test->protocol, result, + &test->error); + g_assert_cmpstr (s, ==, NULL); + g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED); + g_clear_object (&result); + g_clear_error (&test->error); + + tp_protocol_normalize_vcard_address_async (test->protocol, + "x-jabber", "MiXeDcAsE", NULL, tp_tests_result_ready_cb, &result); + tp_tests_run_until_result (&result); + s = tp_protocol_normalize_vcard_address_finish (test->protocol, result, + &test->error); + g_assert_no_error (test->error); + g_assert_cmpstr (s, ==, "mixedcase"); + g_clear_object (&result); + g_free (s); + + tp_protocol_normalize_vcard_address_async (test->protocol, + "x-jabber", "", NULL, tp_tests_result_ready_cb, &result); + tp_tests_run_until_result (&result); + s = tp_protocol_normalize_vcard_address_finish (test->protocol, result, + &test->error); + g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); + g_assert_cmpstr (s, ==, NULL); + g_clear_object (&result); + g_clear_error (&test->error); + + tp_protocol_normalize_vcard_address_async (test->protocol, + "x-skype", "", NULL, tp_tests_result_ready_cb, &result); + tp_tests_run_until_result (&result); + s = tp_protocol_normalize_vcard_address_finish (test->protocol, result, + &test->error); + g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED); + g_assert_cmpstr (s, ==, NULL); + g_clear_object (&result); + g_clear_error (&test->error); } static void |