aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check-empathy-chatroom-manager.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-10-13 15:53:59 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-10-13 15:53:59 +0800
commit70730f587cae7c323d2c6d58384b8c628c62c5ad (patch)
treeddad9dddfc4721ddb0f479ff93776e229e348ce2 /tests/check-empathy-chatroom-manager.c
parent5bb3588ca8357d85dd86e5f042152e74f0180661 (diff)
downloadgsoc2013-empathy-70730f587cae7c323d2c6d58384b8c628c62c5ad.tar
gsoc2013-empathy-70730f587cae7c323d2c6d58384b8c628c62c5ad.tar.gz
gsoc2013-empathy-70730f587cae7c323d2c6d58384b8c628c62c5ad.tar.bz2
gsoc2013-empathy-70730f587cae7c323d2c6d58384b8c628c62c5ad.tar.lz
gsoc2013-empathy-70730f587cae7c323d2c6d58384b8c628c62c5ad.tar.xz
gsoc2013-empathy-70730f587cae7c323d2c6d58384b8c628c62c5ad.tar.zst
gsoc2013-empathy-70730f587cae7c323d2c6d58384b8c628c62c5ad.zip
copy chatrooms xml file instead of using the sample one for tests
svn path=/trunk/; revision=1547
Diffstat (limited to 'tests/check-empathy-chatroom-manager.c')
-rw-r--r--tests/check-empathy-chatroom-manager.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/check-empathy-chatroom-manager.c b/tests/check-empathy-chatroom-manager.c
index 82cfa6df0..25014da1f 100644
--- a/tests/check-empathy-chatroom-manager.c
+++ b/tests/check-empathy-chatroom-manager.c
@@ -19,12 +19,41 @@ get_xml_file (const gchar *filename)
filename, NULL);
}
+static gchar *
+get_user_xml_file (const gchar *filename)
+{
+ return g_build_filename (g_get_tmp_dir (), filename, NULL);
+}
+
+static void
+copy_chatroom_file (void)
+{
+ gboolean result;
+ gchar *buffer;
+ gsize length;
+ gchar *sample;
+ gchar *file;
+
+ sample = get_xml_file (CHATROOM_SAMPLE);
+ result = g_file_get_contents (sample, &buffer, &length, NULL);
+ fail_if (!result);
+
+ file = get_user_xml_file (CHATROOM_FILE);
+ result = g_file_set_contents (file, buffer, length, NULL);
+ fail_if (!result);
+
+ g_free (sample);
+ g_free (file);
+ g_free (buffer);
+}
+
START_TEST (test_empathy_chatroom_manager_new)
{
EmpathyChatroomManager *mgr;
gchar *file;
- file = get_xml_file (CHATROOM_SAMPLE);
+ copy_chatroom_file ();
+ file = get_xml_file (CHATROOM_FILE);
mgr = empathy_chatroom_manager_new (file);
g_free (file);