[tracker] tests: Avoid journal validity test for most unit tests



commit a0f208d72ff1a84426b356bcdb80dea33724259e
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Mar 15 14:57:33 2010 +0100

    tests: Avoid journal validity test for most unit tests

 src/libtracker-data/tracker-data-backup.c         |    2 +-
 src/libtracker-data/tracker-data-manager.c        |    5 +++--
 src/libtracker-data/tracker-data-manager.h        |    3 ++-
 src/tracker-store/tracker-main.c                  |    3 ++-
 tests/libtracker-data/tracker-ontology-test.c     |    3 ++-
 tests/libtracker-data/tracker-sparql-blank-test.c |    3 ++-
 tests/libtracker-data/tracker-sparql-test.c       |    2 +-
 tests/libtracker-fts/tracker-fts-test.c           |    2 +-
 8 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-backup.c b/src/libtracker-data/tracker-data-backup.c
index 869fb54..eecfe49 100644
--- a/src/libtracker-data/tracker-data-backup.c
+++ b/src/libtracker-data/tracker-data-backup.c
@@ -163,7 +163,7 @@ tracker_data_backup_restore (GFile *journal,
 
 		tracker_db_journal_shutdown ();
 
-		tracker_data_manager_init (flags, NULL, &is_first);
+		tracker_data_manager_init (flags, NULL, &is_first, TRUE);
 
 	} else {
 		g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0, 
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 3923dc2..ee01dfc 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1557,7 +1557,8 @@ get_new_service_id (TrackerDBInterface *iface)
 gboolean
 tracker_data_manager_init (TrackerDBManagerFlags  flags,
                            const gchar           *test_schema,
-                           gboolean              *first_time)
+                           gboolean              *first_time,
+                           gboolean               journal_check)
 {
 	TrackerDBInterface *iface;
 	gboolean is_first_time_index, read_journal, check_ontology;
@@ -1594,7 +1595,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 
 	iface = tracker_db_manager_get_db_interface ();
 
-	if (is_first_time_index && !test_schema) {
+	if (journal_check && is_first_time_index && !test_schema) {
 		if (tracker_db_journal_reader_init (NULL)) {
 			if (tracker_db_journal_reader_next (NULL)) {
 				/* journal with at least one valid transaction
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index ff960a4..5be4eb2 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -39,7 +39,8 @@ G_BEGIN_DECLS
 
 gboolean tracker_data_manager_init                (TrackerDBManagerFlags  flags,
                                                    const gchar           *test_schema,
-                                                   gboolean              *first_time);
+                                                   gboolean              *first_time,
+                                                   gboolean               journal_check);
 void     tracker_data_manager_shutdown            (void);
 gint64   tracker_data_manager_get_db_option_int64 (const gchar           *option);
 void     tracker_data_manager_set_db_option_int64 (const gchar           *option,
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index e8dbc2e..e21d8d4 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -452,7 +452,8 @@ main (gint argc, gchar *argv[])
 
 	if (!tracker_data_manager_init (flags,
 	                                NULL,
-	                                &is_first_time_index)) {
+	                                &is_first_time_index,
+	                                TRUE)) {
 		return EXIT_FAILURE;
 	}
 
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index 31233c8..f3a5080 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -95,7 +95,8 @@ test_query (gconstpointer test_data)
 	/* initialization */
 	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
 	                           NULL,
-	                           NULL);
+	                           NULL, 
+	                           FALSE);
 
 	/* load data set */
 	data_filename = g_strconcat (data_prefix, ".ttl", NULL);
diff --git a/tests/libtracker-data/tracker-sparql-blank-test.c b/tests/libtracker-data/tracker-sparql-blank-test.c
index bc6a364..02b3c06 100644
--- a/tests/libtracker-data/tracker-sparql-blank-test.c
+++ b/tests/libtracker-data/tracker-sparql-blank-test.c
@@ -43,7 +43,8 @@ test_blank (void)
 	/* initialization */
 	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
 	                           NULL,
-	                           NULL);
+	                           NULL,
+	                           FALSE);
 
 	/* perform update in transaction */
 
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 4b71750..68c798a 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -126,7 +126,7 @@ test_sparql_query (gconstpointer test_data)
 
 	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
 	                           data_prefix,
-	                           NULL);
+	                           NULL, FALSE);
 
 	/* data_path = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL); */
 
diff --git a/tests/libtracker-fts/tracker-fts-test.c b/tests/libtracker-fts/tracker-fts-test.c
index aa034df..b065c61 100644
--- a/tests/libtracker-fts/tracker-fts-test.c
+++ b/tests/libtracker-fts/tracker-fts-test.c
@@ -72,7 +72,7 @@ test_sparql_query (gconstpointer test_data)
 
 	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
 	                           data_prefix,
-	                           NULL);
+	                           NULL, FALSE);
 
 	/* load data / perform updates */
 



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