diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-03-01 00:53:19 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-03-01 00:53:19 +0100 |
commit | a6f51ee3faf37bfcb759b96ee76c85c490395b48 (patch) | |
tree | f0afc19a437319671678cf9b16a43682bba6b529 /source/tests/xml.test.c | |
parent | c6474ea8adbbc21878eebaecbca748fa4f65f8ee (diff) | |
download | kit-a6f51ee3faf37bfcb759b96ee76c85c490395b48.zip |
Remove unnecessary macro
Diffstat (limited to 'source/tests/xml.test.c')
-rw-r--r-- | source/tests/xml.test.c | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/source/tests/xml.test.c b/source/tests/xml.test.c index 1534030..a31da8f 100644 --- a/source/tests/xml.test.c +++ b/source/tests/xml.test.c @@ -4,7 +4,7 @@ #include "../kit/test.h" TEST("xml parse tag") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo> </foo>")); + is_handle_t is = is_wrap_string(SZ("<foo> </foo>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -19,7 +19,7 @@ TEST("xml parse tag") { } TEST("xml parse tag with dash") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo-bar> </foo-bar>")); + is_handle_t is = is_wrap_string(SZ("<foo-bar> </foo-bar>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -34,7 +34,7 @@ TEST("xml parse tag with dash") { } TEST("xml parse tag not closed") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo>")); + is_handle_t is = is_wrap_string(SZ("<foo>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_PARSING_FAILED); @@ -46,7 +46,7 @@ TEST("xml parse tag not closed") { } TEST("xml parse tag text") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo> bar </foo>")); + is_handle_t is = is_wrap_string(SZ("<foo> bar </foo>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -62,7 +62,7 @@ TEST("xml parse tag text") { } TEST("xml parse empty tag") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo />")); + is_handle_t is = is_wrap_string(SZ("<foo />"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -77,7 +77,7 @@ TEST("xml parse empty tag") { } TEST("xml parse tail") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo></foo> bar")); + is_handle_t is = is_wrap_string(SZ("<foo></foo> bar"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -92,7 +92,7 @@ TEST("xml parse tail") { } TEST("xml parse empty tail") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo /> bar")); + is_handle_t is = is_wrap_string(SZ("<foo /> bar"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -107,7 +107,7 @@ TEST("xml parse empty tail") { } TEST("xml parse property") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo bar=\"42\"></foo>")); + is_handle_t is = is_wrap_string(SZ("<foo bar=\"42\"></foo>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -126,7 +126,7 @@ TEST("xml parse property") { } TEST("xml parse empty property") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo bar=\"42\" />")); + is_handle_t is = is_wrap_string(SZ("<foo bar=\"42\" />"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -145,7 +145,7 @@ TEST("xml parse empty property") { } TEST("xml parse child") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo><bar></bar></foo>")); + is_handle_t is = is_wrap_string(SZ("<foo><bar></bar></foo>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -162,7 +162,8 @@ TEST("xml parse child") { } TEST("xml parse child with text and tail") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo>text<bar /> tail</foo>")); + is_handle_t is = is_wrap_string(SZ("<foo>text<bar /> tail</foo>"), + NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -182,7 +183,7 @@ TEST("xml parse child with text and tail") { } TEST("xml parse declaration") { - is_handle_t is = IS_WRAP_STRING(SZ("<?foo ?>")); + is_handle_t is = is_wrap_string(SZ("<?foo ?>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -197,7 +198,7 @@ TEST("xml parse declaration") { } TEST("xml parse comment") { - is_handle_t is = IS_WRAP_STRING(SZ("<!-- foo --><bar />")); + is_handle_t is = is_wrap_string(SZ("<!-- foo --><bar />"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -212,7 +213,8 @@ TEST("xml parse comment") { } TEST("xml parse comment before text") { - is_handle_t is = IS_WRAP_STRING(SZ("<!-- foo --> bar <tag />")); + is_handle_t is = is_wrap_string(SZ("<!-- foo --> bar <tag />"), + NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -227,7 +229,8 @@ TEST("xml parse comment before text") { } TEST("xml parse comment after text") { - is_handle_t is = IS_WRAP_STRING(SZ("foo <!-- bar --><tag />")); + is_handle_t is = is_wrap_string(SZ("foo <!-- bar --><tag />"), + NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -242,8 +245,8 @@ TEST("xml parse comment after text") { } TEST("xml parse comment between text") { - is_handle_t is = IS_WRAP_STRING( - SZ("foo<!-- comment --> bar<tag />")); + is_handle_t is = is_wrap_string( + SZ("foo<!-- comment --> bar<tag />"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -258,7 +261,7 @@ TEST("xml parse comment between text") { } TEST("xml parse comment tail") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo /><!-- tail -->")); + is_handle_t is = is_wrap_string(SZ("<foo /><!-- tail -->"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -273,7 +276,8 @@ TEST("xml parse comment tail") { } TEST("xml parse comment tail before text") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo /><!-- tail --> bar")); + is_handle_t is = is_wrap_string(SZ("<foo /><!-- tail --> bar"), + NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -289,7 +293,8 @@ TEST("xml parse comment tail before text") { } TEST("xml parse comment tail after text") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo /> bar <!-- tail -->")); + is_handle_t is = is_wrap_string(SZ("<foo /> bar <!-- tail -->"), + NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -305,7 +310,8 @@ TEST("xml parse comment tail after text") { } TEST("xml parse comment tail between text") { - is_handle_t is = IS_WRAP_STRING(SZ("<tag />foo<!-- tail --> bar")); + is_handle_t is = is_wrap_string(SZ("<tag />foo<!-- tail --> bar"), + NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -321,7 +327,7 @@ TEST("xml parse comment tail between text") { } TEST("xml parse escaped text") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo>")); + is_handle_t is = is_wrap_string(SZ("<foo>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -336,7 +342,8 @@ TEST("xml parse escaped text") { } TEST("xml parse escaped quote property") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo bar=\"&"\" />")); + is_handle_t is = is_wrap_string(SZ("<foo bar=\"&"\" />"), + NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -357,7 +364,8 @@ TEST("xml parse escaped quote property") { } TEST("xml parse escaped apostrophe property") { - is_handle_t is = IS_WRAP_STRING(SZ("<foo bar='&'' />")); + is_handle_t is = is_wrap_string(SZ("<foo bar='&'' />"), + NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -377,7 +385,7 @@ TEST("xml parse escaped apostrophe property") { } TEST("xml parse invalid escape") { - is_handle_t is = IS_WRAP_STRING(SZ("&foobar;")); + is_handle_t is = is_wrap_string(SZ("&foobar;"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_PARSING_FAILED); @@ -389,8 +397,8 @@ TEST("xml parse invalid escape") { } TEST("xml full text") { - is_handle_t is = IS_WRAP_STRING( - SZ("<tag>foo <a>text</a> bar <b>text</b> tail</tag>")); + is_handle_t is = is_wrap_string( + SZ("<tag>foo <a>text</a> bar <b>text</b> tail</tag>"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); @@ -407,8 +415,8 @@ TEST("xml full text") { } TEST("xml property") { - is_handle_t is = IS_WRAP_STRING( - SZ("<tag foo=\"123\" bar=\"456\" />")); + is_handle_t is = is_wrap_string( + SZ("<tag foo=\"123\" bar=\"456\" />"), NULL); xml_parse_result_t res = xml_parse(is, NULL); REQUIRE_EQ(res.status, KIT_OK); |