4 #include <glib/gstdio.h>
7 #include "check-helpers.h"
8 #include "check-libempathy.h"
10 #include <libempathy/empathy-chatroom-manager.h>
12 #define CHATROOM_SAMPLE "chatrooms-sample.xml"
13 #define CHATROOM_FILE "chatrooms.xml"
15 START_TEST (test_empathy_chatroom_manager_new)
17 EmpathyChatroomManager *mgr;
23 profile = mc_profile_lookup ("test");
24 account = mc_account_create (profile);
26 copy_xml_file (CHATROOM_SAMPLE, CHATROOM_FILE);
28 file = get_user_xml_file (CHATROOM_FILE);
29 /* change the chatrooms XML file to use the account we just created */
30 cmd = g_strdup_printf ("sed -i 's/CHANGE_ME/%s/' %s",
31 mc_account_get_unique_name (account), file);
35 mgr = empathy_chatroom_manager_new (file);
37 fail_if (empathy_chatroom_manager_get_count (mgr, account) != 2);
41 g_object_unref (profile);
42 remove_account_from_gconf (account);
43 mc_account_delete (account);
44 g_object_unref (account);
49 make_empathy_chatroom_manager_tcase (void)
51 TCase *tc = tcase_create ("empathy-chatroom-manager");
52 tcase_add_test (tc, test_empathy_chatroom_manager_new);