diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2019-06-13 11:28:26 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2019-06-13 11:28:26 +0200 |
commit | ca5f2e8b3e0e7fbe27b14ff8e51748364969e4e1 (patch) | |
tree | 09a76f755e21b139be8d518848012d59dd209bbd | |
parent | 20c5d7fd922bfbf5d611c5c5b6cf78cb438437e0 (diff) |
ublox,tests: expect error if empty band list when parsing UACT?
-rw-r--r-- | plugins/ublox/tests/test-modem-helpers-ublox.c | 12 |
1 files 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); } |