From eec5e908adb9c8809865dd534fbfff8116a43bdb Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Mon, 8 Jul 2024 21:35:18 +0200 Subject: [PATCH] tests: Test mismatched E4X tags --- .../swfs/avm2/xml_mismatched_tag/Test.as | 39 ++++++++++++++++++ .../swfs/avm2/xml_mismatched_tag/output.txt | 37 +++++++++++++++++ .../swfs/avm2/xml_mismatched_tag/test.swf | Bin 0 -> 1033 bytes .../swfs/avm2/xml_mismatched_tag/test.toml | 1 + .../Error1085XmlEndTagMissing/test.toml | 1 - .../kXMLUnterminatedElementTagErr/test.toml | 1 - 6 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 tests/tests/swfs/avm2/xml_mismatched_tag/Test.as create mode 100644 tests/tests/swfs/avm2/xml_mismatched_tag/output.txt create mode 100644 tests/tests/swfs/avm2/xml_mismatched_tag/test.swf create mode 100644 tests/tests/swfs/avm2/xml_mismatched_tag/test.toml diff --git a/tests/tests/swfs/avm2/xml_mismatched_tag/Test.as b/tests/tests/swfs/avm2/xml_mismatched_tag/Test.as new file mode 100644 index 000000000000..cca41e94bf75 --- /dev/null +++ b/tests/tests/swfs/avm2/xml_mismatched_tag/Test.as @@ -0,0 +1,39 @@ +package { + import flash.display.Sprite; + public class Test extends Sprite { } +} + +var testcases = [ + "", + "", + "", + "", + // TODO: Should be rejected + // "", + "", + "", + "", + '', + "", + "", + "", + "", + "", + '', + "", + "", + // TODO + // "", + "", +] + +for each (var testcase in testcases) { + trace("input: " + testcase); + + try { + var xml = new XML(testcase); + trace("result: " + xml.toXMLString()); + } catch (e) { + trace(e); + } +} diff --git a/tests/tests/swfs/avm2/xml_mismatched_tag/output.txt b/tests/tests/swfs/avm2/xml_mismatched_tag/output.txt new file mode 100644 index 000000000000..5f0fbe9d8b6b --- /dev/null +++ b/tests/tests/swfs/avm2/xml_mismatched_tag/output.txt @@ -0,0 +1,37 @@ +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +TypeError: Error #1085: The element type "b" must be terminated by the matching end-tag "". +input: +result: +input: +result: +input: +result: +input: +result: +input: +result: +input: +result: +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "". +input: +result: + + + diff --git a/tests/tests/swfs/avm2/xml_mismatched_tag/test.swf b/tests/tests/swfs/avm2/xml_mismatched_tag/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..35f18d8276aca6b4bb040f305dfb25b7dfcf0ffe GIT binary patch literal 1033 zcmV+k1orzwS5qeU1poke0fkgcZ`(!?-iO48{F3U#v6I+gY^RECN~C2si5;1+5!FG0 zwl1PRf)s+l$I@a=kp#K2oKt}wb1Kkl4?PtqP@q4dryhE$(jxV}m-eXs0(X~^>;x!K z0?XZ*`Mz&wcZNIxnLh!T{0@Lw2x^5n0Kga1e?b7MvEyz(sqHH#Z9ho1nYB}FQ5tP) zTDRLRcQ?vme5kE&ZEb0KMXOXw3{gs+2h=<%1<6v;NCj#nv12cyUKl7`(6qu1-6#63sD?NcpiSfAO zEB92TqE|Kt>2haP<2V0WC59eWTmwwzJ98f#ls??6*FQaYQUkpy)&Xxkwfx_>3Lc=d zv$JP8%t8Vinf%c&8>~wJ`1OZZUw_3`Kj%Io2?al0dciO}lA3u?=Ad#WwG^!twuwf= zw#L#qqG6<^mAikRhs$On^I7Asi8N4lyd?6?=R!S-JxYWF>vLk$sdtZAchp$Oq^!2_ z_y9||H<{pmMj1d0j{-_!)27}r8F*&ih(8Ef!+HUUan&>gHma5(@<}rdX)tSsJXk2& z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