[tracker] libtracker-data: Test ontology initialization



commit 76dd6212989ef08f8b66aa375e697e0678176a82
Author: Jürg Billeter <j bitron ch>
Date:   Thu Mar 18 10:18:25 2010 +0100

    libtracker-data: Test ontology initialization
    
    Test both, first-time initialization and initialization from existing
    database.

 tests/libtracker-data/tracker-ontology-test.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index f2b8a5a..1d0d22e 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -73,6 +73,26 @@ const TestInfo nmo_tests[] = {
 };
 
 static void
+test_ontology_init (void)
+{
+	/* first-time initialization */
+	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
+	                           NULL,
+	                           NULL,
+	                           FALSE);
+
+	tracker_data_manager_shutdown ();
+
+	/* initialization from existing database */
+	tracker_data_manager_init (0,
+	                           NULL,
+	                           NULL,
+	                           FALSE);
+
+	tracker_data_manager_shutdown ();
+}
+
+static void
 test_query (gconstpointer test_data)
 {
 	TrackerDBResultSet *result_set;
@@ -226,6 +246,8 @@ main (int argc, char **argv)
 
 	/* add test cases */
 
+	g_test_add_func ("/libtracker-data/ontology-init", test_ontology_init);
+
 	for (i = 0; nie_tests[i].test_name; i++) {
 		gchar *testpath;
 



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