summaryrefslogtreecommitdiff
path: root/tests/cxx/tree/polymorphism/comparison
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cxx/tree/polymorphism/comparison')
-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
3 files changed, 14 insertions, 2 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"/>