[libgweather/wip/hadess/serialisation-fix: 7/17] tests: Add test for serialisation of Amiens



commit fb83e03422cb07f89e7f1d57a407bbbbf484c74e
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Oct 9 15:14:58 2018 +0200

    tests: Add test for serialisation of Amiens
    
    See https://gitlab.gnome.org/GNOME/libgweather/issues/6

 libgweather/test_libgweather.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c
index 8bc60f4..7a3900a 100644
--- a/libgweather/test_libgweather.c
+++ b/libgweather/test_libgweather.c
@@ -154,6 +154,25 @@ test_named_timezones_deserialized (void)
     _gweather_location_reset_world ();
 }
 
+static void
+test_no_code_serialize (void)
+{
+    GVariant *variant;
+    GWeatherLocation *world, *loc;
+
+    world = gweather_location_get_world ();
+    g_assert_nonnull (world);
+
+    loc = gweather_location_find_nearest_city (world, 49.892, 2.299);
+    g_assert (loc);
+    g_assert_cmpstr (gweather_location_get_name (loc), ==, "Amiens");
+
+    variant = gweather_location_serialize (loc);
+    g_assert_nonnull (variant);
+
+    _gweather_location_reset_world ();
+}
+
 static void
 test_timezone (GWeatherLocation *location)
 {
@@ -621,6 +640,7 @@ main (int argc, char *argv[])
 
        g_test_add_func ("/weather/named-timezones", test_named_timezones);
        g_test_add_func ("/weather/named-timezones-deserialized", test_named_timezones_deserialized);
+       g_test_add_func ("/weather/no-code-serialize", test_no_code_serialize);
        g_test_add_func ("/weather/timezones", test_timezones);
        g_test_add_func ("/weather/airport_distance_sanity", test_airport_distance_sanity);
        g_test_add_func ("/weather/metar_weather_stations", test_metar_weather_stations);


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