From a8ce5c380c69539fe0c7c62c397634d9d0c9fde2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- tests/cxx/tree/containment/driver.cxx | 118 ---------------------------------- tests/cxx/tree/containment/makefile | 85 ------------------------ tests/cxx/tree/containment/test.xsd | 59 ----------------- 3 files changed, 262 deletions(-) delete mode 100644 tests/cxx/tree/containment/driver.cxx delete mode 100644 tests/cxx/tree/containment/makefile delete mode 100644 tests/cxx/tree/containment/test.xsd (limited to 'tests/cxx/tree/containment') diff --git a/tests/cxx/tree/containment/driver.cxx b/tests/cxx/tree/containment/driver.cxx deleted file mode 100644 index 954b76b..0000000 --- a/tests/cxx/tree/containment/driver.cxx +++ /dev/null @@ -1,118 +0,0 @@ -// file : tests/cxx/tree/containment/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test tree node containment. -// - -#include // std::auto_ptr/unique_ptr -#include - -#include "test.hxx" - -#ifdef XSD_CXX11 -# include // std::move -# define XSD_MOVE(x) std::move(x) -#else -# define XSD_MOVE(x) x -#endif - -using namespace std; -using namespace test; - -int -main () -{ - // Change of a container in a sub-tree without ID. - // - { - XSD_AUTO_PTR i (new inner ()); - i->ref ("foo"); - - outer o; - o.i (XSD_MOVE (i)); - o.ref ("foo"); - - assert (o.i ()->ref ()->get () == 0); - assert (o.ref ()->get () == 0); - } - - // Change of container in a sub-tree with ID inside. - // - { - XSD_AUTO_PTR i (new inner ()); - inner* p (i.get ()); - i->id ("foo"); - i->ref ("foo"); - assert (i->ref ()->get () == p); - - outer o; - o.i (XSD_MOVE (i)); - o.ref ("foo"); - - assert (o.i ()->ref ()->get () == p); - assert (o.ref ()->get () == p); - } - - // Change of a container in ID. - // - { - XSD_AUTO_PTR id (new xml_schema::id ("foo")); - - inner i; - i.id (XSD_MOVE (id)); - i.ref ("foo"); - assert (i.ref ()->get () == &i); - } - - // Change of a container in a type derived from ID with ID inside. - // - { - XSD_AUTO_PTR id (new id_ex ("foo")); - id_ex* p (id.get ()); - id->id ("bar"); - - inner i; - i.id_ex (XSD_MOVE (id)); - - i.ref ("foo"); - assert (i.ref ()->get () == &i); - - i.ref ("bar"); - assert (i.ref ()->get () == p); - } - - // IDREF lists - // - { - id i1 ("a"), i2 ("b"); - - XSD_AUTO_PTR ic (new ids); - ic->id ().push_back (i1); - ic->id ().push_back (i2); - - XSD_AUTO_PTR r1 (new xml_schema::idrefs); - r1->push_back (xml_schema::idref ("a")); - r1->push_back (xml_schema::idref ("b")); - - XSD_AUTO_PTR r2 (new idref_list); - r2->push_back (xml_schema::idref ("a")); - r2->push_back (xml_schema::idref ("b")); - - XSD_AUTO_PTR rc1 (new idrefs1); - XSD_AUTO_PTR rc2 (new idrefs2); - - rc1->idrefs (XSD_MOVE (r1)); - rc2->idrefs (XSD_MOVE (r2)); - - model m; - m.ids (XSD_MOVE (ic)); - m.idrefs1 (XSD_MOVE (rc1)); - m.idrefs2 (XSD_MOVE (rc2)); - - assert (m.idrefs1 ().idrefs ()[0].get () != 0); - assert (m.idrefs1 ().idrefs ()[1].get () != 0); - - assert (m.idrefs2 ().idrefs ()[0].get () != 0); - assert (m.idrefs2 ().idrefs ()[1].get () != 0); - } -} diff --git a/tests/cxx/tree/containment/makefile b/tests/cxx/tree/containment/makefile deleted file mode 100644 index dc7ca7b..0000000 --- a/tests/cxx/tree/containment/makefile +++ /dev/null @@ -1,85 +0,0 @@ -# file : tests/cxx/tree/containment/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o)) -dep := $(obj:.o=.o.d) - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - - -# Import. -# -$(call import,\ - $(scf_root)/import/libxerces-c/stub.make,\ - l: xerces_c.l,cpp-options: xerces_c.l.cpp-options) - - -# Build. -# -$(driver): $(obj) $(xerces_c.l) - -$(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 -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) \ - $(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(gen): | $(out_base)/.gitignore -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(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,$(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. -# -$(call import,$(src_root)/xsd/makefile) diff --git a/tests/cxx/tree/containment/test.xsd b/tests/cxx/tree/containment/test.xsd deleted file mode 100644 index 72c9379..0000000 --- a/tests/cxx/tree/containment/test.xsd +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.1