test-modem-helpers: add EOL to strings matched with G_REGEX_NEWLINE_CRLF

Looks like pcre2 (used since glib 2.73.2) requires EOLs to match if
G_REGEX_NEWLINE_CRLF is explicitly used. The tests are updated
accordingly, because the modem responses will anyway have the EOLs
as well.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2729#note_1544130

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601
This commit is contained in:
Aleksander Morgado
2022-09-02 17:13:29 +02:00
parent 79a5a4eed2
commit 51a333cd9a

View File

@@ -4250,8 +4250,8 @@ typedef struct {
} TestCcwa; } TestCcwa;
static TestCcwa test_ccwa[] = { static TestCcwa test_ccwa[] = {
{ "+CCWA: 0,255", FALSE, FALSE }, /* all disabled */ { "+CCWA: 0,255\r\n", FALSE, FALSE }, /* all disabled */
{ "+CCWA: 1,255", TRUE, FALSE }, /* all enabled */ { "+CCWA: 1,255\r\n", TRUE, FALSE }, /* all enabled */
{ "+CCWA: 0,1\r\n" { "+CCWA: 0,1\r\n"
"+CCWA: 0,4\r\n", FALSE, FALSE }, /* voice and fax disabled */ "+CCWA: 0,4\r\n", FALSE, FALSE }, /* voice and fax disabled */
{ "+CCWA: 1,1\r\n" { "+CCWA: 1,1\r\n"
@@ -4326,7 +4326,7 @@ common_test_clcc_response (const gchar *str,
static void static void
test_clcc_response_empty (void) test_clcc_response_empty (void)
{ {
const gchar *response = ""; const gchar *response = "\r\n";
common_test_clcc_response (response, NULL, 0); common_test_clcc_response (response, NULL, 0);
} }
@@ -4339,7 +4339,7 @@ test_clcc_response_single (void)
}; };
const gchar *response = const gchar *response =
"+CLCC: 1,1,0,0,0,\"123456789\",161"; "+CLCC: 1,1,0,0,0,\"123456789\",161\r\n";
common_test_clcc_response (response, expected_call_info_list, G_N_ELEMENTS (expected_call_info_list)); common_test_clcc_response (response, expected_call_info_list, G_N_ELEMENTS (expected_call_info_list));
} }
@@ -4353,7 +4353,7 @@ test_clcc_response_single_long (void)
/* NOTE: priority field is EMPTY */ /* NOTE: priority field is EMPTY */
const gchar *response = const gchar *response =
"+CLCC: 1,1,4,0,0,\"123456789\",129,\"\",,0"; "+CLCC: 1,1,4,0,0,\"123456789\",129,\"\",,0\r\n";
common_test_clcc_response (response, expected_call_info_list, G_N_ELEMENTS (expected_call_info_list)); common_test_clcc_response (response, expected_call_info_list, G_N_ELEMENTS (expected_call_info_list));
} }