[tracker] tests/libtracker-data: Added failing unit test (but disabled for now)



commit f76a1d97a28a928c4bc2936974ba5df457460bf5
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Mar 30 13:41:56 2010 +0200

    tests/libtracker-data: Added failing unit test (but disabled for now)

 tests/libtracker-data/tracker-backup-test.c |   32 +++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 4 deletions(-)
---
diff --git a/tests/libtracker-data/tracker-backup-test.c b/tests/libtracker-data/tracker-backup-test.c
index 77ce8cd..af06565 100644
--- a/tests/libtracker-data/tracker-backup-test.c
+++ b/tests/libtracker-data/tracker-backup-test.c
@@ -85,7 +85,7 @@ check_content_in_db (gint expected_instances, gint expected_relations)
  * Run again the queries
  */
 static void
-test_backup_and_restore (void)
+test_backup_and_restore_helper (gboolean journal)
 {
 	gchar  *data_prefix, *data_filename, *backup_filename, *db_location, *meta_db;
 	GError *error = NULL;
@@ -146,9 +146,11 @@ test_backup_and_restore (void)
 	g_unlink (meta_db);
 	g_free (meta_db);
 
-	meta_db = g_build_path (G_DIR_SEPARATOR_S, db_location, "data", "tracker-store.journal", NULL);
-	g_unlink (meta_db);
-	g_free (meta_db);
+	if (!journal) {
+		meta_db = g_build_path (G_DIR_SEPARATOR_S, db_location, "data", "tracker-store.journal", NULL);
+		g_unlink (meta_db);
+		g_free (meta_db);
+	}
 
 	meta_db = g_build_path (G_DIR_SEPARATOR_S, db_location, "data", ".meta.isrunning", NULL);
 	g_unlink (meta_db);
@@ -169,6 +171,21 @@ test_backup_and_restore (void)
 	g_assert_cmpint (backup_calls, ==, 2);
 }
 
+static void
+test_backup_and_restore (void)
+{
+	test_backup_and_restore_helper (FALSE);
+}
+
+#ifdef FAILING_UNIT_TEST
+static void
+test_journal_then_backup_and_restore (void)
+{
+	test_backup_and_restore_helper (TRUE);
+}
+#endif
+
+
 int
 main (int argc, char **argv)
 {
@@ -194,6 +211,13 @@ main (int argc, char **argv)
 
 	g_test_add_func ("/tracker/libtracker-data/backup/save_and_restore",
 	                 test_backup_and_restore);
+
+#ifdef FAILING_UNIT_TEST
+	/* This test fails atm, disabled it while I'm fixing this in master */
+	g_test_add_func ("/tracker/libtracker-data/backup/journal_then_save_and_restore",
+	                 test_journal_then_backup_and_restore);
+#endif
+
 	/* run tests */
 	result = g_test_run ();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]