From 25db1ca63de7b42f4a9dc8ce15a52f8b475c48cf Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 7 Jan 2021 14:53:36 +0100 Subject: 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) --- libgweather/test_libgweather.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c index af6d5fc..500faf3 100644 --- a/libgweather/test_libgweather.c +++ b/libgweather/test_libgweather.c @@ -434,7 +434,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_true (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); -- cgit v1.2.1