4 #include <glib/gstdio.h>
6 #include <gconf/gconf.h>
7 #include <gconf/gconf-client.h>
9 #include "check-helpers.h"
10 #include "check-libempathy.h"
11 #include "check-empathy-helpers.h"
13 #include <libempathy/empathy-chatroom-manager.h>
15 #define CHATROOM_SAMPLE "chatrooms-sample.xml"
16 #define CHATROOM_FILE "chatrooms.xml"
18 START_TEST (test_empathy_chatroom_manager_new)
20 EmpathyChatroomManager *mgr;
26 profile = mc_profile_lookup ("test");
27 account = mc_account_create (profile);
29 copy_xml_file (CHATROOM_SAMPLE, CHATROOM_FILE);
31 file = get_user_xml_file (CHATROOM_FILE);
32 /* change the chatrooms XML file to use the account we just created */
33 cmd = g_strdup_printf ("sed -i 's/CHANGE_ME/%s/' %s",
34 mc_account_get_unique_name (account), file);
38 mgr = empathy_chatroom_manager_new (file);
40 fail_if (empathy_chatroom_manager_get_count (mgr, account) != 2);
44 g_object_unref (profile);
45 remove_account_from_gconf (account);
46 mc_account_delete (account);
47 g_object_unref (account);
52 make_empathy_chatroom_manager_tcase (void)
54 TCase *tc = tcase_create ("empathy-chatroom-manager");
55 tcase_add_test (tc, test_empathy_chatroom_manager_new);