summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-01-07 14:53:36 +0100
committerBenjamin Berg <bberg@redhat.com>2021-03-25 23:07:30 +0100
commitf6db5b7021876d1403fb97b7d04a30e5aa9a7570 (patch)
tree3bc017ae6034cc0ed05bfbf229748eab889ea70b
parent1d8ed2e09890729fe905776d37fb27b1633bf64f (diff)
downloadlibgweather-f6db5b7021876d1403fb97b7d04a30e5aa9a7570.tar.gz
tests: Make it easier to see soup status on failure
Can be useful if libsoup and dependencies aren't installed properly and, say, SSL/TLS support is broken. GWeather:ERROR:test_libgweather.c:427:test_metar_weather_stations: assertion failed (msg->status_code >= 200): (6 >= 200)
-rw-r--r--libgweather/test_libgweather.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c
index e0e4b81..22280ca 100644
--- a/libgweather/test_libgweather.c
+++ b/libgweather/test_libgweather.c
@@ -420,7 +420,13 @@ test_metar_weather_stations (void)
msg = soup_message_new ("GET", METAR_SOURCES);
session = soup_session_new ();
soup_session_send_message (session, msg);
- g_assert (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code));
+ if (msg->status_code == SOUP_STATUS_SSL_FAILED) {
+ g_test_message ("SSL/TLS failure, please check your glib-networking installation");
+ g_test_failed ();
+ return;
+ }
+ g_assert_cmpint (msg->status_code, >=, 200);
+ g_assert_cmpint (msg->status_code, <, 300);
g_object_unref (session);
g_assert_nonnull (msg->response_body);