diff options
Diffstat (limited to 'xsd-tests/cxx/tree/list/ctor')
-rw-r--r-- | xsd-tests/cxx/tree/list/ctor/buildfile | 22 | ||||
-rw-r--r-- | xsd-tests/cxx/tree/list/ctor/driver.cxx | 50 | ||||
-rw-r--r-- | xsd-tests/cxx/tree/list/ctor/test.xsd | 18 |
3 files changed, 90 insertions, 0 deletions
diff --git a/xsd-tests/cxx/tree/list/ctor/buildfile b/xsd-tests/cxx/tree/list/ctor/buildfile new file mode 100644 index 0000000..fd79078 --- /dev/null +++ b/xsd-tests/cxx/tree/list/ctor/buildfile @@ -0,0 +1,22 @@ +# file : cxx/tree/list/ctor/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx ixx cxx}{test} $libs + +cxx.poptions =+ "-I$out_base" + +<{hxx ixx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree $xsd_cxx_std \ + --generate-inline \ + --generate-default-ctor \ + --generate-from-base-ctor \ + --generate-doxygen \ + --output-dir $out_base \ + $path($<[0]) +}} diff --git a/xsd-tests/cxx/tree/list/ctor/driver.cxx b/xsd-tests/cxx/tree/list/ctor/driver.cxx new file mode 100644 index 0000000..5673e67 --- /dev/null +++ b/xsd-tests/cxx/tree/list/ctor/driver.cxx @@ -0,0 +1,50 @@ +// file : cxx/tree/list/ctor/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +// Test list constructors. +// +#include <string> + +#include "test.hxx" + +using namespace std; +using namespace test; + +int +main () +{ + // Test ctor() + // + { + string_list sl; + + xml_schema::nmtokens nt; + xml_schema::idrefs id; + } + + // Test ctor(size_type, const X&) + // + { + string_list sl (10, "abc"); + size_type st (10, 123); + + xml_schema::nmtokens nt (10, "abc"); + xml_schema::idrefs id (10, "abc"); + } + + // Test ctor(const I& begin, const I& end) + // + { + string_list sl1 (10, "abc"); + string_list sl2 (sl1.begin (), sl1.end ()); + + I i1 (10, 123); + I i2 (i1.begin (), i1.end ()); + + xml_schema::nmtokens nt1 (10, "abc"); + xml_schema::nmtokens nt2 (nt1.begin (), nt1.end ()); + + xml_schema::idrefs id1 (10, "abc"); + xml_schema::idrefs id2 (id1.begin (), id1.end ()); + } +} diff --git a/xsd-tests/cxx/tree/list/ctor/test.xsd b/xsd-tests/cxx/tree/list/ctor/test.xsd new file mode 100644 index 0000000..f090bb8 --- /dev/null +++ b/xsd-tests/cxx/tree/list/ctor/test.xsd @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <simpleType name="string-list"> + <list itemType="string"/> + </simpleType> + + <!-- Test name conflict resolution. --> + + <simpleType name="size_type"> + <list itemType="int"/> + </simpleType> + + <simpleType name="I"> + <list itemType="int"/> + </simpleType> + +</schema> |