aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-03-24 07:36:01 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-04-09 12:38:50 +0000
commit040eb3880cae208660ae9e35bde75f7cffd790a7 (patch)
tree066d04bb7f06f5f1bdccb72d280231f5bc52a849 /src/tests
parent40b36a25cad1d43a46dc0bdf8acb88189fbfbb53 (diff)
helpers: use generic number parsing methods in CREG parser
This fixes the s8500 wave unit test, which was incorrectly parsing the Act field reported as 'B' as "GSM" (strtol(B)=0) Also, given that the generic parsing methods are able to parse numbers from quoted strings, this change allows us to remove the Thuraya specific CREG matching that just took into consideration quoted strings. The Thuraya unit tests are also fixed up to provide proper testing of the logic.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test-modem-helpers.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c
index 60f0a287..1a0d6078 100644
--- a/src/tests/test-modem-helpers.c
+++ b/src/tests/test-modem-helpers.c
@@ -1435,7 +1435,7 @@ test_creg2_s8500_wave_unsolicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
const char *reply = "\r\n+CREG: 2,1,000B,2816, B, C2816\r\n";
- const CregResult result = { 1, 0x000B, 0x2816, MM_MODEM_ACCESS_TECHNOLOGY_GSM, 9, FALSE, FALSE };
+ const CregResult result = { 1, 0x000B, 0x2816, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, 9, FALSE, FALSE };
test_creg_match ("Samsung Wave S8500 CREG=2", FALSE, reply, data, &result);
}
@@ -1525,7 +1525,7 @@ test_cereg2_novatel_lte_solicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
const char *reply = "\r\n+CEREG: 2,1, 1F00, 20 ,79D903 ,7\r\n";
- const CregResult result = { 1, 0x1F00, 0x79D903, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 13, FALSE, TRUE };
+ const CregResult result = { 1, 0x1F00, 0x79D903, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 12, FALSE, TRUE };
test_creg_match ("Novatel LTE E362 CEREG=2", TRUE, reply, data, &result);
}
@@ -1535,7 +1535,7 @@ test_cereg2_novatel_lte_unsolicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
const char *reply = "\r\n+CEREG: 1, 1F00, 20 ,79D903 ,7\r\n";
- const CregResult result = { 1, 0x1F00, 0x79D903, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 12, FALSE, TRUE };
+ const CregResult result = { 1, 0x1F00, 0x79D903, MM_MODEM_ACCESS_TECHNOLOGY_LTE, 11, FALSE, TRUE };
test_creg_match ("Novatel LTE E362 CEREG=2", FALSE, reply, data, &result);
}
@@ -1544,8 +1544,8 @@ static void
test_cgreg2_thuraya_solicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
- const char *reply = "+CGREG: 1, \"0426\", \"F0,0F\"";
- const CregResult result = { 1, 0x0426, 0x00F0, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, 11, TRUE, FALSE };
+ const char *reply = "+CGREG: 2, 1, \"0426\", \"F00F\"";
+ const CregResult result = { 1, 0x0426, 0xF00F, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, 4, TRUE, FALSE };
test_creg_match ("Thuraya solicited CREG=2", TRUE, reply, data, &result);
}
@@ -1554,8 +1554,8 @@ static void
test_cgreg2_thuraya_unsolicited (void *f, gpointer d)
{
RegTestData *data = (RegTestData *) d;
- const char *reply = "\r\n+CGREG: 1, \"0426\", \"F0,0F\"\r\n";
- const CregResult result = { 1, 0x0426, 0x00F0, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, 11, TRUE, FALSE };
+ const char *reply = "\r\n+CGREG: 1, \"0426\", \"F00F\"\r\n";
+ const CregResult result = { 1, 0x0426, 0xF00F, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN, 3, TRUE, FALSE };
test_creg_match ("Thuraya unsolicited CREG=2", FALSE, reply, data, &result);
}