41static void test_xml(
struct ast_test *
test,
const char *
input,
const char *expected,
int max_len,
int expected_res)
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";
static int input(yyscan_t yyscanner)
Asterisk main include file. File version handling, generic pbx functions.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
#define AST_TEST_REGISTER(cb)
#define ast_test_status_update(a, b, c...)
#define AST_TEST_UNREGISTER(cb)
static void test_xml(struct ast_test *test, const char *input, const char *expected, int max_len, int expected_res)
static enum ast_test_result_state test_res
AST_TEST_DEFINE(xml_escape_test)
static int load_module(void)
static int unload_module(void)
int ast_xml_escape(const char *string, char *outbuf, size_t buflen)
Escape reserved characters for use in XML.