diff options
author | Dan Williams <dan@ioncontrol.co> | 2025-05-22 08:09:41 -0500 |
---|---|---|
committer | Dan Williams <dan@ioncontrol.co> | 2025-05-22 08:09:41 -0500 |
commit | 7ae153880c75f89dc6427b234d85c57717bb8df3 (patch) | |
tree | f6ab6714e3da04b954761598e3c73153c81588b5 /src/tests/test-at-serial-port.c | |
parent | 41ceaf6d5ecd85a7f88fc4ed9bdc80a6d2313d23 (diff) | |
parent | c3c6fdc55e5a45f9bf0611ec0925fd0702aff316 (diff) |
Merge request !1356 from 'sierra-call-urc-fix'
serial-parsers: don't echo-remove strange call start/end URCs
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1356
Diffstat (limited to 'src/tests/test-at-serial-port.c')
-rw-r--r-- | src/tests/test-at-serial-port.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tests/test-at-serial-port.c b/src/tests/test-at-serial-port.c index 5372c478..bd608461 100644 --- a/src/tests/test-at-serial-port.c +++ b/src/tests/test-at-serial-port.c @@ -46,6 +46,8 @@ static const EchoRemovalTest echo_removal_tests[] = { { "echo echo\r\nthis is valid\r\nand so is this", "\r\nthis is valid\r\nand so is this" }, { "\r\nthis is valid\r\nand so is this", "\r\nthis is valid\r\nand so is this" }, { "\r\nthis is valid\r\nand so is this\r\n", "\r\nthis is valid\r\nand so is this\r\n" }, + { "\nNO CARRIER\r\n", "\nNO CARRIER\r\n" }, + { "\nCONNECT\r\n", "\nCONNECT\r\n" }, }; static const ParseResponseTest parse_ok_tests[] = { @@ -89,6 +91,7 @@ at_serial_echo_removal (void) guint i; for (i = 0; i < G_N_ELEMENTS (echo_removal_tests); i++) { + gpointer parser; GByteArray *ba; /* Note that we add last NUL also to the byte array, so that we can compare @@ -98,7 +101,9 @@ at_serial_echo_removal (void) (guint8 *)echo_removal_tests[i].original, strlen (echo_removal_tests[i].original) + 1); - mm_port_serial_at_remove_echo (ba); + parser = mm_serial_parser_v1_new (); + mm_serial_parser_v1_remove_echo (parser, ba); + mm_serial_parser_v1_destroy (parser); g_assert_cmpstr ((gchar *)ba->data, ==, echo_removal_tests[i].without_echo); @@ -119,6 +124,7 @@ _run_parse_test (const ParseResponseTest tests[], guint number_of_tests) parser = mm_serial_parser_v1_new (); response = g_string_new (tests[i].response); found = mm_serial_parser_v1_parse (parser, response, NULL, &error); + mm_serial_parser_v1_destroy (parser); /* Verify if we expect a match or not */ g_assert_cmpint (found, ==, tests[i].found); |