]> git.0d.be Git - empathy.git/blobdiff - tests/check-empathy-chatroom.c
Updated Basque translation.
[empathy.git] / tests / check-empathy-chatroom.c
index e0cb685cb5ba7ce82de6146538fc57d5c475f3e9..a4adf6ce1be62aa7f93c936bf89bce147df7e49f 100644 (file)
@@ -15,7 +15,7 @@ create_chatroom (void)
   McAccount *account;
   EmpathyChatroom *chatroom;
 
-  account = create_test_account ();
+  account = get_test_account ();
   chatroom = empathy_chatroom_new (account);
   fail_if (chatroom == NULL);
 
@@ -36,7 +36,7 @@ START_TEST (test_empathy_chatroom_new)
   fail_if (auto_connect);
   fail_if (favorite);
 
-  destroy_test_account (empathy_chatroom_get_account (chatroom));
+  g_object_unref (empathy_chatroom_get_account (chatroom));
   g_object_unref (chatroom);
 }
 END_TEST
@@ -109,16 +109,47 @@ START_TEST (test_favorite_and_auto_connect)
   fail_if (auto_connect);
   fail_if (favorite);
 
-  destroy_test_account (empathy_chatroom_get_account (chatroom));
+  g_object_unref (empathy_chatroom_get_account (chatroom));
   g_object_unref (chatroom);
 }
 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;
 }