[libgweather/ebassi/parallel-tests: 14/15] tests: Use private API to access the locations database




commit 161a019815053711521250617d2f5456ee823c35
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Nov 19 17:54:20 2021 +0000

    tests: Use private API to access the locations database
    
    Instead of accessing the internals of GWeatherLocation.

 libgweather/tests/test_libgweather.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/libgweather/tests/test_libgweather.c b/libgweather/tests/test_libgweather.c
index 023454da..a8fb7a1f 100644
--- a/libgweather/tests/test_libgweather.c
+++ b/libgweather/tests/test_libgweather.c
@@ -309,9 +309,8 @@ test_walk_world (void)
     /* Check that we visited a reasonable number of nodes.
      * Due to implicit nearest nodes, this needs to be more than the number
      * of DB entries. */
-    cur = gweather_location_get_world ();
-    g_assert_cmpint (visited, >, cur->db->locations->len);
-    g_clear_object (&cur);
+    GWeatherDb *db = gweather_get_db ();
+    g_assert_cmpint (visited, >, db->locations->len);
 
     /* noop, but asserts we did not leak */
     gweather_test_reset_world ();


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