EmpathyChatroomManager *mgr;
gchar *cmd;
gchar *file;
- McProfile *profile;
McAccount *account;
- profile = mc_profile_lookup ("test");
- account = mc_account_create (profile);
+ account = create_test_account ();
copy_xml_file (CHATROOM_SAMPLE, CHATROOM_FILE);
g_free (file);
g_object_unref (mgr);
- g_object_unref (profile);
remove_account_from_gconf (account);
mc_account_delete (account);
g_object_unref (account);
#include <check.h>
#include "check-helpers.h"
#include "check-libempathy.h"
+#include "check-empathy-helpers.h"
#include <libempathy/empathy-chatroom.h>
static EmpathyChatroom *
create_chatroom (void)
{
- McProfile *profile;
McAccount *account;
EmpathyChatroom *chatroom;
- profile = mc_profile_lookup ("test");
- account = mc_account_create (profile);
+ account = create_test_account ();
chatroom = empathy_chatroom_new (account);
fail_if (chatroom == NULL);
* configuration */
/* FIXME: the account is not really removed */
mc_account_delete (account);
- g_object_unref (profile);
g_object_unref (account);
return chatroom;
g_free (buffer);
}
+McAccount *
+create_test_account (void)
+{
+ McProfile *profile;
+ McAccount *account;
+
+ profile = mc_profile_lookup ("test");
+ account = mc_account_create (profile);
+
+ g_object_unref (profile);
+
+ return account;
+}
+
void
remove_account_from_gconf (McAccount *account)
{
gchar * get_user_xml_file (const gchar *filename);
void copy_xml_file (const gchar *orig, const gchar *dest);
void remove_account_from_gconf (McAccount *account);
+McAccount * create_test_account (void);
#endif /* #ifndef __CHECK_EMPATHY_HELPERS_H__ */