[tracker] More make distcheck fixes
- From: Martyn James Russell <mr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] More make distcheck fixes
- Date: Thu, 30 Jul 2009 17:36:03 +0000 (UTC)
commit 8ba3de5d3daef2a375879036663cffdc2a967489
Author: Martyn Russell <martyn imendio com>
Date: Thu Jul 30 18:17:37 2009 +0100
More make distcheck fixes
Make sure we use the correct path for the tracker_data_manager_init()
call as well as the other functions in the libtracker-data ontology
and sparql tests.
tests/libtracker-data/tracker-ontology-test.c | 34 ++++++++++++++++---------
tests/libtracker-data/tracker-sparql-test.c | 22 ++++++++++------
2 files changed, 36 insertions(+), 20 deletions(-)
---
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index 0df7293..571398a 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -91,39 +91,49 @@ test_query (gconstpointer test_data)
/* fork as tracker-fts can only be initialized once per process (GType in loadable module) */
if (g_test_trap_fork (0, 0)) {
- int exitcode;
- GError *error;
- gchar *data_filename;
- gchar *query, *query_filename;
- gchar *results, *results_filename;
TrackerDBResultSet *result_set;
+ GError *error;
GString *test_results;
+ gchar *data_filename;
+ gchar *query, *query_filename;
+ gchar *results, *results_filename;
+ gchar *prefix, *data_prefix, *test_prefix;
+ gint exitcode;
exitcode = 0;
error = NULL;
+ prefix = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL);
+ data_prefix = g_build_filename (prefix, test_info->data, NULL);
+ test_prefix = g_build_filename (prefix, test_info->test_name, NULL);
+ g_free (prefix);
+
/* initialization */
tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
- NULL, NULL);
+ NULL,
+ NULL);
/* load data set */
- data_filename = g_strconcat (test_info->data, ".ttl", NULL);
+ data_filename = g_strconcat (data_prefix, ".ttl", NULL);
tracker_data_begin_transaction ();
tracker_turtle_process (data_filename, NULL, consume_triple_storer, NULL);
tracker_data_commit_transaction ();
- query_filename = g_strconcat (test_info->test_name, ".rq", NULL);
+ query_filename = g_strconcat (test_prefix, ".rq", NULL);
g_file_get_contents (query_filename, &query, NULL, &error);
- g_assert (error == NULL);
+ g_assert_no_error (error);
- results_filename = g_strconcat (test_info->test_name, ".out", NULL);
+ results_filename = g_strconcat (test_prefix, ".out", NULL);
g_file_get_contents (results_filename, &results, NULL, &error);
- g_assert (error == NULL);
+ g_assert_no_error (error);
+
+ g_free (data_prefix);
+ g_free (test_prefix);
/* perform actual query */
result_set = tracker_data_query_sparql (query, &error);
- g_assert (error == NULL);
+ g_assert_no_error (error);
/* compare results with reference output */
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 4501b2d..e0376e1 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -81,37 +81,43 @@ test_sparql_query (gconstpointer test_data)
TrackerDBResultSet *result_set;
GError *error;
GString *test_results;
- gchar *data_path, *data_filename;
+ gchar *data_filename;
gchar *query, *query_filename;
gchar *results, *results_filename;
+ gchar *prefix, *data_prefix, *test_prefix;
gint exitcode;
exitcode = 0;
error = NULL;
/* initialization */
+ prefix = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL);
+ data_prefix = g_build_filename (prefix, test_info->data, NULL);
+ test_prefix = g_build_filename (prefix, test_info->test_name, NULL);
+ g_free (prefix);
+
tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
- test_info->data,
+ data_prefix,
NULL);
- data_path = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL);
+ /* data_path = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL); */
/* load data set */
- data_filename = g_strconcat (data_path, G_DIR_SEPARATOR_S, test_info->data, ".ttl", NULL);
-
+ data_filename = g_strconcat (data_prefix, ".ttl", NULL);
tracker_data_begin_transaction ();
tracker_turtle_process (data_filename, NULL, consume_triple_storer, NULL);
tracker_data_commit_transaction ();
- query_filename = g_strconcat (data_path, G_DIR_SEPARATOR_S, test_info->test_name, ".rq", NULL);
+ query_filename = g_strconcat (test_prefix, ".rq", NULL);
g_file_get_contents (query_filename, &query, NULL, &error);
g_assert_no_error (error);
- results_filename = g_strconcat (data_path, G_DIR_SEPARATOR_S, test_info->test_name, ".out", NULL);
+ results_filename = g_strconcat (test_prefix, ".out", NULL);
g_file_get_contents (results_filename, &results, NULL, &error);
g_assert_no_error (error);
- g_free (data_path);
+ g_free (data_prefix);
+ g_free (test_prefix);
/* perform actual query */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]