18 null_empty(
void **state)
30 invalid_type(
void **state)
43 escape_unchanged(
void **state)
46 const char *unchanged =
"abcdefghijklmnopqrstuvwxyz" 47 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 49 "`~!@#$%^*()-_=+/|\\[]{}?.,'";
60 escape_left_angle(
void **state)
62 const char *l_angle_left =
"<abcdef";
63 const char *l_angle_mid =
"abc<def";
64 const char *l_angle_right =
"abcdef<";
83 escape_right_angle(
void **state)
85 const char *r_angle_left =
">abcdef";
86 const char *r_angle_mid =
"abc>def";
87 const char *r_angle_right =
"abcdef>";
106 escape_ampersand(
void **state)
108 const char *ampersand_left =
"&abcdef";
109 const char *ampersand_mid =
"abc&def";
110 const char *ampersand_right =
"abcdef&";
129 escape_double_quote(
void **state)
131 const char *double_quote_left =
"\"abcdef";
132 const char *double_quote_mid =
"abc\"def";
133 const char *double_quote_right =
"abcdef\"";
158 escape_newline(
void **state)
160 const char *newline_left =
"\nabcdef";
161 const char *newline_mid =
"abc\ndef";
162 const char *newline_right =
"abcdef\n";
181 escape_tab(
void **state)
183 const char *tab_left =
"\tabcdef";
184 const char *tab_mid =
"abc\tdef";
185 const char *tab_right =
"abcdef\t";
202 escape_carriage_return(
void **state)
204 const char *cr_left =
"\rabcdef";
205 const char *cr_mid =
"abc\rdef";
206 const char *cr_right =
"abcdef\r";
222 escape_nonprinting(
void **state)
224 const char *alert_left =
"\aabcdef";
225 const char *alert_mid =
"abc\adef";
226 const char *alert_right =
"abcdef\a";
228 const char *delete_left =
"\x7F""abcdef";
229 const char *delete_mid =
"abc\x7F""def";
230 const char *delete_right =
"abcdef\x7F";
232 const char *nonprinting_all =
"\a\x7F\x1B";
271 escape_utf8(
void **state)
276 const char *chinese =
"仅高级使用";
277 const char *two_byte =
"abc""\xCF\xA6""def";
278 const char *two_byte_special =
"abc""\xCF\xA6""d<ef";
279 const char *three_byte =
"abc""\xEF\x98\x98""def";
280 const char *three_byte_special =
"abc""\xEF\x98\x98""d<ef";
281 const char *four_byte =
"abc""\xF0\x94\x81\x90""def";
282 const char *four_byte_special =
"abc""\xF0\x94\x81\x90""d<ef";
326 cmocka_unit_test(null_empty),
327 cmocka_unit_test(invalid_type),
328 cmocka_unit_test(escape_unchanged),
329 cmocka_unit_test(escape_left_angle),
330 cmocka_unit_test(escape_right_angle),
331 cmocka_unit_test(escape_ampersand),
332 cmocka_unit_test(escape_double_quote),
333 cmocka_unit_test(escape_newline),
334 cmocka_unit_test(escape_tab),
335 cmocka_unit_test(escape_carriage_return),
336 cmocka_unit_test(escape_nonprinting),
337 cmocka_unit_test(escape_utf8));
bool pcmk__xml_needs_escape(const char *text, enum pcmk__xml_escape_type type)
enum crm_ais_msg_types type
int pcmk__xml_test_setup_group(void **state)
#define pcmk__assert_asserts(stmt)
PCMK__UNIT_TEST(pcmk__xml_test_setup_group, NULL, cmocka_unit_test(null_empty), cmocka_unit_test(invalid_type), cmocka_unit_test(escape_unchanged), cmocka_unit_test(escape_left_angle), cmocka_unit_test(escape_right_angle), cmocka_unit_test(escape_ampersand), cmocka_unit_test(escape_double_quote), cmocka_unit_test(escape_newline), cmocka_unit_test(escape_tab), cmocka_unit_test(escape_carriage_return), cmocka_unit_test(escape_nonprinting), cmocka_unit_test(escape_utf8))