From 5e527213a2430bb3018e5eebd909aef294edf9b5 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/dom-association/dom-parse.cxx | 95 ---------------------------- tests/cxx/tree/dom-association/dom-parse.hxx | 23 ------- tests/cxx/tree/dom-association/driver.cxx | 71 --------------------- tests/cxx/tree/dom-association/makefile | 91 -------------------------- tests/cxx/tree/dom-association/output | 0 tests/cxx/tree/dom-association/test.xml | 7 -- tests/cxx/tree/dom-association/test.xsd | 12 ---- 7 files changed, 299 deletions(-) delete mode 100644 tests/cxx/tree/dom-association/dom-parse.cxx delete mode 100644 tests/cxx/tree/dom-association/dom-parse.hxx delete mode 100644 tests/cxx/tree/dom-association/driver.cxx delete mode 100644 tests/cxx/tree/dom-association/makefile delete mode 100644 tests/cxx/tree/dom-association/output delete mode 100644 tests/cxx/tree/dom-association/test.xml delete mode 100644 tests/cxx/tree/dom-association/test.xsd (limited to 'tests/cxx/tree/dom-association') diff --git a/tests/cxx/tree/dom-association/dom-parse.cxx b/tests/cxx/tree/dom-association/dom-parse.cxx deleted file mode 100644 index 0d26d02..0000000 --- a/tests/cxx/tree/dom-association/dom-parse.cxx +++ /dev/null @@ -1,95 +0,0 @@ -// file : tests/cxx/tree/dom-association/dom-parse.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include "dom-parse.hxx" - -#include - -#include -#include // chLatin_* -#include - -#include -#include - -#include -#include - -using namespace xercesc; -namespace xml = xsd::cxx::xml; -namespace tree = xsd::cxx::tree; - -XSD_DOM_AUTO_PTR -parse (std::istream& is, - const std::string& id, - bool validate) -{ - const XMLCh ls_id [] = {chLatin_L, chLatin_S, chNull}; - - // Get an implementation of the Load-Store (LS) interface. - // - DOMImplementation* impl ( - DOMImplementationRegistry::getDOMImplementation (ls_id)); - - XSD_DOM_AUTO_PTR parser ( - impl->createLSParser (DOMImplementationLS::MODE_SYNCHRONOUS, 0)); - - DOMConfiguration* conf (parser->getDomConfig ()); - - // Discard comment nodes in the document. - // - conf->setParameter (XMLUni::fgDOMComments, false); - - // Enable datatype normalization. - // - conf->setParameter (XMLUni::fgDOMDatatypeNormalization, true); - - // Do not create EntityReference nodes in the DOM tree. No - // EntityReference nodes will be created, only the nodes - // corresponding to their fully expanded substitution text - // will be created. - // - conf->setParameter (XMLUni::fgDOMEntities, false); - - // Perform namespace processing. - // - conf->setParameter (XMLUni::fgDOMNamespaces, true); - - // Do not include ignorable whitespace in the DOM tree. - // - conf->setParameter (XMLUni::fgDOMElementContentWhitespace, false); - - // Enable/Disable validation. - // - conf->setParameter (XMLUni::fgDOMValidate, validate); - conf->setParameter (XMLUni::fgXercesSchema, validate); - conf->setParameter (XMLUni::fgXercesSchemaFullChecking, false); - - // Xerces-C++ 3.1.0 is the first version with working multi import - // support. - // -#if _XERCES_VERSION >= 30100 - conf->setParameter (XMLUni::fgXercesHandleMultipleImports, true); -#endif - - // We will release the DOM document ourselves. - // - conf->setParameter (XMLUni::fgXercesUserAdoptsDOMDocument, true); - - // Set error handler. - // - tree::error_handler eh; - xml::dom::bits::error_handler_proxy ehp (eh); - conf->setParameter (XMLUni::fgDOMErrorHandler, &ehp); - - // Prepare input stream. - // - xml::sax::std_input_source isrc (is, id); - Wrapper4InputSource wrap (&isrc, false); - - XSD_DOM_AUTO_PTR doc (parser->parse (&wrap)); - - eh.throw_if_failed > (); - - return doc; -} diff --git a/tests/cxx/tree/dom-association/dom-parse.hxx b/tests/cxx/tree/dom-association/dom-parse.hxx deleted file mode 100644 index c1c9326..0000000 --- a/tests/cxx/tree/dom-association/dom-parse.hxx +++ /dev/null @@ -1,23 +0,0 @@ -// file : tests/cxx/tree/dom-association/dom-parse.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef DOM_PARSE -#define DOM_PARSE - -#include -#include - -#include - -#include - -// Parse an XML document from the standard input stream with an -// optional resource id. Resource id is used in diagnostics as -// well as to locate schemas referenced from inside the document. -// -XSD_DOM_AUTO_PTR -parse (std::istream& is, - const std::string& id, - bool validate); - -#endif // DOM_PARSE diff --git a/tests/cxx/tree/dom-association/driver.cxx b/tests/cxx/tree/dom-association/driver.cxx deleted file mode 100644 index 44343a3..0000000 --- a/tests/cxx/tree/dom-association/driver.cxx +++ /dev/null @@ -1,71 +0,0 @@ -// file : tests/cxx/tree/dom-association/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test DOM association/ownership. -// - -#include // std::auto_ptr/unique_ptr -#include -#include - -#include - -#include "dom-parse.hxx" -#include "test.hxx" - -using namespace std; -using namespace test; -using namespace xercesc; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - int r (0); - - XMLPlatformUtils::Initialize (); - - try - { - ifstream ifs; - ifs.exceptions (ifstream::badbit | ifstream::failbit); - ifs.open (argv[1]); - - DOMDocument* ptr; - -#ifdef XSD_CXX11 - xml_schema::dom::unique_ptr doc (parse (ifs, argv[1], true)); - ptr = doc.get (); - unique_ptr r ( - root (std::move (doc), - xml_schema::flags::keep_dom | xml_schema::flags::own_dom)); -#else - xml_schema::dom::auto_ptr doc (parse (ifs, argv[1], true)); - ptr = doc.get (); - auto_ptr r ( - root (doc, - xml_schema::flags::keep_dom | xml_schema::flags::own_dom)); -#endif - - assert (doc.get () == 0); - assert (r->_node ()->getOwnerDocument () == ptr); - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - r = 1; - } - catch (const std::ios_base::failure&) - { - cerr << argv[1] << ": unable to open or read failure" << endl; - r = 1; - } - - XMLPlatformUtils::Terminate (); - return r; -} diff --git a/tests/cxx/tree/dom-association/makefile b/tests/cxx/tree/dom-association/makefile deleted file mode 100644 index 6c1f44c..0000000 --- a/tests/cxx/tree/dom-association/makefile +++ /dev/null @@ -1,91 +0,0 @@ -# file : tests/cxx/tree/dom-association/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx dom-parse.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) - -# Define XSD_CXX11 since we include libxsd headers directly. -# -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifeq ($(cxx_standard),c++11) -$(obj) $(dep): cpp_options += -DXSD_CXX11 -endif - -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-ostream -$(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) $(src_base)/test.xml $(src_base)/output - $(call message,test $$1,$$1 $(src_base)/test.xml | diff -u $(src_base)/output -,$(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) - -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/dom-association/output b/tests/cxx/tree/dom-association/output deleted file mode 100644 index e69de29..0000000 diff --git a/tests/cxx/tree/dom-association/test.xml b/tests/cxx/tree/dom-association/test.xml deleted file mode 100644 index 624a80c..0000000 --- a/tests/cxx/tree/dom-association/test.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - a - - diff --git a/tests/cxx/tree/dom-association/test.xsd b/tests/cxx/tree/dom-association/test.xsd deleted file mode 100644 index 07bebc7..0000000 --- a/tests/cxx/tree/dom-association/test.xsd +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - -- cgit v1.1