diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2019-01-01 19:07:09 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2019-01-30 12:10:03 +0100 |
commit | d8cf219644c673af69f71c3322669a03f5de63fc (patch) | |
tree | 05ecce7abb41b6eabf3af337b19011292ebbbc85 | |
parent | 437fb830c8071c3eca1de5f14378a269f48476f9 (diff) |
ublox,helpers: remove unit tests for supported bands
We're hardcoding the supported bands for each u-blox model, so there
really is no point in having unit tests for them.
-rw-r--r-- | plugins/ublox/tests/test-modem-helpers-ublox.c | 108 |
1 files changed, 4 insertions, 104 deletions
diff --git a/plugins/ublox/tests/test-modem-helpers-ublox.c b/plugins/ublox/tests/test-modem-helpers-ublox.c index 4ba61c22..71d9d56b 100644 --- a/plugins/ublox/tests/test-modem-helpers-ublox.c +++ b/plugins/ublox/tests/test-modem-helpers-ublox.c @@ -485,7 +485,7 @@ test_urat_write_command (void) } /*****************************************************************************/ -/* Supported bands */ +/* Test +UBANDSEL? response parser */ static void common_compare_bands (GArray *bands, @@ -518,102 +518,6 @@ common_compare_bands (GArray *bands, } static void -common_validate_supported_bands (const gchar *model, - const MMModemBand *expected_bands, - guint n_expected_bands) -{ - GError *error = NULL; - GArray *bands; - - bands = mm_ublox_get_supported_bands (model, &error); - g_assert_no_error (error); - g_assert (bands); - - common_compare_bands (bands, expected_bands, n_expected_bands); -} - -static void -test_supported_bands_all (void) -{ - /* All 2G, 3G and 4G bands */ - const MMModemBand expected_bands[] = { - /* 700 */ MM_MODEM_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_17, - /* 800 */ MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_EUTRAN_20, - /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5, - /* 900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8, - /* 1500 */ MM_MODEM_BAND_UTRAN_11, MM_MODEM_BAND_EUTRAN_11, - /* 1700 */ MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_EUTRAN_4, - /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3, - /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_EUTRAN_2, - /* 2100 */ MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_EUTRAN_1, - /* 2600 */ MM_MODEM_BAND_UTRAN_7, MM_MODEM_BAND_EUTRAN_7, - }; - - common_validate_supported_bands (NULL, expected_bands, G_N_ELEMENTS (expected_bands)); -} - -static void -test_supported_bands_toby_l201 (void) -{ - /* Only 3G and 4G bands */ - const MMModemBand expected_bands[] = { - /* 700 */ MM_MODEM_BAND_EUTRAN_13, MM_MODEM_BAND_EUTRAN_17, - /* 800 */ MM_MODEM_BAND_UTRAN_6, MM_MODEM_BAND_EUTRAN_20, - /* 850 */ MM_MODEM_BAND_UTRAN_5, MM_MODEM_BAND_EUTRAN_5, - /* 900 */ MM_MODEM_BAND_UTRAN_8, MM_MODEM_BAND_EUTRAN_8, - /* 1500 */ MM_MODEM_BAND_UTRAN_11, MM_MODEM_BAND_EUTRAN_11, - /* 1700 */ MM_MODEM_BAND_UTRAN_4, MM_MODEM_BAND_EUTRAN_4, - /* 1800 */ MM_MODEM_BAND_UTRAN_3, MM_MODEM_BAND_EUTRAN_3, - /* 1900 */ MM_MODEM_BAND_UTRAN_2, MM_MODEM_BAND_EUTRAN_2, - /* 2100 */ MM_MODEM_BAND_UTRAN_1, MM_MODEM_BAND_EUTRAN_1, - /* 2600 */ MM_MODEM_BAND_UTRAN_7, MM_MODEM_BAND_EUTRAN_7, - }; - - common_validate_supported_bands ("TOBY-L201", expected_bands, G_N_ELEMENTS (expected_bands)); -} - -static void -test_supported_bands_lisa_u200 (void) -{ - /* Only 2G and 3G bands */ - const MMModemBand expected_bands[] = { - /* 800 */ MM_MODEM_BAND_UTRAN_6, - /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, - /* 900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, - /* 1500 */ MM_MODEM_BAND_UTRAN_11, - /* 1700 */ MM_MODEM_BAND_UTRAN_4, - /* 1800 */ MM_MODEM_BAND_DCS, MM_MODEM_BAND_UTRAN_3, - /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, - /* 2100 */ MM_MODEM_BAND_UTRAN_1, - /* 2600 */ MM_MODEM_BAND_UTRAN_7, - }; - - common_validate_supported_bands ("LISA-U200", expected_bands, G_N_ELEMENTS (expected_bands)); -} - -static void -test_supported_bands_sara_u280 (void) -{ - /* Only 3G bands */ - const MMModemBand expected_bands[] = { - /* 800 */ MM_MODEM_BAND_UTRAN_6, - /* 850 */ MM_MODEM_BAND_UTRAN_5, - /* 900 */ MM_MODEM_BAND_UTRAN_8, - /* 1500 */ MM_MODEM_BAND_UTRAN_11, - /* 1700 */ MM_MODEM_BAND_UTRAN_4, - /* 1800 */ MM_MODEM_BAND_UTRAN_3, - /* 1900 */ MM_MODEM_BAND_UTRAN_2, - /* 2100 */ MM_MODEM_BAND_UTRAN_1, - /* 2600 */ MM_MODEM_BAND_UTRAN_7, - }; - - common_validate_supported_bands ("SARA-U280", expected_bands, G_N_ELEMENTS (expected_bands)); -} - -/*****************************************************************************/ -/* Test +UBANDSEL? response parser */ - -static void common_validate_ubandsel_response (const gchar *str, const MMModemBand *expected_bands, const gchar *model, @@ -644,11 +548,11 @@ static void test_ubandsel_response_three (void) { const MMModemBand expected_bands[] = { - /* 800 */ MM_MODEM_BAND_UTRAN_6, + /* 800 */ MM_MODEM_BAND_UTRAN_6, /* 850 */ MM_MODEM_BAND_G850, MM_MODEM_BAND_UTRAN_5, /* 900 */ MM_MODEM_BAND_EGSM, MM_MODEM_BAND_UTRAN_8, - /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, - /* 2100 */ MM_MODEM_BAND_UTRAN_1 + /* 1900 */ MM_MODEM_BAND_PCS, MM_MODEM_BAND_UTRAN_2, + /* 2100 */ MM_MODEM_BAND_UTRAN_1 }; common_validate_ubandsel_response ("+UBANDSEL: 800,850,900,1900,2100\r\n", expected_bands, "SARA-U201", G_N_ELEMENTS (expected_bands)); @@ -1118,10 +1022,6 @@ int main (int argc, char **argv) g_test_add_func ("/MM/ublox/urat/test/response/sara-u280", test_mode_filtering_sara_u280); g_test_add_func ("/MM/ublox/urat/read/response", test_urat_read_response); g_test_add_func ("/MM/ublox/urat/write/command", test_urat_write_command); - g_test_add_func ("/MM/ublox/supported-bands/all", test_supported_bands_all); - g_test_add_func ("/MM/ublox/supported-bands/toby-l201", test_supported_bands_toby_l201); - g_test_add_func ("/MM/ublox/supported-bands/lisa-u200", test_supported_bands_lisa_u200); - g_test_add_func ("/MM/ublox/supported-bands/sara-u280", test_supported_bands_sara_u280); g_test_add_func ("/MM/ublox/ubandsel/response/one", test_ubandsel_response_one); g_test_add_func ("/MM/ublox/ubandsel/response/two", test_ubandsel_response_two); g_test_add_func ("/MM/ublox/ubandsel/response/three", test_ubandsel_response_three); |