[telepathy-glib/master] self-presence test: assert that GetInterfaces succeeds before we're CONNECTED
Simon McVittie
simon.mcvittie at collabora.co.uk
Thu Sep 3 09:22:28 PDT 2009
---
tests/dbus/self-presence.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/tests/dbus/self-presence.c b/tests/dbus/self-presence.c
index 8212dec..ac20b69 100644
--- a/tests/dbus/self-presence.c
+++ b/tests/dbus/self-presence.c
@@ -211,6 +211,8 @@ main (int argc,
gchar *conn_path;
GError *error = NULL;
TpConnection *client_conn;
+ guint status;
+ gchar **interfaces;
/* Setup */
@@ -234,6 +236,27 @@ main (int argc,
client_conn = tp_connection_new (dbus, name, conn_path, &error);
MYASSERT (client_conn != NULL, "");
test_assert_no_error (error);
+
+ /* Assert that GetInterfaces succeeds before we're CONNECTED */
+ MYASSERT (tp_cli_connection_run_get_interfaces (client_conn, -1, &interfaces,
+ &error, NULL), "");
+ test_assert_no_error (error);
+ MYASSERT (tp_strv_contains ((const gchar * const *) interfaces,
+ TP_IFACE_CONNECTION_INTERFACE_ALIASING), "");
+ MYASSERT (tp_strv_contains ((const gchar * const *) interfaces,
+ TP_IFACE_CONNECTION_INTERFACE_AVATARS), "");
+ MYASSERT (tp_strv_contains ((const gchar * const *) interfaces,
+ TP_IFACE_CONNECTION_INTERFACE_CONTACTS), "");
+ MYASSERT (tp_strv_contains ((const gchar * const *) interfaces,
+ TP_IFACE_CONNECTION_INTERFACE_PRESENCE), "");
+ MYASSERT (tp_strv_contains ((const gchar * const *) interfaces,
+ TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE), "");
+
+ MYASSERT (tp_cli_connection_run_get_status (client_conn, -1, &status,
+ &error, NULL), "");
+ g_assert_cmpuint (status, ==, (guint) TP_CONNECTION_STATUS_DISCONNECTED);
+ test_assert_no_error (error);
+
MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL),
"");
test_assert_no_error (error);
--
1.5.6.5
More information about the telepathy-commits
mailing list