return TRUE;
}
-START_TEST (test_empathy_chatroom_manager_new)
+START_TEST (test_empathy_chatroom_manager_dup_singleton)
{
EmpathyChatroomManager *mgr;
gchar *file;
if (!change_account_name_in_file (account, file))
return;
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
check_chatrooms_list (mgr, account, chatrooms, 2);
g_free (file);
if (!change_account_name_in_file (account, file))
return;
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
/* add a favorite chatroom */
chatroom = empathy_chatroom_new_full (account, "room3", "name3", FALSE);
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
/* chatroom has been added to the XML file as it's a favorite */
check_chatrooms_list (mgr, account, chatrooms, 3);
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
/* chatrooms has not been added to the XML file */
check_chatrooms_list (mgr, account, chatrooms, 3);
if (!change_account_name_in_file (account, file))
return;
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
/* remove room1 */
chatroom = empathy_chatroom_manager_find (mgr, account, "room1");
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
check_chatrooms_list (mgr, account, chatrooms, 1);
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
check_chatrooms_list (mgr, account, chatrooms, 0);
if (!change_account_name_in_file (account, file))
return;
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
/* room2 is not favorite anymore */
chatroom = empathy_chatroom_manager_find (mgr, account, "room2");
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
/* room2 is not present in the XML file anymore as it's not a favorite */
check_chatrooms_list (mgr, account, chatrooms, 1);
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
/* room2 is back in the XML file now */
check_chatrooms_list (mgr, account, chatrooms, 2);
if (!change_account_name_in_file (account, file))
return;
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
check_chatrooms_list (mgr, account, chatrooms, 2);
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
chatrooms[1].name = "new_name";
check_chatrooms_list (mgr, account, chatrooms, 2);
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
chatrooms[1].auto_connect = TRUE;
check_chatrooms_list (mgr, account, chatrooms, 2);
/* reload chatrooms file */
g_object_unref (mgr);
- mgr = empathy_chatroom_manager_new (file);
+ mgr = empathy_chatroom_manager_dup_singleton (file);
chatrooms[1].room = "new_room";
check_chatrooms_list (mgr, account, chatrooms, 2);
make_empathy_chatroom_manager_tcase (void)
{
TCase *tc = tcase_create ("empathy-chatroom-manager");
- tcase_add_test (tc, test_empathy_chatroom_manager_new);
+ tcase_add_test (tc, test_empathy_chatroom_manager_dup_singleton);
tcase_add_test (tc, test_empathy_chatroom_manager_add);
tcase_add_test (tc, test_empathy_chatroom_manager_remove);
tcase_add_test (tc, test_empathy_chatroom_manager_change_favorite);