[tracker/wip/carlosg/resources-as-cursors: 7/11] tests: Invert order of asserts




commit b66090716fe758c9681a1d2632f506c59e49feff
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jul 11 20:34:02 2022 +0200

    tests: Invert order of asserts
    
    When checking a function with a return value and a GError out argument,
    it often gives better clues to check the error first, then the return
    value.

 tests/libtracker-sparql/tracker-deserialize-test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/libtracker-sparql/tracker-deserialize-test.c 
b/tests/libtracker-sparql/tracker-deserialize-test.c
index 948fa137a..c71caa234 100644
--- a/tests/libtracker-sparql/tracker-deserialize-test.c
+++ b/tests/libtracker-sparql/tracker-deserialize-test.c
@@ -154,8 +154,8 @@ deserialize_dbus_cb (GObject      *source,
 
        retval = tracker_sparql_connection_deserialize_finish (TRACKER_SPARQL_CONNECTION (source),
                                                               res, &error);
-       g_assert_true (retval);
        g_assert_no_error (error);
+       g_assert_true (retval);
 
        g_main_loop_quit (test_fixture->loop);
 }
@@ -196,8 +196,8 @@ deserialize_direct_cb (GObject      *source,
 
        retval = tracker_sparql_connection_deserialize_finish (TRACKER_SPARQL_CONNECTION (source),
                                                               res, &error);
-       g_assert_true (retval);
        g_assert_no_error (error);
+       g_assert_true (retval);
 
        /* Read RDF data back */
        tracker_sparql_connection_serialize_async (test_fixture->direct,


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