From 252e1801e2f781a0ec8f3732a878fa87cef8402f Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 3 Nov 2011 11:48:17 +0100 Subject: [PATCH] test that contact list properties are set https://bugs.freedesktop.org/show_bug.cgi?id=42546 --- tests/dbus/contact-list-client.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/tests/dbus/contact-list-client.c b/tests/dbus/contact-list-client.c index 35abf6b..6f2d5ff 100644 --- a/tests/dbus/contact-list-client.c +++ b/tests/dbus/contact-list-client.c @@ -503,6 +503,34 @@ test_is_blocked (Test *test, g_assert (!tp_contact_is_blocked (test->contact)); } +static void +test_contact_list_properties (Test *test, + gconstpointer data G_GNUC_UNUSED) +{ + GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONTACT_LIST, 0 }; + + /* Feature isn't prepared yet */ + g_assert (!tp_proxy_is_prepared (test->connection, + TP_CONNECTION_FEATURE_CONTACT_LIST)); + + g_assert_cmpuint (tp_connection_get_contact_list_state (test->connection), ==, + TP_CONTACT_LIST_STATE_NONE); + g_assert (!tp_connection_get_contact_list_persists (test->connection)); + g_assert (!tp_connection_get_can_change_contact_list (test->connection)); + g_assert (!tp_connection_get_request_uses_message (test->connection)); + + tp_proxy_prepare_async (test->connection, conn_features, + proxy_prepare_cb, test); + + test->wait = 1; + g_main_loop_run (test->mainloop); + g_assert_no_error (test->error); + + g_assert (tp_connection_get_contact_list_persists (test->connection)); + g_assert (tp_connection_get_can_change_contact_list (test->connection)); + g_assert (tp_connection_get_request_uses_message (test->connection)); +} + int main (int argc, char **argv) @@ -521,5 +549,8 @@ main (int argc, g_test_add ("/contact-list-client/blocking/is-blocked", Test, NULL, setup, test_is_blocked, teardown); + g_test_add ("/contact-list-client/contact-list/properties", Test, NULL, + setup, test_contact_list_properties, teardown); + return g_test_run (); } -- 1.7.4.1