summaryrefslogtreecommitdiff
path: root/tests/libtracker-data/tracker-sparql-test.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-03-10 18:40:31 +0100
committerCarlos Garnacho <carlosg@gnome.org>2022-03-13 14:45:44 +0100
commit30b377d032685578bf76e81c64cbfee014d6940b (patch)
tree8ef34d3d10fa429884b5c809ef058a5e7e86d906 /tests/libtracker-data/tracker-sparql-test.c
parent569dc3df7cc39cefd548d81220de8e8ed3ee830a (diff)
downloadtracker-30b377d032685578bf76e81c64cbfee014d6940b.tar.gz
tests: Prepare SPARQL tests for cursor errors
In the tests that we do expect errors, we might get them after next(). Adjust the "expected query failure" checks so it covers the errors produced both when creating or when iterating a cursor.
Diffstat (limited to 'tests/libtracker-data/tracker-sparql-test.c')
-rw-r--r--tests/libtracker-data/tracker-sparql-test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 77752bcaf..2975bb066 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -348,9 +348,7 @@ check_result (TrackerDBCursor *cursor,
gchar *results;
GError *nerror = NULL;
- if (test_info->expect_query_error) {
- g_assert_true (error != NULL);
- } else {
+ if (!test_info->expect_query_error) {
g_assert_no_error (error);
}
@@ -400,8 +398,10 @@ check_result (TrackerDBCursor *cursor,
g_string_append (test_results, "\n");
}
}
- } else if (test_info->expect_query_error) {
- g_assert_true (error != NULL && error->domain == TRACKER_SPARQL_ERROR);
+ }
+
+ if (test_info->expect_query_error) {
+ g_assert_true (error != NULL);
g_string_free (test_results, TRUE);
g_free (results);
return;