From ca5f2e8b3e0e7fbe27b14ff8e51748364969e4e1 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 13 Jun 2019 11:28:26 +0200 Subject: [PATCH] ublox,tests: expect error if empty band list when parsing UACT? --- plugins/ublox/tests/test-modem-helpers-ublox.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/ublox/tests/test-modem-helpers-ublox.c b/plugins/ublox/tests/test-modem-helpers-ublox.c index e0a7d9a8..c069bee2 100644 --- a/plugins/ublox/tests/test-modem-helpers-ublox.c +++ b/plugins/ublox/tests/test-modem-helpers-ublox.c @@ -651,14 +651,22 @@ common_validate_uact_response (const gchar *str, GArray *bands; bands = mm_ublox_parse_uact_response (str, &error); - g_assert_no_error (error); - common_compare_bands (bands, expected_bands, n_expected_bands); + if (n_expected_bands > 0) { + g_assert (bands); + g_assert_no_error (error); + common_compare_bands (bands, expected_bands, n_expected_bands); + } else { + g_assert (!bands); + g_assert (error); + g_error_free (error); + } } static void test_uact_response_empty_list (void) { + common_validate_uact_response ("", NULL, 0); common_validate_uact_response ("+UACT: ,,,\r\n", NULL, 0); }