diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-09-30 22:49:23 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-10-05 13:58:03 +0200 |
commit | 7735350dd208d15162bd7e89712b169c12c36308 (patch) | |
tree | b7b51d8a866d54c437817c0c1ebce29e7e988cba /tests/libtracker-sparql | |
parent | 7fda0a271d086805c161444ded5173781f58328f (diff) | |
download | tracker-7735350dd208d15162bd7e89712b169c12c36308.tar.gz |
tests: Remove unused queries from tracker-sparql-test
Those were unused (the test would stop at the third query), and I couldn't
quite figure out why they were added or what they were specifically
testing.
Diffstat (limited to 'tests/libtracker-sparql')
-rw-r--r-- | tests/libtracker-sparql/tracker-sparql-test.c | 47 |
1 files changed, 5 insertions, 42 deletions
diff --git a/tests/libtracker-sparql/tracker-sparql-test.c b/tests/libtracker-sparql/tracker-sparql-test.c index 9a73bd793..4bd34bb27 100644 --- a/tests/libtracker-sparql/tracker-sparql-test.c +++ b/tests/libtracker-sparql/tracker-sparql-test.c @@ -42,58 +42,20 @@ static GMainLoop *main_loop; #if HAVE_TRACKER_FTS -static GCancellable *cancellables[6] = { NULL, NULL, NULL, NULL }; +#define N_QUERIES 3 + +static GCancellable *cancellables[N_QUERIES] = { NULL, }; /* OK: query 0 with either query 4 or 5. * FAIL: query 4 and 5 together (requires data to exist) */ -static const gchar *queries[6] = { +static const gchar *queries[N_QUERIES] = { /* #1 */ "SELECT ?p WHERE { ?p tracker:indexed true }", /* #2 */ "SELECT ?prefix ?ns WHERE { ?ns a tracker:Namespace ; tracker:prefix ?prefix }", /* #3 */ "SELECT ?p WHERE { ?p tracker:fulltextIndexed true }", - /* #4 */ - "SELECT" - " ?u nie:url(?u)" - " tracker:coalesce(nie:title(?u), nfo:fileName(?u), \"Unknown\")" - " nfo:fileLastModified(?u)" - " nfo:fileSize(?u)" - " nie:url(?c) " - "WHERE { " - " ?u fts:match \"love\" . " - " ?u nfo:belongsToContainer ?c ; " - " tracker:available true . " - "} " - "ORDER BY DESC(fts:rank(?u)) " - "OFFSET 0 LIMIT 100", - /* #5 */ - "SELECT" - " ?song" - " nie:url(?song)" - " tracker:coalesce(nie:title(?song), nfo:fileName(?song), \"Unknown\")" - " fn:string-join((?performer, ?album), \" - \")" - " nfo:duration(?song)" - " ?tooltip " - "WHERE {" - " ?match fts:match \"love\"" - " {" - " ?song nmm:musicAlbum ?match" - " } UNION {" - " ?song nmm:performer ?match" - " } UNION {" - " ?song a nfo:Audio ." - " ?match a nfo:Audio" - " FILTER (?song = ?match)" - " }" - " ?song nmm:performer [ nmm:artistName ?performer ] ;" - " nmm:musicAlbum [ nie:title ?album ] ;" - " nfo:belongsToContainer [ nie:url ?tooltip ]" - "} " - "ORDER BY DESC(fts:rank(?song)) DESC(nie:title(?song)) " - "OFFSET 0 LIMIT 100", - NULL }; #endif /* HAVE_TRACKER_FTS */ @@ -197,6 +159,7 @@ test_tracker_sparql_cursor_next_async_query (gint query) TrackerSparqlCursor *cursor; GError *error = NULL; + g_assert (query < G_N_ELEMENTS (queries)); g_print ("ASYNC query %d starting:\n", query); cancellables[query] = g_cancellable_new (); |