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/any-type/driver.cxx | 144 ------------------------------------- 1 file changed, 144 deletions(-) delete mode 100644 tests/cxx/tree/any-type/driver.cxx (limited to 'tests/cxx/tree/any-type/driver.cxx') diff --git a/tests/cxx/tree/any-type/driver.cxx b/tests/cxx/tree/any-type/driver.cxx deleted file mode 100644 index ae81081..0000000 --- a/tests/cxx/tree/any-type/driver.cxx +++ /dev/null @@ -1,144 +0,0 @@ -// file : tests/cxx/tree/any-type/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test anyType and anySimpleType content extraction. -// - -#include // std::auto_ptr/unique_ptr -#include // std::move -#include -#include - -#include -#include - -#include "test.hxx" // Get XSD_CXX11 defined. - -#include - -using namespace std; -using namespace test; -using namespace xercesc; - -namespace xml = xsd::cxx::xml; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - XMLPlatformUtils::Initialize (); - - try - { - // Test parsing - // - XSD_AUTO_PTR r (root (argv[1])); - - // Test API. - // - { - assert (type::a_default_value ().text_content () == "default value"); - } - - { - xml_schema::simple_type x ("fox"); - assert (x.text_content () == "fox"); - x.text_content ("foo"); - assert (x.text_content () == "foo"); - x.text_content ().clear (); - assert (x.text_content () == ""); - x.text_content () = "baz"; - r->s ().push_back (x); - } - - { - xml_schema::type x; - - DOMDocument& doc (x.dom_content_document ()); - - // Copy. - // - DOMElement* e (doc.createElement (xml::string ("dummy").c_str ())); - e->setAttribute (xml::string ("x").c_str (), - xml::string ("foo").c_str ()); - e->setTextContent (xml::string ("data").c_str ()); - x.dom_content ().set (*e); - e->release (); - - r->t ().push_back (x); - } - - { - XSD_AUTO_PTR x (new xml_schema::type); - - DOMDocument& doc (x->dom_content_document ()); - - // Assume ownership. - // - DOMElement* e (doc.createElement (xml::string ("dummy").c_str ())); - e->setAttribute (xml::string ("x").c_str (), - xml::string ("foo").c_str ()); - e->setTextContent (xml::string ("data").c_str ()); - x->dom_content ().set (e); - -#ifdef XSD_CXX11 - r->t ().push_back (std::move (x)); -#else - r->t ().push_back (x); -#endif - } - - // Test printing. - // - cout << *r << endl - << endl; - - // Test serialization. - // - xml_schema::namespace_infomap map; - - map["t"].name = "test"; - map["t"].schema = "test.xsd"; - map["o"].name = "other"; - - stringstream iostr; - root (iostr, *r, map); - - cout << iostr.str () << endl - << endl; - - { - XSD_AUTO_PTR r1 (root (iostr, argv[1])); - - // Xerces-C++ mis-indentation of mixed content messes this up. - // assert (*r == *r); - - stringstream iostr; - root (iostr, *r1, map); - - cout << iostr.str () << endl - << endl; - } - - // Test comparison. - // - assert (*r == *r); - - // Test copy c-tor. - // - type copy (*r); - assert (copy == *r); - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - - XMLPlatformUtils::Terminate (); -} -- cgit v1.1