aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-09-08 06:01:13 +0800
committerXan Lopez <xan@igalia.com>2012-09-08 06:01:13 +0800
commite64f49f4080cff57af67eefd147e94d4223f2be1 (patch)
tree0e6561fb41198988604062836aceda78de5a1918 /tests
parent983ce8ba32b59167d9436200696e1fd12a2d780c (diff)
downloadgsoc2013-epiphany-e64f49f4080cff57af67eefd147e94d4223f2be1.tar
gsoc2013-epiphany-e64f49f4080cff57af67eefd147e94d4223f2be1.tar.gz
gsoc2013-epiphany-e64f49f4080cff57af67eefd147e94d4223f2be1.tar.bz2
gsoc2013-epiphany-e64f49f4080cff57af67eefd147e94d4223f2be1.tar.lz
gsoc2013-epiphany-e64f49f4080cff57af67eefd147e94d4223f2be1.tar.xz
gsoc2013-epiphany-e64f49f4080cff57af67eefd147e94d4223f2be1.tar.zst
gsoc2013-epiphany-e64f49f4080cff57af67eefd147e94d4223f2be1.zip
tests: clear bookmark files after each test
Diffstat (limited to 'tests')
-rw-r--r--tests/ephy-bookmarks-test.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ephy-bookmarks-test.c b/tests/ephy-bookmarks-test.c
index 464a9de46..1fe273f63 100644
--- a/tests/ephy-bookmarks-test.c
+++ b/tests/ephy-bookmarks-test.c
@@ -24,6 +24,27 @@
#include "ephy-debug.h"
#include "ephy-file-helpers.h"
+const char* bookmarks_paths[] = { "ephy-bookmarks.xml", "bookmarks.rdf", NULL };
+
+static void
+clear_bookmark_files ()
+{
+ GFile *file;
+ char *path;
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS (bookmarks_paths); i++) {
+
+ path = g_build_filename (ephy_dot_dir (),
+ bookmarks_paths[i],
+ NULL);
+ file = g_file_new_for_path (path);
+ g_file_delete (file, NULL, NULL);
+ g_object_unref (file);
+ g_free (path);
+ }
+}
+
static void
test_ephy_bookmarks_create ()
{
@@ -32,6 +53,8 @@ test_ephy_bookmarks_create ()
bookmarks = ephy_bookmarks_new ();
g_assert (bookmarks);
g_object_unref (bookmarks);
+
+ clear_bookmark_files ();
}
static void
@@ -49,6 +72,8 @@ test_ephy_bookmarks_add ()
g_assert (node == result);
g_object_unref (bookmarks);
+
+ clear_bookmark_files ();
}
int