[tracker] tests: Drop code to "delete the database" in ontology-change tests



commit 6e33974e17c70f7b23d221de5764abccb5dabe58
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Dec 15 14:21:26 2018 +0100

    tests: Drop code to "delete the database" in ontology-change tests
    
    This presumably was made to actually test ontology changes through
    rebuilding from the journal. The catch is that it was made to look into the
    wrong directory, so in essence we are testing live ontology updates.
    
    Such test might be added to tracker-db-journal-test, and only if journal is
    enabled. It is not a situation that will be triggered nowadays, and it is
    preferable to keep the current actual behavior of the test, so just delete
    this code to make it clearer.

 .../libtracker-data/tracker-ontology-change-test.c | 27 ----------------------
 1 file changed, 27 deletions(-)
---
diff --git a/tests/libtracker-data/tracker-ontology-change-test.c 
b/tests/libtracker-data/tracker-ontology-change-test.c
index 325c63be8..8251f14e3 100644
--- a/tests/libtracker-data/tracker-ontology-change-test.c
+++ b/tests/libtracker-data/tracker-ontology-change-test.c
@@ -66,29 +66,6 @@ const ChangeInfo changes[] = {
        { NULL }
 };
 
-static void
-delete_db (gboolean del_journal)
-{
-       gchar *meta_db, *db_location;
-
-       db_location = g_build_path (G_DIR_SEPARATOR_S, g_get_current_dir (), "tracker", NULL);
-       meta_db = g_build_path (G_DIR_SEPARATOR_S, db_location, "meta.db", NULL);
-       g_unlink (meta_db);
-       g_free (meta_db);
-
-       if (del_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);
-       g_free (meta_db);
-
-       g_free (db_location);
-}
-
 static void
 query_helper (TrackerDataManager *manager, const gchar *query_filename, const gchar *results_filename)
 {
@@ -189,8 +166,6 @@ test_ontology_change (void)
        GFile *data_location, *test_schemas;
        TrackerDataManager *manager;
 
-       delete_db (TRUE);
-
        prefix = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL);
        build_prefix = g_build_path (G_DIR_SEPARATOR_S, TOP_BUILDDIR, "tests", "libtracker-data", NULL);
        ontologies = g_build_filename (prefix, "ontologies", NULL);
@@ -273,8 +248,6 @@ test_ontology_change (void)
                g_object_unref (manager);
        }
 
-       delete_db (FALSE);
-
        manager = tracker_data_manager_new (0, data_location, data_location, test_schemas,
                                            TRUE, FALSE, 100, 100);
        g_initable_init (G_INITABLE (manager), NULL, &error);


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