summaryrefslogtreecommitdiff
path: root/xsd/tests/cxx/tree/complex
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/tests/cxx/tree/complex')
-rw-r--r--xsd/tests/cxx/tree/complex/ctor/driver.cxx53
-rw-r--r--xsd/tests/cxx/tree/complex/ctor/makefile15
-rw-r--r--xsd/tests/cxx/tree/complex/makefile3
3 files changed, 42 insertions, 29 deletions
diff --git a/xsd/tests/cxx/tree/complex/ctor/driver.cxx b/xsd/tests/cxx/tree/complex/ctor/driver.cxx
index 55044a3..8ea8c87 100644
--- a/xsd/tests/cxx/tree/complex/ctor/driver.cxx
+++ b/xsd/tests/cxx/tree/complex/ctor/driver.cxx
@@ -1,6 +1,5 @@
// file : tests/cxx/tree/complex/ctor/driver.cxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC
+// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
// Test generation of varous complex type constructors.
@@ -11,6 +10,13 @@
#include "test.hxx"
+#ifdef XSD_CXX11
+# include <utility> // std::move
+# define XSD_MOVE(x) std::move(x)
+#else
+# define XSD_MOVE(x) x
+#endif
+
using namespace std;
using namespace test;
@@ -64,12 +70,12 @@ main ()
//
e_base b1 (1, "foo", e_complex_type ("bar"));
- auto_ptr<e_complex_type> c2 (new e_complex_type ("bar"));
- e_base b2 (1, "foo", c2);
+ XSD_AUTO_PTR<e_complex_type> c2 (new e_complex_type ("bar"));
+ e_base b2 (1, "foo", XSD_MOVE (c2));
- auto_ptr<e_simple_type> s3 (new e_simple_type ("foo"));
- auto_ptr<e_complex_type> c3 (new e_complex_type ("bar"));
- e_base b3 (1, s3, c3);
+ XSD_AUTO_PTR<e_simple_type> s3 (new e_simple_type ("foo"));
+ XSD_AUTO_PTR<e_complex_type> c3 (new e_complex_type ("bar"));
+ e_base b3 (1, XSD_MOVE (s3), XSD_MOVE (c3));
assert (b1 == b2);
assert (b1 == b3);
@@ -79,15 +85,20 @@ main ()
e_derived d1 (1, "foo", e_complex_type ("bar"),
true, "baz", e_complex_type ("biz"));
- auto_ptr<e_complex_type> c2a (new e_complex_type ("bar"));
- auto_ptr<e_complex_type> c2b (new e_complex_type ("biz"));
- e_derived d2 (1, "foo", c2a, true, "baz", c2b);
-
- auto_ptr<e_simple_type> s3a (new e_simple_type ("foo"));
- auto_ptr<xml_schema::string> s3b (new xml_schema::string ("baz"));
- auto_ptr<e_complex_type> c3a (new e_complex_type ("bar"));
- auto_ptr<e_complex_type> c3b (new e_complex_type ("biz"));
- e_derived d3 (1, s3a, c3a, true, s3b, c3b);
+ XSD_AUTO_PTR<e_complex_type> c2a (new e_complex_type ("bar"));
+ XSD_AUTO_PTR<e_complex_type> c2b (new e_complex_type ("biz"));
+ e_derived d2 (1, "foo", XSD_MOVE (c2a), true, "baz", XSD_MOVE (c2b));
+
+ XSD_AUTO_PTR<e_simple_type> s3a (new e_simple_type ("foo"));
+ XSD_AUTO_PTR<xml_schema::string> s3b (new xml_schema::string ("baz"));
+ XSD_AUTO_PTR<e_complex_type> c3a (new e_complex_type ("bar"));
+ XSD_AUTO_PTR<e_complex_type> c3b (new e_complex_type ("biz"));
+ e_derived d3 (1,
+ XSD_MOVE (s3a),
+ XSD_MOVE (c3a),
+ true,
+ XSD_MOVE (s3b),
+ XSD_MOVE (c3b));
assert (d1 == d2);
assert (d1 == d3);
@@ -99,12 +110,12 @@ main ()
{
f_type f1 (xml_schema::type (), 1, "foo", f_complex_type ("bar"));
- auto_ptr<f_complex_type> c2 (new f_complex_type ("bar"));
- f_type f2 (1, "foo", c2);
+ XSD_AUTO_PTR<f_complex_type> c2 (new f_complex_type ("bar"));
+ f_type f2 (1, "foo", XSD_MOVE (c2));
- auto_ptr<f_simple_type> s3 (new f_simple_type ("foo"));
- auto_ptr<f_complex_type> c3 (new f_complex_type ("bar"));
- f_type f3 (1, s3, c3);
+ XSD_AUTO_PTR<f_simple_type> s3 (new f_simple_type ("foo"));
+ XSD_AUTO_PTR<f_complex_type> c3 (new f_complex_type ("bar"));
+ f_type f3 (1, XSD_MOVE (s3), XSD_MOVE (c3));
assert (f1 == f2);
assert (f1 == f3);
diff --git a/xsd/tests/cxx/tree/complex/ctor/makefile b/xsd/tests/cxx/tree/complex/ctor/makefile
index 66558f5..ffc82b0 100644
--- a/xsd/tests/cxx/tree/complex/ctor/makefile
+++ b/xsd/tests/cxx/tree/complex/ctor/makefile
@@ -1,6 +1,5 @@
# file : tests/cxx/tree/complex/ctor/makefile
-# author : Boris Kolpackov <boris@codesynthesis.com>
-# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC
+# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC
# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make
@@ -27,19 +26,19 @@ $(call import,\
#
$(driver): $(obj) $(xerces_c.l)
-$(obj) $(dep): cpp_options := -I$(src_root)/libxsd
+$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd
$(obj) $(dep): $(xerces_c.l.cpp-options)
genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx)
gen := $(addprefix $(out_base)/,$(genf))
$(gen): xsd := $(out_root)/xsd/xsd
-$(gen): xsd_options := --generate-default-ctor --generate-from-base-ctor \
+$(gen): xsd_options += --generate-default-ctor --generate-from-base-ctor \
--generate-doxygen --generate-polymorphic --polymorphic-type-all \
--generate-comparison
$(gen): $(out_root)/xsd/xsd
-$(call include-dep,$(dep))
+$(call include-dep,$(dep),$(obj),$(gen))
# Convenience alias for default target.
#
@@ -76,8 +75,12 @@ endif
$(call include,$(bld_root)/cxx/o-e.make)
$(call include,$(bld_root)/cxx/cxx-o.make)
$(call include,$(bld_root)/cxx/cxx-d.make)
-$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
+$(call include,$(bld_root)/cxx/standard.make) # cxx_standard
+ifdef cxx_standard
+$(gen): xsd_options += --std $(cxx_standard)
+$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
+endif
# Dependencies.
#
diff --git a/xsd/tests/cxx/tree/complex/makefile b/xsd/tests/cxx/tree/complex/makefile
index a0b3294..db6e6a8 100644
--- a/xsd/tests/cxx/tree/complex/makefile
+++ b/xsd/tests/cxx/tree/complex/makefile
@@ -1,6 +1,5 @@
# file : tests/cxx/tree/complex/makefile
-# author : Boris Kolpackov <boris@codesynthesis.com>
-# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC
+# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC
# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make