diff --git a/ChangeLog b/ChangeLog index 5f2b6676..f7c78b6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu May 30 23:34:27 2002 Aleksey Sanin + + * Makefile.am result/c14n/* test/c14n/*: C14N tests integrated + into LibXML2 test suite + Thu May 30 21:23:06 2002 Aleksey Sanin * c14n.c: propagating xpath ancesstors node fix to c14n diff --git a/Makefile.am b/Makefile.am index 96855409..df09e314 100644 --- a/Makefile.am +++ b/Makefile.am @@ -106,7 +106,7 @@ check-local: tests testall : tests SVGtests SAXtests -tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests Scripttests Catatests @TEST_SCHEMAS@ @TEST_THREADS@ +tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests C14Ntests Scripttests Catatests @TEST_SCHEMAS@ @TEST_THREADS@ @(cd python ; $(MAKE) tests) valgrind: @@ -611,6 +611,38 @@ Automatatests: testAutomata$(EXEEXT) rm result.$$name ; \ fi ; fi ; done) +C14Ntests : testC14N$(EXEEXT) + -@(for m in with-comments without-comments exc-without-comments ; do \ + echo "##"; \ + echo "## C14N tests: $$m"; \ + echo "##"; \ + for i in $(srcdir)/test/c14n/$$m/*.xml ; do \ + if [ ! -d $$i ] ; then \ + name=`basename $$i .xml`; \ + echo $$name; \ + if [ -e $(srcdir)/test/c14n/$$m/$$name.xpath ] ; then \ + xpathFile=$(srcdir)/test/c14n/$$m/$$name.xpath; \ + else \ + xpathFile=""; \ + fi; \ + if [ -e $(srcdir)/test/c14n/$$m/$$name.ns ] ; then \ + nsList=`cat $(srcdir)/test/c14n/$$m/$$name.ns`; \ + else \ + nsList=""; \ + fi; \ + $(CHECKER) $(top_builddir)/testC14N --$$m $$i $$xpathFile $$nsList > $(srcdir)/test/c14n/test.tmp; \ + if [ $$? -eq 0 ]; then \ + diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp ; \ + if [ $$? -ne 0 ]; then \ + echo "Test failed"; \ + fi; \ + else \ + echo "C14N failed"; \ + fi; \ + fi; \ + rm -f $(srcdir)/test/c14n/test.tmp; \ + done; \ + done) Schemastests: testSchemas$(EXEEXT) @(echo > .memdump) diff --git a/result/c14n/exc-without-comments/test-0 b/result/c14n/exc-without-comments/test-0 new file mode 100644 index 00000000..3806ea06 --- /dev/null +++ b/result/c14n/exc-without-comments/test-0 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/result/c14n/exc-without-comments/test-1 b/result/c14n/exc-without-comments/test-1 new file mode 100644 index 00000000..bd5930fe --- /dev/null +++ b/result/c14n/exc-without-comments/test-1 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/result/c14n/with-comments/example-1 b/result/c14n/with-comments/example-1 new file mode 100644 index 00000000..d98d1684 --- /dev/null +++ b/result/c14n/with-comments/example-1 @@ -0,0 +1,6 @@ + +Hello, world! + + + \ No newline at end of file diff --git a/result/c14n/with-comments/example-2 b/result/c14n/with-comments/example-2 new file mode 100644 index 00000000..2afa15cc --- /dev/null +++ b/result/c14n/with-comments/example-2 @@ -0,0 +1,11 @@ + + + A B + + A + + B + A B + C + + \ No newline at end of file diff --git a/result/c14n/with-comments/example-3 b/result/c14n/with-comments/example-3 new file mode 100644 index 00000000..4c287e6e --- /dev/null +++ b/result/c14n/with-comments/example-3 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/result/c14n/with-comments/example-5 b/result/c14n/with-comments/example-5 new file mode 100644 index 00000000..457d4020 --- /dev/null +++ b/result/c14n/with-comments/example-5 @@ -0,0 +1,4 @@ + + Hello, world! + + \ No newline at end of file diff --git a/result/c14n/with-comments/example-6 b/result/c14n/with-comments/example-6 new file mode 100644 index 00000000..0be38f98 --- /dev/null +++ b/result/c14n/with-comments/example-6 @@ -0,0 +1 @@ +© \ No newline at end of file diff --git a/result/c14n/with-comments/example-7 b/result/c14n/with-comments/example-7 new file mode 100644 index 00000000..0a96cc4d --- /dev/null +++ b/result/c14n/with-comments/example-7 @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/result/c14n/without-comments/example-1 b/result/c14n/without-comments/example-1 new file mode 100644 index 00000000..af9a9770 --- /dev/null +++ b/result/c14n/without-comments/example-1 @@ -0,0 +1,4 @@ + +Hello, world! + \ No newline at end of file diff --git a/result/c14n/without-comments/example-2 b/result/c14n/without-comments/example-2 new file mode 100644 index 00000000..2afa15cc --- /dev/null +++ b/result/c14n/without-comments/example-2 @@ -0,0 +1,11 @@ + + + A B + + A + + B + A B + C + + \ No newline at end of file diff --git a/result/c14n/without-comments/example-3 b/result/c14n/without-comments/example-3 new file mode 100644 index 00000000..4c287e6e --- /dev/null +++ b/result/c14n/without-comments/example-3 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/result/c14n/without-comments/example-5 b/result/c14n/without-comments/example-5 new file mode 100644 index 00000000..c232e740 --- /dev/null +++ b/result/c14n/without-comments/example-5 @@ -0,0 +1,3 @@ + + Hello, world! + \ No newline at end of file diff --git a/result/c14n/without-comments/example-6 b/result/c14n/without-comments/example-6 new file mode 100644 index 00000000..0be38f98 --- /dev/null +++ b/result/c14n/without-comments/example-6 @@ -0,0 +1 @@ +© \ No newline at end of file diff --git a/result/c14n/without-comments/example-7 b/result/c14n/without-comments/example-7 new file mode 100644 index 00000000..0a96cc4d --- /dev/null +++ b/result/c14n/without-comments/example-7 @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/result/c14n/without-comments/test-0 b/result/c14n/without-comments/test-0 new file mode 100644 index 00000000..013de331 --- /dev/null +++ b/result/c14n/without-comments/test-0 @@ -0,0 +1 @@ +I am the text. \ No newline at end of file diff --git a/result/c14n/without-comments/test-1 b/result/c14n/without-comments/test-1 new file mode 100644 index 00000000..0150f4ad --- /dev/null +++ b/result/c14n/without-comments/test-1 @@ -0,0 +1,31 @@ + + + CN=Merlin Hughes,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE + + + + CN=Test DSA CA,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE + + 970849936 + + + MIIDNzCCAvWgAwIBAgIEOd3+kDAJBgcqhkjOOAQDMFsxCzAJBgNVBAYTAklFMQ8w + DQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9sb2dpZXMs + IEx0ZC4xFDASBgNVBAMTC1Rlc3QgRFNBIENBMB4XDTAwMTAwNjE2MzIxNVoXDTAx + MTAwNjE2MzIxNFowXTELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjElMCMG + A1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2llcywgTHRkLjEWMBQGA1UEAxMNTWVy + bGluIEh1Z2hlczCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQDaJjfDTrawMHf8MiUt + Y54b37hSmYNnR3KpGT10uU1Dqppcju06uN0iGbqf947DjkBC25hKnqykK31xBw0E + CPbYq/KC98kghdf2xJCu6B8aqJ95K9jdVflJ3WP7PQxJn+fmM23zy6HYLXVICpfq + etdNj/VHCShZE3bdJiE6VobSFQIVAPQecqS2PaTDprcQnkwx4MHTRXhrAoGAMuGA + lqeB1ax+vyO2+Osubjhl7pHxLu47RIH+/M52DjESA9KMSrwzsYx8yNR2WooByrE0 + t6fu0VncK7UK8olO4t7wpv2z4AFQPRVCKFwo0qgn5aKIkICGMlrRy81avb27wGcW + othx3iPPMtFXtoDqK0JItaI9R8zc1msFhM1GKMYDgYQAAoGActA8YGxrtngg/zKV + vqEOefnwmViFztcnPBYPlJsvh6yKI4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJ + tgJAEto0xAs+Mehuq1DkSFEpP3oDzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LV + lMdwZNFNNJoqMcT2ZfCPrfvYvQ2jRzBFMB4GA1UdEQQXMBWBE21lcmxpbkBiYWx0 + aW1vcmUuaWUwDgYDVR0PAQH/BAQDAgeAMBMGA1UdIwQMMAqACEJZQG0KwRbPMAkG + ByqGSM44BAMDMQAwLgIVAK4skWEFYgrggaJA8vYAwSjg12+KAhUAwHTo7wd4tENw + 9LAKPklQ/74fH18= + + \ No newline at end of file diff --git a/result/c14n/without-comments/test-2 b/result/c14n/without-comments/test-2 new file mode 100644 index 00000000..c829481b --- /dev/null +++ b/result/c14n/without-comments/test-2 @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/result/c14n/without-comments/test-3 b/result/c14n/without-comments/test-3 new file mode 100644 index 00000000..318cb19f --- /dev/null +++ b/result/c14n/without-comments/test-3 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/test/c14n/exc-without-comments/test-0.xml b/test/c14n/exc-without-comments/test-0.xml new file mode 100644 index 00000000..c7c42d9c --- /dev/null +++ b/test/c14n/exc-without-comments/test-0.xml @@ -0,0 +1,18 @@ +]> + + + + + + + + + + + + + + diff --git a/test/c14n/exc-without-comments/test-0.xpath b/test/c14n/exc-without-comments/test-0.xpath new file mode 100644 index 00000000..faa0070f --- /dev/null +++ b/test/c14n/exc-without-comments/test-0.xpath @@ -0,0 +1,3 @@ + +(//. | //@* | //namespace::*)[ancestor-or-self::e6] + \ No newline at end of file diff --git a/test/c14n/exc-without-comments/test-1.ns b/test/c14n/exc-without-comments/test-1.ns new file mode 100644 index 00000000..2e65efe2 --- /dev/null +++ b/test/c14n/exc-without-comments/test-1.ns @@ -0,0 +1 @@ +a \ No newline at end of file diff --git a/test/c14n/exc-without-comments/test-1.xml b/test/c14n/exc-without-comments/test-1.xml new file mode 100644 index 00000000..c7c42d9c --- /dev/null +++ b/test/c14n/exc-without-comments/test-1.xml @@ -0,0 +1,18 @@ +]> + + + + + + + + + + + + + + diff --git a/test/c14n/exc-without-comments/test-1.xpath b/test/c14n/exc-without-comments/test-1.xpath new file mode 100644 index 00000000..faa0070f --- /dev/null +++ b/test/c14n/exc-without-comments/test-1.xpath @@ -0,0 +1,3 @@ + +(//. | //@* | //namespace::*)[ancestor-or-self::e6] + \ No newline at end of file diff --git a/test/c14n/with-comments/doc.dtd b/test/c14n/with-comments/doc.dtd new file mode 100644 index 00000000..e69de29b diff --git a/test/c14n/with-comments/example-1.xml b/test/c14n/with-comments/example-1.xml new file mode 100644 index 00000000..ed450c73 --- /dev/null +++ b/test/c14n/with-comments/example-1.xml @@ -0,0 +1,14 @@ + + + + + + +Hello, world! + + + + + + diff --git a/test/c14n/with-comments/example-2.xml b/test/c14n/with-comments/example-2.xml new file mode 100644 index 00000000..74eeea14 --- /dev/null +++ b/test/c14n/with-comments/example-2.xml @@ -0,0 +1,11 @@ + + + A B + + A + + B + A B + C + + diff --git a/test/c14n/with-comments/example-3.xml b/test/c14n/with-comments/example-3.xml new file mode 100644 index 00000000..a7a1950a --- /dev/null +++ b/test/c14n/with-comments/example-3.xml @@ -0,0 +1,18 @@ +]> + + + + + + + + + + + + + + diff --git a/test/c14n/with-comments/example-4.xml b/test/c14n/with-comments/example-4.xml new file mode 100644 index 00000000..3fba1385 --- /dev/null +++ b/test/c14n/with-comments/example-4.xml @@ -0,0 +1,9 @@ +]> + + First line Second line + 2 + "0" && value<"10" ?"valid":"error"]]> + valid + + + diff --git a/test/c14n/with-comments/example-5.xml b/test/c14n/with-comments/example-5.xml new file mode 100644 index 00000000..92c5322f --- /dev/null +++ b/test/c14n/with-comments/example-5.xml @@ -0,0 +1,12 @@ + + + + + +]> + + &ent1;, &ent2;! + + + diff --git a/test/c14n/with-comments/example-6.xml b/test/c14n/with-comments/example-6.xml new file mode 100644 index 00000000..31e20718 --- /dev/null +++ b/test/c14n/with-comments/example-6.xml @@ -0,0 +1,2 @@ + +© diff --git a/test/c14n/with-comments/example-7.xml b/test/c14n/with-comments/example-7.xml new file mode 100644 index 00000000..41171cb4 --- /dev/null +++ b/test/c14n/with-comments/example-7.xml @@ -0,0 +1,11 @@ + + +]> + + + + + + + diff --git a/test/c14n/with-comments/example-7.xpath b/test/c14n/with-comments/example-7.xpath new file mode 100644 index 00000000..84ddb081 --- /dev/null +++ b/test/c14n/with-comments/example-7.xpath @@ -0,0 +1,10 @@ + + (//.|//@*|//namespace::*) + [ + self::ietf:e1 + or + (parent::ietf:e1 and not(self::text() or self::e2)) + or + count(id("E3")|ancestor-or-self::node()) = count(ancestor-or-self::node()) + ] + \ No newline at end of file diff --git a/test/c14n/with-comments/world.txt b/test/c14n/with-comments/world.txt new file mode 100644 index 00000000..04fea064 --- /dev/null +++ b/test/c14n/with-comments/world.txt @@ -0,0 +1 @@ +world \ No newline at end of file diff --git a/test/c14n/without-comments/doc.dtd b/test/c14n/without-comments/doc.dtd new file mode 100644 index 00000000..e69de29b diff --git a/test/c14n/without-comments/example-1.xml b/test/c14n/without-comments/example-1.xml new file mode 100644 index 00000000..ed450c73 --- /dev/null +++ b/test/c14n/without-comments/example-1.xml @@ -0,0 +1,14 @@ + + + + + + +Hello, world! + + + + + + diff --git a/test/c14n/without-comments/example-2.xml b/test/c14n/without-comments/example-2.xml new file mode 100644 index 00000000..74eeea14 --- /dev/null +++ b/test/c14n/without-comments/example-2.xml @@ -0,0 +1,11 @@ + + + A B + + A + + B + A B + C + + diff --git a/test/c14n/without-comments/example-3.xml b/test/c14n/without-comments/example-3.xml new file mode 100644 index 00000000..a7a1950a --- /dev/null +++ b/test/c14n/without-comments/example-3.xml @@ -0,0 +1,18 @@ +]> + + + + + + + + + + + + + + diff --git a/test/c14n/without-comments/example-4.xml b/test/c14n/without-comments/example-4.xml new file mode 100644 index 00000000..3fba1385 --- /dev/null +++ b/test/c14n/without-comments/example-4.xml @@ -0,0 +1,9 @@ +]> + + First line Second line + 2 + "0" && value<"10" ?"valid":"error"]]> + valid + + + diff --git a/test/c14n/without-comments/example-5.xml b/test/c14n/without-comments/example-5.xml new file mode 100644 index 00000000..92c5322f --- /dev/null +++ b/test/c14n/without-comments/example-5.xml @@ -0,0 +1,12 @@ + + + + + +]> + + &ent1;, &ent2;! + + + diff --git a/test/c14n/without-comments/example-6.xml b/test/c14n/without-comments/example-6.xml new file mode 100644 index 00000000..31e20718 --- /dev/null +++ b/test/c14n/without-comments/example-6.xml @@ -0,0 +1,2 @@ + +© diff --git a/test/c14n/without-comments/example-7.xml b/test/c14n/without-comments/example-7.xml new file mode 100644 index 00000000..41171cb4 --- /dev/null +++ b/test/c14n/without-comments/example-7.xml @@ -0,0 +1,11 @@ + + +]> + + + + + + + diff --git a/test/c14n/without-comments/example-7.xpath b/test/c14n/without-comments/example-7.xpath new file mode 100644 index 00000000..84ddb081 --- /dev/null +++ b/test/c14n/without-comments/example-7.xpath @@ -0,0 +1,10 @@ + + (//.|//@*|//namespace::*) + [ + self::ietf:e1 + or + (parent::ietf:e1 and not(self::text() or self::e2)) + or + count(id("E3")|ancestor-or-self::node()) = count(ancestor-or-self::node()) + ] + \ No newline at end of file diff --git a/test/c14n/without-comments/test-0.xml b/test/c14n/without-comments/test-0.xml new file mode 100644 index 00000000..7e1f9d4f --- /dev/null +++ b/test/c14n/without-comments/test-0.xml @@ -0,0 +1,9 @@ + + + + + + +]> +I am the text. diff --git a/test/c14n/without-comments/test-0.xpath b/test/c14n/without-comments/test-0.xpath new file mode 100644 index 00000000..1fca7bfb --- /dev/null +++ b/test/c14n/without-comments/test-0.xpath @@ -0,0 +1,14 @@ + + + + + + +]> + + (//.|//@*|//namespace::*) + [ + self::text() + ] + diff --git a/test/c14n/without-comments/test-1.xml b/test/c14n/without-comments/test-1.xml new file mode 100644 index 00000000..21566158 --- /dev/null +++ b/test/c14n/without-comments/test-1.xml @@ -0,0 +1,43 @@ + + + + + + +]> + + + + + CN=Merlin Hughes,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE + + + + CN=Test DSA CA,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE + + 970849936 + + + MIIDNzCCAvWgAwIBAgIEOd3+kDAJBgcqhkjOOAQDMFsxCzAJBgNVBAYTAklFMQ8w + DQYDVQQIEwZEdWJsaW4xJTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9sb2dpZXMs + IEx0ZC4xFDASBgNVBAMTC1Rlc3QgRFNBIENBMB4XDTAwMTAwNjE2MzIxNVoXDTAx + MTAwNjE2MzIxNFowXTELMAkGA1UEBhMCSUUxDzANBgNVBAgTBkR1YmxpbjElMCMG + A1UEChMcQmFsdGltb3JlIFRlY2hub2xvZ2llcywgTHRkLjEWMBQGA1UEAxMNTWVy + bGluIEh1Z2hlczCCAbYwggErBgcqhkjOOAQBMIIBHgKBgQDaJjfDTrawMHf8MiUt + Y54b37hSmYNnR3KpGT10uU1Dqppcju06uN0iGbqf947DjkBC25hKnqykK31xBw0E + CPbYq/KC98kghdf2xJCu6B8aqJ95K9jdVflJ3WP7PQxJn+fmM23zy6HYLXVICpfq + etdNj/VHCShZE3bdJiE6VobSFQIVAPQecqS2PaTDprcQnkwx4MHTRXhrAoGAMuGA + lqeB1ax+vyO2+Osubjhl7pHxLu47RIH+/M52DjESA9KMSrwzsYx8yNR2WooByrE0 + t6fu0VncK7UK8olO4t7wpv2z4AFQPRVCKFwo0qgn5aKIkICGMlrRy81avb27wGcW + othx3iPPMtFXtoDqK0JItaI9R8zc1msFhM1GKMYDgYQAAoGActA8YGxrtngg/zKV + vqEOefnwmViFztcnPBYPlJsvh6yKI4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJ + tgJAEto0xAs+Mehuq1DkSFEpP3oDzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LV + lMdwZNFNNJoqMcT2ZfCPrfvYvQ2jRzBFMB4GA1UdEQQXMBWBE21lcmxpbkBiYWx0 + aW1vcmUuaWUwDgYDVR0PAQH/BAQDAgeAMBMGA1UdIwQMMAqACEJZQG0KwRbPMAkG + ByqGSM44BAMDMQAwLgIVAK4skWEFYgrggaJA8vYAwSjg12+KAhUAwHTo7wd4tENw + 9LAKPklQ/74fH18= + + + + \ No newline at end of file diff --git a/test/c14n/without-comments/test-1.xpath b/test/c14n/without-comments/test-1.xpath new file mode 100644 index 00000000..3c11e29b --- /dev/null +++ b/test/c14n/without-comments/test-1.xpath @@ -0,0 +1,14 @@ + + + + + + +]> + + (//.|//@*|//namespace::*) + [ + ancestor-or-self::dsig:X509Data + ] + diff --git a/test/c14n/without-comments/test-2.xml b/test/c14n/without-comments/test-2.xml new file mode 100644 index 00000000..9fda49ed --- /dev/null +++ b/test/c14n/without-comments/test-2.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/test/c14n/without-comments/test-2.xpath b/test/c14n/without-comments/test-2.xpath new file mode 100644 index 00000000..9653bc37 --- /dev/null +++ b/test/c14n/without-comments/test-2.xpath @@ -0,0 +1,8 @@ + + + (//. | //@* | //namespace::*) + [ + ancestor-or-self::n1:elem2 + ] + + \ No newline at end of file diff --git a/test/c14n/without-comments/test-3.xml b/test/c14n/without-comments/test-3.xml new file mode 100644 index 00000000..c7c42d9c --- /dev/null +++ b/test/c14n/without-comments/test-3.xml @@ -0,0 +1,18 @@ +]> + + + + + + + + + + + + + + diff --git a/test/c14n/without-comments/test-3.xpath b/test/c14n/without-comments/test-3.xpath new file mode 100644 index 00000000..faa0070f --- /dev/null +++ b/test/c14n/without-comments/test-3.xpath @@ -0,0 +1,3 @@ + +(//. | //@* | //namespace::*)[ancestor-or-self::e6] + \ No newline at end of file diff --git a/test/c14n/without-comments/world.txt b/test/c14n/without-comments/world.txt new file mode 100644 index 00000000..04fea064 --- /dev/null +++ b/test/c14n/without-comments/world.txt @@ -0,0 +1 @@ +world \ No newline at end of file