telepathy-glib: text-respawn test: add a disappearing base channel test

Jonny Lamb jonny at kemper.freedesktop.org
Mon Aug 27 09:56:31 PDT 2012


Module: telepathy-glib
Branch: master
Commit: 926ddbefa79a5b660bbb170a056588a20e7b991a
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=926ddbefa79a5b660bbb170a056588a20e7b991a

Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date:   Tue Jun  5 16:27:13 2012 +0100

text-respawn test: add a disappearing base channel test

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>

---

 tests/dbus/text-respawn.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/tests/dbus/text-respawn.c b/tests/dbus/text-respawn.c
index 1cc8113..46b99aa 100644
--- a/tests/dbus/text-respawn.c
+++ b/tests/dbus/text-respawn.c
@@ -232,6 +232,29 @@ main (int argc,
       g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages);
     }
 
+  g_print ("\n\n==== Disappearing channel ====\n");
+
+    {
+      TpBaseChannel *base = TP_BASE_CHANNEL (service_chan);
+      TpHandle self_handle = tp_base_connection_get_self_handle (
+          service_conn_as_base);
+
+      /* first make the channel disappear and make sure it's off the
+       * bus */
+      tp_base_channel_disappear (base);
+
+      g_assert (!tp_base_channel_is_registered (base));
+
+      /* now reopen it and make sure it's got new requested/initiator
+       * values, as well as being back on the bus. */
+      tp_base_channel_reopened_with_requested (base, TRUE, self_handle);
+
+      g_assert_cmpuint (tp_base_channel_get_initiator (base), ==, self_handle);
+      g_assert (tp_base_channel_is_requested (base));
+
+      g_assert (tp_base_channel_is_registered (base));
+    }
+
   g_print ("\n\n==== Destroying channel ====\n");
 
     {



More information about the telepathy-commits mailing list