[libgweather/wip/hadess/fix-utc-sunrise: 29/32] tests: Add test for named timezone sunrise fetching
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/wip/hadess/fix-utc-sunrise: 29/32] tests: Add test for named timezone sunrise fetching
- Date: Mon, 8 Oct 2018 10:49:11 +0000 (UTC)
commit d9b4bf27da9ff400f9cf087521c1553ad5b23039
Author: Bastien Nocera <hadess hadess net>
Date: Mon Oct 8 12:19:00 2018 +0200
tests: Add test for named timezone sunrise fetching
C version of the Javascript mentioned in:
https://gitlab.gnome.org/GNOME/libgweather/issues/5
libgweather/test_libgweather.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
---
diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c
index 1760171..ba69941 100644
--- a/libgweather/test_libgweather.c
+++ b/libgweather/test_libgweather.c
@@ -25,6 +25,7 @@
#include <gweather-version.h>
#include "gweather-location.h"
+#include "gweather-weather.h"
/* For test_metar_weather_stations */
#define METAR_SOURCES "https://www.aviationweather.gov/docs/metar/stations.txt"
@@ -380,6 +381,26 @@ test_metar_weather_stations (void)
test_metar_weather_stations_children (world, stations_ht);
}
+static void
+test_utc_sunset (void)
+{
+ GWeatherLocation *world, *utc;
+ GWeatherInfo *info;
+ char *sunset;
+
+ world = gweather_location_get_world ();
+ g_assert_nonnull (world);
+ utc = gweather_location_find_by_station_code (world, "@UTC");
+ g_assert_nonnull (utc);
+
+ info = gweather_info_new (utc);
+ gweather_info_set_enabled_providers (info, GWEATHER_PROVIDER_NONE);
+ gweather_info_update (info);
+
+ sunset = gweather_info_get_sunset (info);
+ g_assert_nonnull (sunset);
+}
+
static void
check_bad_duplicate_weather_stations (gpointer key,
gpointer value,
@@ -537,6 +558,7 @@ main (int argc, char *argv[])
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);
+ g_test_add_func ("/weather/utc_sunset", test_utc_sunset);
/* Modifies environment, so needs to run last */
g_test_add_func ("/weather/bad_duplicate_weather_stations", test_bad_duplicate_weather_stations);
g_test_add_func ("/weather/duplicate_weather_stations", test_duplicate_weather_stations);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]