aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cxx/tree/polymorphism/comparison/driver.cxx12
-rw-r--r--tests/cxx/tree/polymorphism/comparison/makefile2
-rw-r--r--tests/cxx/tree/polymorphism/comparison/test.xsd2
-rw-r--r--tests/cxx/tree/polymorphism/ostream/test.xsd13
4 files changed, 25 insertions, 4 deletions
diff --git a/tests/cxx/tree/polymorphism/comparison/driver.cxx b/tests/cxx/tree/polymorphism/comparison/driver.cxx
index 5394991..d291f6c 100644
--- a/tests/cxx/tree/polymorphism/comparison/driver.cxx
+++ b/tests/cxx/tree/polymorphism/comparison/driver.cxx
@@ -6,6 +6,7 @@
//
#include <memory> // std::auto_ptr/unique_ptr
+#include <sstream>
#include <iostream>
#include "test.hxx"
@@ -65,6 +66,17 @@ main (int argc, char* argv[])
assert (*r != r1);
}
+
+ xml_schema::namespace_infomap map;
+
+ map["t"].name = "test";
+
+ stringstream s;
+ root (s, *r, map);
+
+ XSD_AUTO_PTR<type> c (root (s, xml_schema::flags::dont_validate));
+
+ assert (*r == *c);
}
catch (xml_schema::exception const& e)
{
diff --git a/tests/cxx/tree/polymorphism/comparison/makefile b/tests/cxx/tree/polymorphism/comparison/makefile
index ef3e70a..6ab3e92 100644
--- a/tests/cxx/tree/polymorphism/comparison/makefile
+++ b/tests/cxx/tree/polymorphism/comparison/makefile
@@ -34,7 +34,7 @@ gen := $(addprefix $(out_base)/,$(genf))
$(gen): xsd := $(out_root)/xsd/xsd
$(gen): xsd_options += --generate-polymorphic --polymorphic-type base \
---generate-comparison
+--generate-comparison --generate-serialization
$(gen): $(out_root)/xsd/xsd
$(call include-dep,$(dep),$(obj),$(gen))
diff --git a/tests/cxx/tree/polymorphism/comparison/test.xsd b/tests/cxx/tree/polymorphism/comparison/test.xsd
index 18532f2..364d1b3 100644
--- a/tests/cxx/tree/polymorphism/comparison/test.xsd
+++ b/tests/cxx/tree/polymorphism/comparison/test.xsd
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">
- <complexType name="base">
+ <complexType name="base" abstract="true">
<sequence>
<element name="a" type="string"/>
<element name="fund" type="int"/>
diff --git a/tests/cxx/tree/polymorphism/ostream/test.xsd b/tests/cxx/tree/polymorphism/ostream/test.xsd
index ddeaeae..688cd5a 100644
--- a/tests/cxx/tree/polymorphism/ostream/test.xsd
+++ b/tests/cxx/tree/polymorphism/ostream/test.xsd
@@ -2,12 +2,21 @@
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test"
targetNamespace="test" elementFormDefault="qualified">
- <complexType name="base">
+ <complexType name="abst_base" abstract="1">
<sequence>
<element name="a" type="string"/>
- <element name="fund" type="int"/>
</sequence>
</complexType>
+
+ <complexType name="base">
+ <complexContent>
+ <extension base="t:abst_base">
+ <sequence>
+ <element name="fund" type="int"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
<element name="base" type="t:base"/>
<complexType name="derived1">