epan: Rename a test

This commit is contained in:
João Valverde 2022-10-26 13:12:12 +01:00
parent 8920effd27
commit c149e4112f
1 changed files with 8 additions and 5 deletions

View File

@ -48,14 +48,17 @@ void test_label_strcat(void)
g_assert_cmpuint(pos, ==, 8); /* Tried to write 8 bytes. */
}
void test_label_strcat2(void)
void test_label_strcat_escape_whitespace(void)
{
char label[128];
const char *src;
const char *src, *dst;
size_t pos;
src = "ABCD\n\t\f\r\aE"UTF8_MIDDLE_DOT"Z";
ws_label_strcat(label, sizeof(label), 0, src, 0);
g_assert_cmpstr(label, ==, "ABCD\\n\\t\\f\\r\\aE"UTF8_MIDDLE_DOT"Z");
dst = "ABCD\\n\\t\\f\\r\\aE"UTF8_MIDDLE_DOT"Z";
pos = ws_label_strcat(label, sizeof(label), 0, src, 0);
g_assert_cmpstr(label, ==, dst);
g_assert_cmpuint(pos, ==, strlen(dst));
}
void test_label_escape_control(void)
@ -80,7 +83,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
g_test_add_func("/label/strcat", test_label_strcat);
g_test_add_func("/label/strcat2", test_label_strcat2);
g_test_add_func("/label/escape_whitespace", test_label_strcat_escape_whitespace);
g_test_add_func("/label/escape_control", test_label_escape_control);
ret = g_test_run();