From b83ab123bb6ba364e22e3665ffafb44686592de6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 Oct 2009 10:43:59 +0200 Subject: Rework the tests to conform to the uniform interface --- tests/cxx/parser/built-in/driver.cxx | 26 +++ tests/cxx/parser/built-in/makefile | 22 +-- tests/cxx/parser/built-in/test-000.std | 167 +++++++++++++++++++ tests/cxx/parser/built-in/test-000.xml | 199 +++++++++++++++++++++++ tests/cxx/parser/built-in/test-001.std | 167 +++++++++++++++++++ tests/cxx/parser/built-in/test-001.xml | 199 +++++++++++++++++++++++ tests/cxx/parser/built-in/test-long-000.std | 167 ------------------- tests/cxx/parser/built-in/test-long-000.xml | 199 ----------------------- tests/cxx/parser/built-in/test-long-long-000.std | 167 ------------------- tests/cxx/parser/built-in/test-long-long-000.xml | 199 ----------------------- tests/cxx/serializer/built-in/driver.cxx | 43 ++++- tests/cxx/serializer/built-in/makefile | 22 ++- tests/cxx/serializer/built-in/output-long | 13 -- tests/cxx/serializer/built-in/output-long-long | 13 -- tests/cxx/serializer/built-in/test-000.std | 13 ++ tests/cxx/serializer/built-in/test-001.std | 13 ++ 16 files changed, 846 insertions(+), 783 deletions(-) create mode 100644 tests/cxx/parser/built-in/test-000.std create mode 100644 tests/cxx/parser/built-in/test-000.xml create mode 100644 tests/cxx/parser/built-in/test-001.std create mode 100644 tests/cxx/parser/built-in/test-001.xml delete mode 100644 tests/cxx/parser/built-in/test-long-000.std delete mode 100644 tests/cxx/parser/built-in/test-long-000.xml delete mode 100644 tests/cxx/parser/built-in/test-long-long-000.std delete mode 100644 tests/cxx/parser/built-in/test-long-long-000.xml delete mode 100644 tests/cxx/serializer/built-in/output-long delete mode 100644 tests/cxx/serializer/built-in/output-long-long create mode 100644 tests/cxx/serializer/built-in/test-000.std create mode 100644 tests/cxx/serializer/built-in/test-001.std (limited to 'tests') diff --git a/tests/cxx/parser/built-in/driver.cxx b/tests/cxx/parser/built-in/driver.cxx index adaea5a..99c2f63 100644 --- a/tests/cxx/parser/built-in/driver.cxx +++ b/tests/cxx/parser/built-in/driver.cxx @@ -6,7 +6,9 @@ // Test built-in type parsing. // +#include // strlen, strcmp #include +#include #include #include "test-pskel.hxx" @@ -542,6 +544,30 @@ main (int argc, char* argv[]) return 1; } + // Ignore one of the tests depending on whether long long is available. + // + { + char* s = argv[1]; + size_t n = strlen (s); + + if (strcmp (s + n - 12, +#ifdef XSDE_LONGLONG + "test-000.xml" +#else + "test-001.xml" +#endif + ) == 0) + { + s[n - 3] = 's'; + s[n - 2] = 't'; + s[n - 1] = 'd'; + + ifstream ifs (s); + cout << ifs.rdbuf (); + return 0; + } + } + try { any_type_pimpl any_type_p; diff --git a/tests/cxx/parser/built-in/makefile b/tests/cxx/parser/built-in/makefile index 7a30cdb..49eb681 100644 --- a/tests/cxx/parser/built-in/makefile +++ b/tests/cxx/parser/built-in/makefile @@ -8,6 +8,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make xsd := test.xsd cxx := driver.cxx +tests := 000 001 + obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o)) dep := $(obj:.o=.o.d) @@ -38,17 +40,17 @@ $(call include-dep,$(dep)) $(out_base)/: $(driver) -# Test. +# Test. 000 - long, 001 - long long; the test driver ignores one. # -$(test): driver := $(driver) - -ifeq ($(xsde_longlong),y) -$(test): $(driver) $(src_base)/test-long-long-000.xml $(src_base)/test-long-long-000.std - $(call message,test $$1,$$1 $(src_base)/test-long-long-000.xml | diff -u $(src_base)/test-long-long-000.std -,$(driver)) -else -$(test): $(driver) $(src_base)/test-long-000.xml $(src_base)/test-long-000.std - $(call message,test $$1,$$1 $(src_base)/test-long-000.xml | diff -u $(src_base)/test-long-000.std -,$(driver)) -endif +test_targets := $(addprefix $(out_base)/.test-,$(tests)) + +$(test): $(test_targets) +$(test_targets): driver := $(driver) + +.PHONY: $(out_base)/.test-% +$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std + $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) + # Clean. # diff --git a/tests/cxx/parser/built-in/test-000.std b/tests/cxx/parser/built-in/test-000.std new file mode 100644 index 0000000..f3526bc --- /dev/null +++ b/tests/cxx/parser/built-in/test-000.std @@ -0,0 +1,167 @@ +{ + any attribute x = 'x' + any text: ' +' + any text: ' ' + start any element 'a' + any text: 'a' + end any element 'a' + any text: ' +' + any text: ' ' + start any element 'any-type' + any attribute x = 'xxx' + any text: 'aaa' + start any element 'a' + any text: 'bbb' + end any element 'a' + any text: 'ccc' + end any element 'any-type' + any text: ' +' + any text: ' ' +} + +{ + any text: '123abc' +} + +1 +0 +1 +0 +0 +127 +-128 +123 +0 +255 +123 +0 +32767 +-32768 +-12345 +0 +65535 +12345 +0 +2147483647 +-2147483648 +-1234567890 +0 +4294967295 +1234567890 +0 +2147483647 +-2147483648 +-1234567890 +0 +4294967295 +1234567890 +0 +2147483647 +-2147483648 +-1234567890 +-2147483648 +-1234567890 +0 +-2147483648 +-1234567890 +4294967295 +1234567890 +0 +4294967295 +1234567890 +0 +0 +-0 +inf +-inf +nan +123.567 +123.567 +-1.23567e+07 +-4.5e-06 +0 +0 +-0 +inf +-inf +nan +123.567 +123.567 +-1.23567e+07 +-4.5e-06 +0 +0 +-0 +123.567 +123.567 +-123.567 +'string space +newline + ' +' string space newline ' +'string space newline' +'as123:345-.abs' +'1as123:345-.abs' +'abc 123 ' +'as123_345-.abs' +'as123_345-.abs' +'abc' +'a123' +'as123_345-.abs' +'abc a123 ' +'x' +'en' +'en-us' +'one-two-three-four44-seven77-eight888' +'' +'relative' +'#id' +'http://www.example.com/foo#bar' +':schemaLocation' +'xsi:schemaLocation' +'12345abcjk' +'a' +'ab' +'abc' +'' +'12345abcjk' +12+12:0 +1 +31 +15+0:0 +15-14:0 +10+12:0 +1 +12+0:0 +2007+12:0 +1 +-20000+0:0 +10-28+12:0 +12-31 +1-1+0:0 +2007-12+12:0 +-2007-10 +20007-10+0:0 +-20007-1 +2007-12-26+12:0 +-2007-10-15 +20007-12-31+0:0 +-20007-1-1 +12:46:23.456+12:0 +12:13:14 +12:13:14+0:0 +2007-12-26T12:13:14.123+12:0 +-2007-10-15T12:13:14 +20007-12-31T12:13:14+0:0 +-20007-1-1T12:13:14 +-P2007Y13M32DT25H61M61.123S +P1Y0M0DT0H0M0S +P0Y1M0DT0H0M0S +P0Y0M1DT0H0M0S +P0Y0M0DT1H0M0S +P0Y0M0DT0H1M0S +P0Y0M0DT0H0M1.1S +P1Y0M0DT0H0M1S diff --git a/tests/cxx/parser/built-in/test-000.xml b/tests/cxx/parser/built-in/test-000.xml new file mode 100644 index 0000000..380b0f4 --- /dev/null +++ b/tests/cxx/parser/built-in/test-000.xml @@ -0,0 +1,199 @@ + + + + a + aaabbbccc + + + 123abc + + 1 + 0 + true + false + + 0 + +127 + -128 + 123 + + 0 + 255 + 123 + + 0 + +32767 + -32768 + -12345 + + 0 + 65535 + 12345 + + 0 + +2147483647 + -2147483648 + -1234567890 + + 0 + 4294967295 + 1234567890 + + 0 + +2147483647 + -2147483648 + -1234567890 + + 0 + 4294967295 + 1234567890 + + 0 + +2147483647 + -02147483648 + -1234567890 + + -02147483648 + -1234567890 + + 0 + -02147483648 + -1234567890 + + 4294967295 + +01234567890 + + 0 + 4294967295 + +01234567890 + + 0 + +0 + -0 + INF + -INF + NaN + 123.567 + +123.567 + -123.567e5 + -.45E-5 + + 0 + +0 + -0 + INF + -INF + NaN + 123.567 + +123.567 + -123.567e5 + -.45E-5 + + 0 + +0 + -0 + 123.567 + +123.567 + -123.567 + + string space +newline + + + string space +newline + + + + string space +newline + + + + as123:345-.abs + + 1as123:345-.abs + + abc 123 + + as123_345-.abs + + as123_345-.abs + abc + a123 + + as123_345-.abs + + abc a123 + + x + en + en-us + one-two-three-four44-seven77-eight888 + + + relative + #id + http://www.example.com/foo#bar + + schemaLocation + xsi:schemaLocation + + MTIzND + VhYmNqaw = = + YQ== + YWI= + YWJj + + + 31323334356162636a6b + + ---12+12:00 + ---01 + ---31 + ---15Z + ---15-14:00 + + --10+12:00 + --01 + --12Z + + 2007+12:00 + 0001 + -20000Z + + --10-28+12:00 + --12-31 + --01-01Z + + 2007-12+12:00 + -2007-10 + 20007-10Z + -20007-01 + + 2007-12-26+12:00 + -2007-10-15 + 20007-12-31Z + -20007-01-01 + + + + + + 2007-12-26T12:13:14.123+12:00 + -2007-10-15T12:13:14 + 20007-12-31T12:13:14Z + -20007-01-01T12:13:14 + + -P2007Y13M32DT25H61M61.123S + P1Y + P1M + P1D + PT1H + PT1M + PT1.1S + P1YT1S + + diff --git a/tests/cxx/parser/built-in/test-001.std b/tests/cxx/parser/built-in/test-001.std new file mode 100644 index 0000000..3b80787 --- /dev/null +++ b/tests/cxx/parser/built-in/test-001.std @@ -0,0 +1,167 @@ +{ + any attribute x = 'x' + any text: ' +' + any text: ' ' + start any element 'a' + any text: 'a' + end any element 'a' + any text: ' +' + any text: ' ' + start any element 'any-type' + any attribute x = 'xxx' + any text: 'aaa' + start any element 'a' + any text: 'bbb' + end any element 'a' + any text: 'ccc' + end any element 'any-type' + any text: ' +' + any text: ' ' +} + +{ + any text: '123abc' +} + +1 +0 +1 +0 +0 +127 +-128 +123 +0 +255 +123 +0 +32767 +-32768 +-12345 +0 +65535 +12345 +0 +2147483647 +-2147483648 +-1234567890 +0 +4294967295 +1234567890 +0 +9223372036854775807 +-9223372036854775808 +-1234567890123456789 +0 +18446744073709551615 +12345678901234567890 +0 +2147483647 +-2147483648 +-1234567890 +-2147483648 +-1234567890 +0 +-2147483648 +-1234567890 +4294967295 +1234567890 +0 +4294967295 +1234567890 +0 +0 +-0 +inf +-inf +nan +123.567 +123.567 +-1.23567e+07 +-4.5e-06 +0 +0 +-0 +inf +-inf +nan +123.567 +123.567 +-1.23567e+07 +-4.5e-06 +0 +0 +-0 +123.567 +123.567 +-123.567 +'string space +newline + ' +' string space newline ' +'string space newline' +'as123:345-.abs' +'1as123:345-.abs' +'abc 123 ' +'as123_345-.abs' +'as123_345-.abs' +'abc' +'a123' +'as123_345-.abs' +'abc a123 ' +'x' +'en' +'en-us' +'one-two-three-four44-seven77-eight888' +'' +'relative' +'#id' +'http://www.example.com/foo#bar' +':schemaLocation' +'xsi:schemaLocation' +'12345abcjk' +'a' +'ab' +'abc' +'' +'12345abcjk' +12+12:0 +1 +31 +15+0:0 +15-14:0 +10+12:0 +1 +12+0:0 +2007+12:0 +1 +-20000+0:0 +10-28+12:0 +12-31 +1-1+0:0 +2007-12+12:0 +-2007-10 +20007-10+0:0 +-20007-1 +2007-12-26+12:0 +-2007-10-15 +20007-12-31+0:0 +-20007-1-1 +12:46:23.456+12:0 +12:13:14 +12:13:14+0:0 +2007-12-26T12:13:14.123+12:0 +-2007-10-15T12:13:14 +20007-12-31T12:13:14+0:0 +-20007-1-1T12:13:14 +-P2007Y13M32DT25H61M61.123S +P1Y0M0DT0H0M0S +P0Y1M0DT0H0M0S +P0Y0M1DT0H0M0S +P0Y0M0DT1H0M0S +P0Y0M0DT0H1M0S +P0Y0M0DT0H0M1.1S +P1Y0M0DT0H0M1S diff --git a/tests/cxx/parser/built-in/test-001.xml b/tests/cxx/parser/built-in/test-001.xml new file mode 100644 index 0000000..8d9332a --- /dev/null +++ b/tests/cxx/parser/built-in/test-001.xml @@ -0,0 +1,199 @@ + + + + a + aaabbbccc + + + 123abc + + 1 + 0 + true + false + + 0 + +127 + -128 + 123 + + 0 + 255 + 123 + + 0 + +32767 + -32768 + -12345 + + 0 + 65535 + 12345 + + 0 + +2147483647 + -2147483648 + -1234567890 + + 0 + 4294967295 + 1234567890 + + 0 + +9223372036854775807 + -9223372036854775808 + -1234567890123456789 + + 0 + 18446744073709551615 + 12345678901234567890 + + 0 + +2147483647 + -02147483648 + -1234567890 + + -02147483648 + -1234567890 + + 0 + -02147483648 + -1234567890 + + 4294967295 + +01234567890 + + 0 + 4294967295 + +01234567890 + + 0 + +0 + -0 + INF + -INF + NaN + 123.567 + +123.567 + -123.567e5 + -.45E-5 + + 0 + +0 + -0 + INF + -INF + NaN + 123.567 + +123.567 + -123.567e5 + -.45E-5 + + 0 + +0 + -0 + 123.567 + +123.567 + -123.567 + + string space +newline + + + string space +newline + + + + string space +newline + + + + as123:345-.abs + + 1as123:345-.abs + + abc 123 + + as123_345-.abs + + as123_345-.abs + abc + a123 + + as123_345-.abs + + abc a123 + + x + en + en-us + one-two-three-four44-seven77-eight888 + + + relative + #id + http://www.example.com/foo#bar + + schemaLocation + xsi:schemaLocation + + MTIzND + VhYmNqaw = = + YQ== + YWI= + YWJj + + + 31323334356162636a6b + + ---12+12:00 + ---01 + ---31 + ---15Z + ---15-14:00 + + --10+12:00 + --01 + --12Z + + 2007+12:00 + 0001 + -20000Z + + --10-28+12:00 + --12-31 + --01-01Z + + 2007-12+12:00 + -2007-10 + 20007-10Z + -20007-01 + + 2007-12-26+12:00 + -2007-10-15 + 20007-12-31Z + -20007-01-01 + + + + + + 2007-12-26T12:13:14.123+12:00 + -2007-10-15T12:13:14 + 20007-12-31T12:13:14Z + -20007-01-01T12:13:14 + + -P2007Y13M32DT25H61M61.123S + P1Y + P1M + P1D + PT1H + PT1M + PT1.1S + P1YT1S + + diff --git a/tests/cxx/parser/built-in/test-long-000.std b/tests/cxx/parser/built-in/test-long-000.std deleted file mode 100644 index f3526bc..0000000 --- a/tests/cxx/parser/built-in/test-long-000.std +++ /dev/null @@ -1,167 +0,0 @@ -{ - any attribute x = 'x' - any text: ' -' - any text: ' ' - start any element 'a' - any text: 'a' - end any element 'a' - any text: ' -' - any text: ' ' - start any element 'any-type' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any-type' - any text: ' -' - any text: ' ' -} - -{ - any text: '123abc' -} - -1 -0 -1 -0 -0 -127 --128 -123 -0 -255 -123 -0 -32767 --32768 --12345 -0 -65535 -12345 -0 -2147483647 --2147483648 --1234567890 -0 -4294967295 -1234567890 -0 -2147483647 --2147483648 --1234567890 -0 -4294967295 -1234567890 -0 -2147483647 --2147483648 --1234567890 --2147483648 --1234567890 -0 --2147483648 --1234567890 -4294967295 -1234567890 -0 -4294967295 -1234567890 -0 -0 --0 -inf --inf -nan -123.567 -123.567 --1.23567e+07 --4.5e-06 -0 -0 --0 -inf --inf -nan -123.567 -123.567 --1.23567e+07 --4.5e-06 -0 -0 --0 -123.567 -123.567 --123.567 -'string space -newline - ' -' string space newline ' -'string space newline' -'as123:345-.abs' -'1as123:345-.abs' -'abc 123 ' -'as123_345-.abs' -'as123_345-.abs' -'abc' -'a123' -'as123_345-.abs' -'abc a123 ' -'x' -'en' -'en-us' -'one-two-three-four44-seven77-eight888' -'' -'relative' -'#id' -'http://www.example.com/foo#bar' -':schemaLocation' -'xsi:schemaLocation' -'12345abcjk' -'a' -'ab' -'abc' -'' -'12345abcjk' -12+12:0 -1 -31 -15+0:0 -15-14:0 -10+12:0 -1 -12+0:0 -2007+12:0 -1 --20000+0:0 -10-28+12:0 -12-31 -1-1+0:0 -2007-12+12:0 --2007-10 -20007-10+0:0 --20007-1 -2007-12-26+12:0 --2007-10-15 -20007-12-31+0:0 --20007-1-1 -12:46:23.456+12:0 -12:13:14 -12:13:14+0:0 -2007-12-26T12:13:14.123+12:0 --2007-10-15T12:13:14 -20007-12-31T12:13:14+0:0 --20007-1-1T12:13:14 --P2007Y13M32DT25H61M61.123S -P1Y0M0DT0H0M0S -P0Y1M0DT0H0M0S -P0Y0M1DT0H0M0S -P0Y0M0DT1H0M0S -P0Y0M0DT0H1M0S -P0Y0M0DT0H0M1.1S -P1Y0M0DT0H0M1S diff --git a/tests/cxx/parser/built-in/test-long-000.xml b/tests/cxx/parser/built-in/test-long-000.xml deleted file mode 100644 index 380b0f4..0000000 --- a/tests/cxx/parser/built-in/test-long-000.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - a - aaabbbccc - - - 123abc - - 1 - 0 - true - false - - 0 - +127 - -128 - 123 - - 0 - 255 - 123 - - 0 - +32767 - -32768 - -12345 - - 0 - 65535 - 12345 - - 0 - +2147483647 - -2147483648 - -1234567890 - - 0 - 4294967295 - 1234567890 - - 0 - +2147483647 - -2147483648 - -1234567890 - - 0 - 4294967295 - 1234567890 - - 0 - +2147483647 - -02147483648 - -1234567890 - - -02147483648 - -1234567890 - - 0 - -02147483648 - -1234567890 - - 4294967295 - +01234567890 - - 0 - 4294967295 - +01234567890 - - 0 - +0 - -0 - INF - -INF - NaN - 123.567 - +123.567 - -123.567e5 - -.45E-5 - - 0 - +0 - -0 - INF - -INF - NaN - 123.567 - +123.567 - -123.567e5 - -.45E-5 - - 0 - +0 - -0 - 123.567 - +123.567 - -123.567 - - string space -newline - - - string space -newline - - - - string space -newline - - - - as123:345-.abs - - 1as123:345-.abs - - abc 123 - - as123_345-.abs - - as123_345-.abs - abc - a123 - - as123_345-.abs - - abc a123 - - x - en - en-us - one-two-three-four44-seven77-eight888 - - - relative - #id - http://www.example.com/foo#bar - - schemaLocation - xsi:schemaLocation - - MTIzND - VhYmNqaw = = - YQ== - YWI= - YWJj - - - 31323334356162636a6b - - ---12+12:00 - ---01 - ---31 - ---15Z - ---15-14:00 - - --10+12:00 - --01 - --12Z - - 2007+12:00 - 0001 - -20000Z - - --10-28+12:00 - --12-31 - --01-01Z - - 2007-12+12:00 - -2007-10 - 20007-10Z - -20007-01 - - 2007-12-26+12:00 - -2007-10-15 - 20007-12-31Z - -20007-01-01 - - - - - - 2007-12-26T12:13:14.123+12:00 - -2007-10-15T12:13:14 - 20007-12-31T12:13:14Z - -20007-01-01T12:13:14 - - -P2007Y13M32DT25H61M61.123S - P1Y - P1M - P1D - PT1H - PT1M - PT1.1S - P1YT1S - - diff --git a/tests/cxx/parser/built-in/test-long-long-000.std b/tests/cxx/parser/built-in/test-long-long-000.std deleted file mode 100644 index 3b80787..0000000 --- a/tests/cxx/parser/built-in/test-long-long-000.std +++ /dev/null @@ -1,167 +0,0 @@ -{ - any attribute x = 'x' - any text: ' -' - any text: ' ' - start any element 'a' - any text: 'a' - end any element 'a' - any text: ' -' - any text: ' ' - start any element 'any-type' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any-type' - any text: ' -' - any text: ' ' -} - -{ - any text: '123abc' -} - -1 -0 -1 -0 -0 -127 --128 -123 -0 -255 -123 -0 -32767 --32768 --12345 -0 -65535 -12345 -0 -2147483647 --2147483648 --1234567890 -0 -4294967295 -1234567890 -0 -9223372036854775807 --9223372036854775808 --1234567890123456789 -0 -18446744073709551615 -12345678901234567890 -0 -2147483647 --2147483648 --1234567890 --2147483648 --1234567890 -0 --2147483648 --1234567890 -4294967295 -1234567890 -0 -4294967295 -1234567890 -0 -0 --0 -inf --inf -nan -123.567 -123.567 --1.23567e+07 --4.5e-06 -0 -0 --0 -inf --inf -nan -123.567 -123.567 --1.23567e+07 --4.5e-06 -0 -0 --0 -123.567 -123.567 --123.567 -'string space -newline - ' -' string space newline ' -'string space newline' -'as123:345-.abs' -'1as123:345-.abs' -'abc 123 ' -'as123_345-.abs' -'as123_345-.abs' -'abc' -'a123' -'as123_345-.abs' -'abc a123 ' -'x' -'en' -'en-us' -'one-two-three-four44-seven77-eight888' -'' -'relative' -'#id' -'http://www.example.com/foo#bar' -':schemaLocation' -'xsi:schemaLocation' -'12345abcjk' -'a' -'ab' -'abc' -'' -'12345abcjk' -12+12:0 -1 -31 -15+0:0 -15-14:0 -10+12:0 -1 -12+0:0 -2007+12:0 -1 --20000+0:0 -10-28+12:0 -12-31 -1-1+0:0 -2007-12+12:0 --2007-10 -20007-10+0:0 --20007-1 -2007-12-26+12:0 --2007-10-15 -20007-12-31+0:0 --20007-1-1 -12:46:23.456+12:0 -12:13:14 -12:13:14+0:0 -2007-12-26T12:13:14.123+12:0 --2007-10-15T12:13:14 -20007-12-31T12:13:14+0:0 --20007-1-1T12:13:14 --P2007Y13M32DT25H61M61.123S -P1Y0M0DT0H0M0S -P0Y1M0DT0H0M0S -P0Y0M1DT0H0M0S -P0Y0M0DT1H0M0S -P0Y0M0DT0H1M0S -P0Y0M0DT0H0M1.1S -P1Y0M0DT0H0M1S diff --git a/tests/cxx/parser/built-in/test-long-long-000.xml b/tests/cxx/parser/built-in/test-long-long-000.xml deleted file mode 100644 index 8d9332a..0000000 --- a/tests/cxx/parser/built-in/test-long-long-000.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - a - aaabbbccc - - - 123abc - - 1 - 0 - true - false - - 0 - +127 - -128 - 123 - - 0 - 255 - 123 - - 0 - +32767 - -32768 - -12345 - - 0 - 65535 - 12345 - - 0 - +2147483647 - -2147483648 - -1234567890 - - 0 - 4294967295 - 1234567890 - - 0 - +9223372036854775807 - -9223372036854775808 - -1234567890123456789 - - 0 - 18446744073709551615 - 12345678901234567890 - - 0 - +2147483647 - -02147483648 - -1234567890 - - -02147483648 - -1234567890 - - 0 - -02147483648 - -1234567890 - - 4294967295 - +01234567890 - - 0 - 4294967295 - +01234567890 - - 0 - +0 - -0 - INF - -INF - NaN - 123.567 - +123.567 - -123.567e5 - -.45E-5 - - 0 - +0 - -0 - INF - -INF - NaN - 123.567 - +123.567 - -123.567e5 - -.45E-5 - - 0 - +0 - -0 - 123.567 - +123.567 - -123.567 - - string space -newline - - - string space -newline - - - - string space -newline - - - - as123:345-.abs - - 1as123:345-.abs - - abc 123 - - as123_345-.abs - - as123_345-.abs - abc - a123 - - as123_345-.abs - - abc a123 - - x - en - en-us - one-two-three-four44-seven77-eight888 - - - relative - #id - http://www.example.com/foo#bar - - schemaLocation - xsi:schemaLocation - - MTIzND - VhYmNqaw = = - YQ== - YWI= - YWJj - - - 31323334356162636a6b - - ---12+12:00 - ---01 - ---31 - ---15Z - ---15-14:00 - - --10+12:00 - --01 - --12Z - - 2007+12:00 - 0001 - -20000Z - - --10-28+12:00 - --12-31 - --01-01Z - - 2007-12+12:00 - -2007-10 - 20007-10Z - -20007-01 - - 2007-12-26+12:00 - -2007-10-15 - 20007-12-31Z - -20007-01-01 - - - - - - 2007-12-26T12:13:14.123+12:00 - -2007-10-15T12:13:14 - 20007-12-31T12:13:14Z - -20007-01-01T12:13:14 - - -P2007Y13M32DT25H61M61.123S - P1Y - P1M - P1D - PT1H - PT1M - PT1.1S - P1YT1S - - diff --git a/tests/cxx/serializer/built-in/driver.cxx b/tests/cxx/serializer/built-in/driver.cxx index f1d17a1..453fd29 100644 --- a/tests/cxx/serializer/built-in/driver.cxx +++ b/tests/cxx/serializer/built-in/driver.cxx @@ -7,7 +7,8 @@ // #include // strtof, strtod -#include // memcpy +#include // memcpy, strlen, strcmp +#include #include #include "test-sskel.hxx" @@ -481,7 +482,7 @@ struct root_simpl: root_sskel } case 1: { - string_sequence* r = new string_sequence; + string_sequence* r = new string_sequence; r->push_back ("one"); r->push_back ("two"); r->push_back ("three"); @@ -544,13 +545,13 @@ struct root_simpl: root_sskel { case 0: { - string_sequence* r = new string_sequence; + string_sequence* r = new string_sequence; r->push_back ("one"); return r; } case 1: { - string_sequence* r = new string_sequence; + string_sequence* r = new string_sequence; r->push_back ("two"); r->push_back ("three"); return r; @@ -1190,8 +1191,38 @@ private: }; int -main () +main (int argc, char* argv[]) { + if (argc != 2) + { + cerr << "usage: " << argv[0] << " " << endl; + return 1; + } + + // Ignore one of the tests depending on whether long long is available. + // + { + char* s = argv[1]; + size_t n = strlen (s); + + if (strcmp (s + n - 12, +#ifdef XSDE_LONGLONG + "test-000.xml" +#else + "test-001.xml" +#endif + ) == 0) + { + s[n - 3] = 's'; + s[n - 2] = 't'; + s[n - 1] = 'd'; + + ifstream ifs (s); + cout << ifs.rdbuf (); + return 0; + } + } + any_type_simpl any_type_s; any_simple_type_simpl any_simple_type_s; @@ -1231,7 +1262,7 @@ main () #ifdef XSDE_STL xml_schema::qname_simpl qname_s; #else - xml_schema::qname_simpl qname_s (true); + xml_schema::qname_simpl qname_s (true); #endif xml_schema::idrefs_simpl idrefs_s (true); diff --git a/tests/cxx/serializer/built-in/makefile b/tests/cxx/serializer/built-in/makefile index ba93a6d..c0f3c84 100644 --- a/tests/cxx/serializer/built-in/makefile +++ b/tests/cxx/serializer/built-in/makefile @@ -8,6 +8,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make xsd := test.xsd cxx := driver.cxx +tests := 000 001 + obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-sskel.o)) dep := $(obj:.o=.o.d) @@ -40,15 +42,17 @@ $(out_base)/: $(driver) # Test. # -$(test): driver := $(driver) - -ifeq ($(xsde_longlong),y) -$(test): $(driver) $(src_base)/output-long-long - $(call message,test $$1,$$1 | diff -u $(src_base)/output-long-long -,$(driver)) -else -$(test): $(driver) $(src_base)/output-long - $(call message,test $$1,$$1 | diff -u $(src_base)/output-long -,$(driver)) -endif +# Test. 000 - long, 001 - long long; the test driver ignores one. The +# input files do not exist. +# +test_targets := $(addprefix $(out_base)/.test-,$(tests)) + +$(test): $(test_targets) +$(test_targets): driver := $(driver) + +.PHONY: $(out_base)/.test-% +$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.std + $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) # Clean. diff --git a/tests/cxx/serializer/built-in/output-long b/tests/cxx/serializer/built-in/output-long deleted file mode 100644 index 7333c2d..0000000 --- a/tests/cxx/serializer/built-in/output-long +++ /dev/null @@ -1,13 +0,0 @@ -hellohellotruefalse-128-12301270123255-32768-1234503276701234565535-2147483648-123456789002147483647012345678904294967295-2147483648-123456789002147483647012345678904294967295-2147483648-123456789002147483647-2147483648-1234567890-2147483648-1234567890012345678904294967295012345678904294967295INF-INFNaN01-1123.567-1.23567e+07-4.5e-06INF-INFNaN01-1123.56789-12356789000-4.5e-0601-1123.567890000000006-123.567890000000006 test - string test normalized stringtest tokenas123:345-.abs1as123:345-.absoneone two threeas123_345-.absas123_345-.absonetwothreeas123_345-.absonetwo threeen-ushttp://www.example.com/foo#barg1:qnameqnameMTIzNDVhYmNqaw== -YQ== -YWI= -YWJj -AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4 -OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx -cnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmq -q6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj -5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/wABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhsc -HR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RV -VldY -31323334356162636A6B000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758---23---31+02:30---15Z--06--12+02:302007-2007-02:30--06-15--12-31+02:302007-10-2007-12-02:302007-06-15-2007-12-31-02:302007-06-15T12:30:30-2007-12-31T23:59:59.55-02:30P1Y-P1MP1D-PT1HPT1M-PT1.1SP1Y2M3DT4H5M6.7S \ No newline at end of file diff --git a/tests/cxx/serializer/built-in/output-long-long b/tests/cxx/serializer/built-in/output-long-long deleted file mode 100644 index b0f36cc..0000000 --- a/tests/cxx/serializer/built-in/output-long-long +++ /dev/null @@ -1,13 +0,0 @@ -hellohellotruefalse-128-12301270123255-32768-1234503276701234565535-2147483648-123456789002147483647012345678904294967295-9223372036854775808-12345678901234567890922337203685477580701234567890123456789018446744073709551615-2147483648-123456789002147483647-2147483648-1234567890-2147483648-1234567890012345678904294967295012345678904294967295INF-INFNaN01-1123.567-1.23567e+07-4.5e-06INF-INFNaN01-1123.56789-12356789000-4.5e-0601-1123.567890000000006-123.567890000000006 test - string test normalized stringtest tokenas123:345-.abs1as123:345-.absoneone two threeas123_345-.absas123_345-.absonetwothreeas123_345-.absonetwo threeen-ushttp://www.example.com/foo#barg1:qnameqnameMTIzNDVhYmNqaw== -YQ== -YWI= -YWJj -AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4 -OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx -cnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmq -q6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj -5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/wABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhsc -HR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RV -VldY -31323334356162636A6B000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758---23---31+02:30---15Z--06--12+02:302007-2007-02:30--06-15--12-31+02:302007-10-2007-12-02:302007-06-15-2007-12-31-02:302007-06-15T12:30:30-2007-12-31T23:59:59.55-02:30P1Y-P1MP1D-PT1HPT1M-PT1.1SP1Y2M3DT4H5M6.7S \ No newline at end of file diff --git a/tests/cxx/serializer/built-in/test-000.std b/tests/cxx/serializer/built-in/test-000.std new file mode 100644 index 0000000..7333c2d --- /dev/null +++ b/tests/cxx/serializer/built-in/test-000.std @@ -0,0 +1,13 @@ +hellohellotruefalse-128-12301270123255-32768-1234503276701234565535-2147483648-123456789002147483647012345678904294967295-2147483648-123456789002147483647012345678904294967295-2147483648-123456789002147483647-2147483648-1234567890-2147483648-1234567890012345678904294967295012345678904294967295INF-INFNaN01-1123.567-1.23567e+07-4.5e-06INF-INFNaN01-1123.56789-12356789000-4.5e-0601-1123.567890000000006-123.567890000000006 test + string test normalized stringtest tokenas123:345-.abs1as123:345-.absoneone two threeas123_345-.absas123_345-.absonetwothreeas123_345-.absonetwo threeen-ushttp://www.example.com/foo#barg1:qnameqnameMTIzNDVhYmNqaw== +YQ== +YWI= +YWJj +AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4 +OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx +cnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmq +q6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj +5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/wABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhsc +HR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RV +VldY +31323334356162636A6B000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758---23---31+02:30---15Z--06--12+02:302007-2007-02:30--06-15--12-31+02:302007-10-2007-12-02:302007-06-15-2007-12-31-02:302007-06-15T12:30:30-2007-12-31T23:59:59.55-02:30P1Y-P1MP1D-PT1HPT1M-PT1.1SP1Y2M3DT4H5M6.7S \ No newline at end of file diff --git a/tests/cxx/serializer/built-in/test-001.std b/tests/cxx/serializer/built-in/test-001.std new file mode 100644 index 0000000..b0f36cc --- /dev/null +++ b/tests/cxx/serializer/built-in/test-001.std @@ -0,0 +1,13 @@ +hellohellotruefalse-128-12301270123255-32768-1234503276701234565535-2147483648-123456789002147483647012345678904294967295-9223372036854775808-12345678901234567890922337203685477580701234567890123456789018446744073709551615-2147483648-123456789002147483647-2147483648-1234567890-2147483648-1234567890012345678904294967295012345678904294967295INF-INFNaN01-1123.567-1.23567e+07-4.5e-06INF-INFNaN01-1123.56789-12356789000-4.5e-0601-1123.567890000000006-123.567890000000006 test + string test normalized stringtest tokenas123:345-.abs1as123:345-.absoneone two threeas123_345-.absas123_345-.absonetwothreeas123_345-.absonetwo threeen-ushttp://www.example.com/foo#barg1:qnameqnameMTIzNDVhYmNqaw== +YQ== +YWI= +YWJj +AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4 +OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx +cnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmq +q6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj +5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/wABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhsc +HR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RV +VldY +31323334356162636A6B000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758---23---31+02:30---15Z--06--12+02:302007-2007-02:30--06-15--12-31+02:302007-10-2007-12-02:302007-06-15-2007-12-31-02:302007-06-15T12:30:30-2007-12-31T23:59:59.55-02:30P1Y-P1MP1D-PT1HPT1M-PT1.1SP1Y2M3DT4H5M6.7S \ No newline at end of file -- cgit v1.1