18 assert_escape(
const char *str,
const char *reference,
23 assert_string_equal(buf, reference);
28 null_empty(
void **state)
40 invalid_type(
void **state)
46 assert_escape(
"",
"",
type);
53 escape_unchanged(
void **state)
56 const char *unchanged =
"abcdefghijklmnopqrstuvwxyz" 57 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 59 "`~!@#$%^*()-_=+/|\\[]{}?.,'";
69 escape_left_angle(
void **state)
71 const char *l_angle =
"<abc<def<";
81 escape_right_angle(
void **state)
83 const char *r_angle =
">abc>def>";
93 escape_ampersand(
void **state)
95 const char *ampersand =
"&abc&def&";
105 escape_double_quote(
void **state)
107 const char *double_quote =
"\"abc\"def\"";
111 const char *double_quote_esc_backslash =
"\\\"abc\\\"def\\\"";
115 assert_escape(double_quote, double_quote_esc_backslash,
120 escape_newline(
void **state)
122 const char *newline =
"\nabc\ndef\n";
123 const char *newline_esc_ref =
"
abc
def
";
124 const char *newline_esc_backslash =
"\\nabc\\ndef\\n";
132 escape_tab(
void **state)
134 const char *tab =
"\tabc\tdef\t";
135 const char *tab_esc_ref =
"	abc	def	";
136 const char *tab_esc_backslash =
"\\tabc\\tdef\\t";
144 escape_carriage_return(
void **state)
146 const char *cr =
"\rabc\rdef\r";
147 const char *cr_esc_ref =
"
abc
def
";
148 const char *cr_esc_backslash =
"\\rabc\\rdef\\r";
156 escape_nonprinting(
void **state)
158 const char *nonprinting =
"\a\x7F\x1B";
159 const char *nonprinting_esc =
"";
167 escape_utf8(
void **state)
172 const char *chinese =
"仅高级使用";
173 const char *two_byte =
"abc""\xCF\xA6""d<ef";
176 const char *three_byte =
"abc""\xEF\x98\x98""d<ef";
177 const char *three_byte_esc =
"abc""\xEF\x98\x98""d" 180 const char *four_byte =
"abc""\xF0\x94\x81\x90""d<ef";
181 const char *four_byte_esc =
"abc""\xF0\x94\x81\x90""d" 202 cmocka_unit_test(null_empty),
203 cmocka_unit_test(invalid_type),
204 cmocka_unit_test(escape_unchanged),
205 cmocka_unit_test(escape_left_angle),
206 cmocka_unit_test(escape_right_angle),
207 cmocka_unit_test(escape_ampersand),
208 cmocka_unit_test(escape_double_quote),
209 cmocka_unit_test(escape_newline),
210 cmocka_unit_test(escape_tab),
211 cmocka_unit_test(escape_carriage_return),
212 cmocka_unit_test(escape_nonprinting),
213 cmocka_unit_test(escape_utf8));
char * pcmk__xml_escape(const char *text, enum pcmk__xml_escape_type type)
#define PCMK__XML_ENTITY_LT
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))
enum crm_ais_msg_types type
#define PCMK__XML_ENTITY_GT
int pcmk__xml_test_setup_group(void **state)
#define pcmk__assert_asserts(stmt)
#define PCMK__XML_ENTITY_QUOT
#define PCMK__XML_ENTITY_AMP