[tracker] tests: Use tmp dir on tests



commit 277aa041a6b1673d4cdd35fd3be3907739a6ca9f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Oct 20 12:39:04 2017 +0200

    tests: Use tmp dir on tests

 tests/libtracker-data/tracker-ontology-test.c |    4 +++-
 tests/libtracker-data/tracker-sparql-test.c   |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index 53ceaac..9ff9beb 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -315,9 +315,11 @@ main (int argc, char **argv)
        setlocale (LC_COLLATE, "en_US.utf8");
 
        current_dir = g_get_current_dir ();
-       tests_data_dir = g_build_path (G_DIR_SEPARATOR_S, current_dir, "ontology-test-data", NULL);
+       tests_data_dir = g_build_filename (current_dir, "ontology-test-data-XXXXXX", NULL);
        g_free (current_dir);
 
+       g_mkdtemp (tests_data_dir);
+
        g_test_init (&argc, &argv, NULL);
 
        /* add test cases */
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index de4e3bc..d69cf82 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -395,9 +395,11 @@ main (int argc, char **argv)
        setlocale (LC_COLLATE, "en_US.utf8");
 
        current_dir = g_get_current_dir ();
-       tests_data_dir = g_build_path (G_DIR_SEPARATOR_S, current_dir, "sparql-test-data", NULL);
+       tests_data_dir = g_build_filename (current_dir, "sparql-test-data-XXXXXX", NULL);
        g_free (current_dir);
 
+       g_mkdtemp (tests_data_dir);
+
        g_test_init (&argc, &argv, NULL);
 
        /* add test cases */


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