[tracker/urho-sync: 17/17] Merge branch 'master' into urho-sync
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/urho-sync: 17/17] Merge branch 'master' into urho-sync
- Date: Tue, 25 Aug 2009 12:59:16 +0000 (UTC)
commit 65ef93d8e11f03b2d825f40b41a3bccb821abf07
Merge: 08017cb... 54e6080...
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Aug 25 14:58:34 2009 +0200
Merge branch 'master' into urho-sync
Conflicts:
tests/libtracker-data/tracker-ontology-test.c
tests/libtracker-data/tracker-sparql-test.c
configure.ac | 2 -
data/ontologies/32-nco.ontology | 1 +
docs/manpages/tracker-store.1 | 7 -
po/de.po | 336 ++---
po/gl.po | 1644 +++++++++++++----------
po/sv.po | 705 +++++++---
src/Makefile.am | 4 +-
src/libstemmer/Makefile.am | 5 +-
src/libtracker-data/tracker-data-manager.c | 3 +
src/libtracker-data/tracker-data-update.c | 96 +-
src/libtracker-data/tracker-sparql-query.vala | 4 +
src/libtracker-db/Makefile.am | 7 +-
src/libtracker-db/tracker-db-interface-sqlite.c | 23 +-
src/tracker-fts/Makefile.am | 12 +-
src/tracker-fts/tracker-fts.c | 37 +-
src/tracker-fts/tracker-fts.h | 23 +-
tests/estress/abstract_engine.py | 4 +-
tests/estress/abstract_text_engine.py | 6 +-
tests/estress/client.py | 6 +-
tests/libtracker-data/Makefile.am | 3 +-
tests/libtracker-data/tracker-ontology-test.c | 216 ++--
tests/libtracker-data/tracker-sparql-test.c | 238 ++--
utils/tracker-fts/Makefile.am | 1 +
utils/tracker-fts/tracker-fts-test.c | 12 +-
24 files changed, 1862 insertions(+), 1533 deletions(-)
---
diff --cc src/libtracker-db/Makefile.am
index b86ee77,951359b..cbbfd00
--- a/src/libtracker-db/Makefile.am
+++ b/src/libtracker-db/Makefile.am
@@@ -27,15 -24,11 +26,13 @@@ noinst_HEADERS =
tracker-db-dbus.h \
tracker-db-interface.h \
tracker-db-interface-sqlite.h \
- tracker-db-manager.h
+ tracker-db-manager.h \
+ tracker-db-backup.h \
+ tracker-db-journal.h
- libtracker_db_la_LDFLAGS = \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-
libtracker_db_la_LIBADD = \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
+ $(top_builddir)/src/tracker-fts/libtracker-fts.la \
$(SQLITE3_LIBS) \
$(DBUS_LIBS) \
$(GCOV_LIBS) \
diff --cc src/libtracker-db/tracker-db-interface-sqlite.c
index 5c8f2d3,ac869a3..921f3c0
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@@ -21,11 -21,11 +21,13 @@@
#include "config.h"
#include <glib/gstdio.h>
+
#include <sqlite3.h>
#include <stdlib.h>
+#include <libtracker-common/tracker-common.h>
+ #include <tracker-fts/tracker-fts.h>
+
#include "tracker-db-interface-sqlite.h"
#define TRACKER_DB_INTERFACE_SQLITE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_DB_INTERFACE_SQLITE, TrackerDBInterfaceSqlitePrivate))
@@@ -124,42 -130,11 +126,27 @@@ open_database (TrackerDBInterfaceSqlite
sqlite3_extended_result_codes (priv->db, 0);
sqlite3_busy_timeout (priv->db, 100000);
- sqlite3_enable_load_extension (priv->db, 1);
-
- env_path = g_getenv ("TRACKER_DB_MODULES_DIR");
-
- if (G_LIKELY (!env_path)) {
- sqlite3_load_extension (priv->db, PKGLIBDIR "/tracker-fts.so", NULL, &err_msg);
- } else {
- gchar *filename;
-
- filename = g_build_filename (env_path, "tracker-fts.so", NULL);
- sqlite3_load_extension (priv->db, filename, NULL, &err_msg);
- g_free (filename);
- }
-
- if (err_msg) {
- g_critical ("Could not load tracker-fts extension:'%s'", err_msg);
- sqlite3_free (err_msg);
+ if (tracker_fts_init (priv->db) != SQLITE_OK) {
+ g_critical ("Could not initialize tracker-fts extension");
} else {
- g_message ("Loaded tracker fts extension");
+ g_message ("Initialized tracker fts extension");
}
+}
+
+static GObject *
+tracker_db_interface_sqlite_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_params)
+{
+ GObject *object;
+ TrackerDBInterfaceSqlitePrivate *priv;
+
+ object = (* G_OBJECT_CLASS (tracker_db_interface_sqlite_parent_class)->constructor) (type,
+ n_construct_properties,
+ construct_params);
+ priv = TRACKER_DB_INTERFACE_SQLITE_GET_PRIVATE (object);
+
+ open_database (priv);
return object;
}
diff --cc tests/libtracker-data/tracker-ontology-test.c
index 9fccfe3,def14d9..a75f352
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@@ -74,141 -74,128 +74,128 @@@ const TestInfo nmo_tests[] =
static void
test_query (gconstpointer test_data)
{
+ TrackerDBResultSet *result_set;
const TestInfo *test_info;
-
+ GError *error;
+ GString *test_results;
+ gchar *data_filename;
+ gchar *query, *query_filename;
+ gchar *results, *results_filename;
+ gchar *prefix, *data_prefix, *test_prefix;
+
+ error = NULL;
test_info = test_data;
- /* fork as tracker-fts can only be initialized once per process (GType in loadable module) */
- if (g_test_trap_fork (0, 0)) {
- 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);
-
- /* load data set */
- data_filename = g_strconcat (data_prefix, ".ttl", NULL);
- tracker_turtle_reader_load (data_filename, &error);
- g_assert (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);
- query_filename = g_strconcat (test_prefix, ".rq", NULL);
- g_file_get_contents (query_filename, &query, NULL, &error);
- g_assert (error == NULL);
+ /* initialization */
+ tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
+ NULL,
- NULL);
++ NULL, NULL);
- results_filename = g_strconcat (test_prefix, ".out", NULL);
- g_file_get_contents (results_filename, &results, NULL, &error);
- g_assert (error == NULL);
+ /* load data set */
+ data_filename = g_strconcat (data_prefix, ".ttl", NULL);
+ tracker_turtle_reader_load (data_filename, &error);
+ g_assert (error == NULL);
- g_free (data_prefix);
- g_free (test_prefix);
+ query_filename = g_strconcat (test_prefix, ".rq", NULL);
+ g_file_get_contents (query_filename, &query, NULL, &error);
+ g_assert (error == NULL);
- /* perform actual query */
+ results_filename = g_strconcat (test_prefix, ".out", NULL);
+ g_file_get_contents (results_filename, &results, NULL, &error);
+ g_assert (error == NULL);
- result_set = tracker_data_query_sparql (query, &error);
- g_assert (error == NULL);
+ g_free (data_prefix);
+ g_free (test_prefix);
- /* compare results with reference output */
-
- test_results = g_string_new ("");
-
- if (result_set) {
- gboolean valid = TRUE;
- guint col_count;
- gint col;
-
- col_count = tracker_db_result_set_get_n_columns (result_set);
-
- while (valid) {
- for (col = 0; col < col_count; col++) {
- GValue value = { 0 };
-
- _tracker_db_result_set_get_value (result_set, col, &value);
-
- switch (G_VALUE_TYPE (&value)) {
- case G_TYPE_INT:
- g_string_append_printf (test_results, "\"%d\"", g_value_get_int (&value));
- break;
- case G_TYPE_DOUBLE:
- g_string_append_printf (test_results, "\"%f\"", g_value_get_double (&value));
- break;
- case G_TYPE_STRING:
- g_string_append_printf (test_results, "\"%s\"", g_value_get_string (&value));
- break;
- default:
- /* unbound variable */
- break;
- }
-
- if (col < col_count - 1) {
- g_string_append (test_results, "\t");
- }
- }
+ /* perform actual query */
+
+ result_set = tracker_data_query_sparql (query, &error);
+ g_assert (error == NULL);
+
+ /* compare results with reference output */
+
+ test_results = g_string_new ("");
+
+ if (result_set) {
+ gboolean valid = TRUE;
+ guint col_count;
+ gint col;
- g_string_append (test_results, "\n");
+ col_count = tracker_db_result_set_get_n_columns (result_set);
- valid = tracker_db_result_set_iter_next (result_set);
+ while (valid) {
+ for (col = 0; col < col_count; col++) {
+ GValue value = { 0 };
+
+ _tracker_db_result_set_get_value (result_set, col, &value);
+
+ switch (G_VALUE_TYPE (&value)) {
+ case G_TYPE_INT:
+ g_string_append_printf (test_results, "\"%d\"", g_value_get_int (&value));
+ break;
+ case G_TYPE_DOUBLE:
+ g_string_append_printf (test_results, "\"%f\"", g_value_get_double (&value));
+ break;
+ case G_TYPE_STRING:
+ g_string_append_printf (test_results, "\"%s\"", g_value_get_string (&value));
+ break;
+ default:
+ /* unbound variable */
+ break;
+ }
+
+ if (col < col_count - 1) {
+ g_string_append (test_results, "\t");
+ }
}
- g_object_unref (result_set);
- }
+ g_string_append (test_results, "\n");
- if (strcmp (results, test_results->str)) {
- /* print result difference */
- gchar *quoted_results;
- gchar *command_line;
- gchar *quoted_command_line;
- gchar *shell;
- gchar *diff;
-
- quoted_results = g_shell_quote (test_results->str);
- command_line = g_strdup_printf ("echo -n %s | diff -u %s -", quoted_results, results_filename);
- quoted_command_line = g_shell_quote (command_line);
- shell = g_strdup_printf ("sh -c %s", quoted_command_line);
- g_spawn_command_line_sync (shell, &diff, NULL, NULL, &error);
- g_assert (error == NULL);
-
- g_error ("%s", diff);
-
- g_free (quoted_results);
- g_free (command_line);
- g_free (quoted_command_line);
- g_free (shell);
- g_free (diff);
-
- exitcode = 1;
+ valid = tracker_db_result_set_iter_next (result_set);
}
- /* cleanup */
+ g_object_unref (result_set);
+ }
- g_free (data_filename);
- g_free (query_filename);
- g_free (query);
- g_free (results_filename);
- g_free (results);
- g_string_free (test_results, TRUE);
+ if (strcmp (results, test_results->str)) {
+ /* print result difference */
+ gchar *quoted_results;
+ gchar *command_line;
+ gchar *quoted_command_line;
+ gchar *shell;
+ gchar *diff;
+
+ quoted_results = g_shell_quote (test_results->str);
+ command_line = g_strdup_printf ("echo -n %s | diff -u %s -", quoted_results, results_filename);
+ quoted_command_line = g_shell_quote (command_line);
+ shell = g_strdup_printf ("sh -c %s", quoted_command_line);
+ g_spawn_command_line_sync (shell, &diff, NULL, NULL, &error);
+ g_assert (error == NULL);
- tracker_data_manager_shutdown ();
+ g_error ("%s", diff);
- exit (exitcode);
+ g_free (quoted_results);
+ g_free (command_line);
+ g_free (quoted_command_line);
+ g_free (shell);
+ g_free (diff);
}
- g_test_trap_assert_passed ();
+ /* cleanup */
+
+ g_free (data_filename);
+ g_free (query_filename);
+ g_free (query);
+ g_free (results_filename);
+ g_free (results);
+ g_string_free (test_results, TRUE);
+
+ tracker_data_manager_shutdown ();
}
int
diff --cc tests/libtracker-data/tracker-sparql-test.c
index 972ed6b,28718f0..d9635ee
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@@ -86,153 -86,140 +86,140 @@@ strstr_i (const char *a, const char *b
static void
test_sparql_query (gconstpointer test_data)
{
+ int (*comparer) (const char *a, const char *b);
+ TrackerDBResultSet *result_set;
const TestInfo *test_info;
-
+ GError *error;
+ GString *test_results;
+ gchar *data_filename;
+ gchar *query, *query_filename;
+ gchar *results, *results_filename;
+ gchar *prefix, *data_prefix, *test_prefix;
+
+ error = NULL;
test_info = 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 (*comparer) (const char *a, const char *b);
- 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;
-
- /* 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,
- data_prefix,
- NULL, NULL);
-
- /* data_path = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL); */
-
- /* load data set */
- data_filename = g_strconcat (data_prefix, ".ttl", NULL);
- tracker_turtle_reader_load (data_filename, &error);
- g_assert (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);
- query_filename = g_strconcat (test_prefix, ".rq", NULL);
- g_file_get_contents (query_filename, &query, NULL, &error);
- g_assert (error == NULL);
+ tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
+ data_prefix,
- NULL);
++ NULL, NULL);
+
+ /* data_path = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL); */
+
+ /* load data set */
+ data_filename = g_strconcat (data_prefix, ".ttl", NULL);
+ tracker_turtle_reader_load (data_filename, &error);
+ g_assert (error == NULL);
+
+ query_filename = g_strconcat (test_prefix, ".rq", NULL);
+ g_file_get_contents (query_filename, &query, NULL, &error);
+ g_assert (error == NULL);
- results_filename = g_strconcat (test_prefix, ".out", NULL);
- g_file_get_contents (results_filename, &results, NULL, &error);
+ results_filename = g_strconcat (test_prefix, ".out", NULL);
+ g_file_get_contents (results_filename, &results, NULL, &error);
+ g_assert (error == NULL);
+
+ g_free (data_prefix);
+ g_free (test_prefix);
+
+ /* perform actual query */
+
+ result_set = tracker_data_query_sparql (query, &error);
+ if (test_info->expect_error) {
+ comparer = strstr_i;
+ g_assert (error != NULL);
+ } else {
+ comparer = strcmp;
g_assert (error == NULL);
+ }
- g_free (data_prefix);
- g_free (test_prefix);
+ /* compare results with reference output */
- /* perform actual query */
+ test_results = g_string_new ("");
- result_set = tracker_data_query_sparql (query, &error);
- if (test_info->expect_error) {
- comparer = strstr_i;
- g_assert (error != NULL);
- } else {
- comparer = strcmp;
- g_assert (error == NULL);
- }
+ if (result_set) {
+ gboolean valid = TRUE;
+ guint col_count;
+ gint col;
- /* compare results with reference output */
-
- test_results = g_string_new ("");
-
- if (result_set) {
- gboolean valid = TRUE;
- guint col_count;
- gint col;
-
- col_count = tracker_db_result_set_get_n_columns (result_set);
-
- while (valid) {
- for (col = 0; col < col_count; col++) {
- GValue value = { 0 };
-
- _tracker_db_result_set_get_value (result_set, col, &value);
-
- switch (G_VALUE_TYPE (&value)) {
- case G_TYPE_INT:
- g_string_append_printf (test_results, "\"%d\"", g_value_get_int (&value));
- break;
- case G_TYPE_DOUBLE:
- g_string_append_printf (test_results, "\"%f\"", g_value_get_double (&value));
- break;
- case G_TYPE_STRING:
- g_string_append_printf (test_results, "\"%s\"", g_value_get_string (&value));
- break;
- default:
- /* unbound variable */
- break;
- }
-
- if (col < col_count - 1) {
- g_string_append (test_results, "\t");
- }
- }
+ col_count = tracker_db_result_set_get_n_columns (result_set);
+
+ while (valid) {
+ for (col = 0; col < col_count; col++) {
+ GValue value = { 0 };
- g_string_append (test_results, "\n");
+ _tracker_db_result_set_get_value (result_set, col, &value);
- valid = tracker_db_result_set_iter_next (result_set);
+ switch (G_VALUE_TYPE (&value)) {
+ case G_TYPE_INT:
+ g_string_append_printf (test_results, "\"%d\"", g_value_get_int (&value));
+ break;
+ case G_TYPE_DOUBLE:
+ g_string_append_printf (test_results, "\"%f\"", g_value_get_double (&value));
+ break;
+ case G_TYPE_STRING:
+ g_string_append_printf (test_results, "\"%s\"", g_value_get_string (&value));
+ break;
+ default:
+ /* unbound variable */
+ break;
+ }
+
+ if (col < col_count - 1) {
+ g_string_append (test_results, "\t");
+ }
}
- g_object_unref (result_set);
- } else if (test_info->expect_error) {
- g_string_append (test_results, error->message);
- g_clear_error (&error);
- }
+ g_string_append (test_results, "\n");
- if (comparer (results, test_results->str)) {
- /* print result difference */
- gchar *quoted_results;
- gchar *command_line;
- gchar *quoted_command_line;
- gchar *shell;
- gchar *diff;
-
- quoted_results = g_shell_quote (test_results->str);
- command_line = g_strdup_printf ("echo -n %s | diff -u %s -", quoted_results, results_filename);
- quoted_command_line = g_shell_quote (command_line);
- shell = g_strdup_printf ("sh -c %s", quoted_command_line);
- g_spawn_command_line_sync (shell, &diff, NULL, NULL, &error);
- g_assert (error == NULL);
-
- g_error ("%s", diff);
-
- g_free (quoted_results);
- g_free (command_line);
- g_free (quoted_command_line);
- g_free (shell);
- g_free (diff);
-
- exitcode = 1;
+ valid = tracker_db_result_set_iter_next (result_set);
}
- /* cleanup */
+ g_object_unref (result_set);
+ } else if (test_info->expect_error) {
+ g_string_append (test_results, error->message);
+ g_clear_error (&error);
+ }
- g_free (data_filename);
- g_free (query_filename);
- g_free (query);
- g_free (results_filename);
- g_free (results);
- g_string_free (test_results, TRUE);
+ if (comparer (results, test_results->str)) {
+ /* print result difference */
+ gchar *quoted_results;
+ gchar *command_line;
+ gchar *quoted_command_line;
+ gchar *shell;
+ gchar *diff;
+
+ quoted_results = g_shell_quote (test_results->str);
+ command_line = g_strdup_printf ("echo -n %s | diff -u %s -", quoted_results, results_filename);
+ quoted_command_line = g_shell_quote (command_line);
+ shell = g_strdup_printf ("sh -c %s", quoted_command_line);
+ g_spawn_command_line_sync (shell, &diff, NULL, NULL, &error);
+ g_assert (error == NULL);
- tracker_data_manager_shutdown ();
+ g_error ("%s", diff);
- exit (exitcode);
+ g_free (quoted_results);
+ g_free (command_line);
+ g_free (quoted_command_line);
+ g_free (shell);
+ g_free (diff);
}
- g_test_trap_assert_passed ();
+ /* cleanup */
+
+ g_free (data_filename);
+ g_free (query_filename);
+ g_free (query);
+ g_free (results_filename);
+ g_free (results);
+ g_string_free (test_results, TRUE);
+
+ tracker_data_manager_shutdown ();
}
int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]