aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-10-14 12:21:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-10-14 12:21:35 +0200
commitb7197929af1cca15e490703ba3632ae52a348b60 (patch)
treee4ed9dc7cf2021d6ad398fade7fc8148ff982b16 /tests
parent6f395f9f769866a04f6949cb7ed14f93d90cf728 (diff)
New mapping for anyType with support for polymorphism
Diffstat (limited to 'tests')
-rw-r--r--tests/cxx/hybrid/polymorphism/any-type/driver.cxx2
-rw-r--r--tests/cxx/hybrid/polymorphism/any-type/test-000.std15
-rw-r--r--tests/cxx/hybrid/polymorphism/any-type/test-000.xml27
-rw-r--r--tests/cxx/hybrid/polymorphism/any-type/test.xsd2
-rw-r--r--tests/cxx/hybrid/polymorphism/makefile4
5 files changed, 44 insertions, 6 deletions
diff --git a/tests/cxx/hybrid/polymorphism/any-type/driver.cxx b/tests/cxx/hybrid/polymorphism/any-type/driver.cxx
index bfea16f..cf39e15 100644
--- a/tests/cxx/hybrid/polymorphism/any-type/driver.cxx
+++ b/tests/cxx/hybrid/polymorphism/any-type/driver.cxx
@@ -52,7 +52,7 @@ main (int argc, char* argv[])
doc_s.add_prefix ("xsi", "http://www.w3.org/2001/XMLSchema-instance");
root_s.pre (*r);
- doc_s.serialize (cout);
+ doc_s.serialize (cout, xml_schema::document_simpl::pretty_print);
root_s.post ();
delete r;
diff --git a/tests/cxx/hybrid/polymorphism/any-type/test-000.std b/tests/cxx/hybrid/polymorphism/any-type/test-000.std
new file mode 100644
index 0000000..0c40a51
--- /dev/null
+++ b/tests/cxx/hybrid/polymorphism/any-type/test-000.std
@@ -0,0 +1,15 @@
+<t:root xmlns:t="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <t:any></t:any>
+ <t:any></t:any>
+ <t:base x="abc">
+ <a>123</a>
+ <b>abc</b>
+ </t:base>
+ <t:any x="xyz" xsi:type="t:derived">
+ <a>123</a>
+ <b>abc</b>
+ <c>9</c>
+ <c>8</c>
+ <c>7</c>
+ </t:any>
+</t:root> \ No newline at end of file
diff --git a/tests/cxx/hybrid/polymorphism/any-type/test-000.xml b/tests/cxx/hybrid/polymorphism/any-type/test-000.xml
index f0a8bcb..7a6563c 100644
--- a/tests/cxx/hybrid/polymorphism/any-type/test-000.xml
+++ b/tests/cxx/hybrid/polymorphism/any-type/test-000.xml
@@ -1,7 +1,28 @@
<t:root xmlns:t="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <t:any><x>abc</x>junk<y>123</y></t:any>
- <t:base ><a>123</a><b>abc</b></t:base>
- <t:any xsi:type="t:derived"><a>123</a><b>abc</b><c>9</c><c>8</c><c>7</c></t:any>
+ <t:any>
+ <x>abc</x>
+ junk
+ <y>123</y>
+ </t:any>
+
+ <t:any1>
+ <x>abc</x>
+ junk
+ <y>123</y>
+ </t:any1>
+
+ <t:base x="abc">
+ <a>123</a>
+ <b>abc</b>
+ </t:base>
+
+ <t:any x="xyz" xsi:type="t:derived">
+ <a>123</a>
+ <b>abc</b>
+ <c>9</c>
+ <c>8</c>
+ <c>7</c>
+ </t:any>
</t:root>
diff --git a/tests/cxx/hybrid/polymorphism/any-type/test.xsd b/tests/cxx/hybrid/polymorphism/any-type/test.xsd
index 33b5251..ab35171 100644
--- a/tests/cxx/hybrid/polymorphism/any-type/test.xsd
+++ b/tests/cxx/hybrid/polymorphism/any-type/test.xsd
@@ -2,6 +2,7 @@
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">
<element name="any" type="anyType"/>
+ <element name="any1" type="anyType" substitutionGroup="t:any"/>
<complexType name="base">
<complexContent>
@@ -10,6 +11,7 @@
<element name="a" type="int"/>
<element name="b" type="string"/>
</sequence>
+ <attribute name="x" type="string"/>
</restriction>
</complexContent>
</complexType>
diff --git a/tests/cxx/hybrid/polymorphism/makefile b/tests/cxx/hybrid/polymorphism/makefile
index 7523bb2..c418d34 100644
--- a/tests/cxx/hybrid/polymorphism/makefile
+++ b/tests/cxx/hybrid/polymorphism/makefile
@@ -8,12 +8,12 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
# NOTE: remember to update dist/tests/cxx/hybrid/polymorphis/{makefile,
# nmakefile} if you change anything here.
#
-all_tests := enumeration multischema
+all_tests := any-type enumeration multischema
build_tests :=
ifeq ($(xsde_iostream),y)
-build_tests += enumeration multischema
+build_tests += any-type enumeration multischema
endif
default := $(out_base)/