[tracker/wip/carlosg/more-tests: 2/3] tests: Prepare SPARQL tests for cursor errors




commit 0a4e73a1810d9c5a257a6a36e6856b08115c75c2
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Mar 10 18:40:31 2022 +0100

    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.

 tests/libtracker-data/tracker-sparql-test.c | 10 +++++-----
 1 file 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;


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