]> git.0d.be Git - empathy.git/commitdiff
test favorite change
authorXavier Claessens <xclaesse@src.gnome.org>
Mon, 13 Oct 2008 07:54:56 +0000 (07:54 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Mon, 13 Oct 2008 07:54:56 +0000 (07:54 +0000)
svn path=/trunk/; revision=1563

tests/check-empathy-chatroom.c

index e0cb685cb5ba7ce82de6146538fc57d5c475f3e9..af8687cf31c8e97c3396e609655c3e4370c91d9f 100644 (file)
@@ -114,11 +114,42 @@ START_TEST (test_favorite_and_auto_connect)
 }
 END_TEST
 
+static void
+favorite_changed (EmpathyChatroom *chatroom,
+                  GParamSpec *spec,
+                  gboolean *changed)
+{
+  *changed = TRUE;
+}
+
+START_TEST (test_change_favorite)
+{
+  EmpathyChatroom *chatroom;
+  gboolean changed = FALSE;
+
+  chatroom = create_chatroom ();
+
+  g_signal_connect (chatroom, "notify::favorite", G_CALLBACK (favorite_changed),
+      &changed);
+
+  /* change favorite to TRUE */
+  g_object_set (chatroom, "favorite", TRUE, NULL);
+  fail_if (!changed);
+
+  changed = FALSE;
+
+  /* change favorite to FALSE */
+  g_object_set (chatroom, "favorite", FALSE, NULL);
+  fail_if (!changed);
+}
+END_TEST
+
 TCase *
 make_empathy_chatroom_tcase (void)
 {
     TCase *tc = tcase_create ("empathy-chatroom");
     tcase_add_test (tc, test_empathy_chatroom_new);
     tcase_add_test (tc, test_favorite_and_auto_connect);
+    tcase_add_test (tc, test_change_favorite);
     return tc;
 }