43 char actual[256] =
"";
47 max_len =
sizeof(actual);
51 if (res != expected_res) {
56 if (strcmp(expected, actual) != 0) {
69 info->name =
"xml_escape_test";
70 info->category =
"/main/xml_escape/";
71 info->summary =
"Test XML escaping";
82 input =
"encode me: <&>'\"";
83 expected =
"encode me: <&>'"";
92 input =
"<truncated>";
93 expected =
"<trunc";
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
AST_TEST_DEFINE(xml_escape_test)
static int unload_module(void)
#define AST_TEST_REGISTER(cb)
static int input(yyscan_t yyscanner)
int ast_xml_escape(const char *string, char *outbuf, size_t buflen)
Escape reserved characters for use in XML.
#define ast_test_status_update(a, b, c...)
#define AST_TEST_UNREGISTER(cb)
static enum ast_test_result_state test_res
static void test_xml(struct ast_test *test, const char *input, const char *expected, int max_len, int expected_res)
static int load_module(void)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.