[libgweather/wip/hadess/serialisation-fix-stable: 11/13] tests: Fix metar code test



commit db50b862374da31c95fab2ab84e95fb0de4141c8
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Oct 9 18:43:20 2018 +0200

    tests: Fix metar code test
    
    ac03cab9bc55d487ec12d5d457dd041890474b66 now checks for valid
    coordinates, but we didn't set that structure member in our hacky test.

 libgweather/test_metar.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/libgweather/test_metar.c b/libgweather/test_metar.c
index 877ec7e..3fa30c7 100644
--- a/libgweather/test_metar.c
+++ b/libgweather/test_metar.c
@@ -40,6 +40,26 @@ main (int argc, char **argv)
        perror (error->message);
        return error->code;
     }
+
+    if (code) {
+        GMainLoop *loop;
+
+        loop = g_main_loop_new (NULL, TRUE);
+
+        info = g_object_new (GWEATHER_TYPE_INFO, NULL);
+        info->priv->location.code = g_strdup (code);
+        info->priv->location.latlon_valid = TRUE;
+        info->priv->session = soup_session_new ();
+        g_signal_connect (G_OBJECT (info), "updated",
+                          G_CALLBACK (weather_updated_cb), loop);
+
+        metar_start_open (info);
+
+        g_main_loop_run (loop);
+
+        return 0;
+    }
+
     if (filename) {
        stream = fopen (filename, "r");
        if (!stream) {


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