diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:11 +0100 | 
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:11 +0100 | 
| commit | 4538829ab86b5a1cd4e845e7eab165029c9d6d46 (patch) | |
| tree | bbadf39aed0610c8f8f7b41fefff47773b8ac205 /xsd/tests/cxx/parser/validation/choice | |
| parent | 23d41842168ac1a1580111b9c5c73500ceee3d57 (diff) | |
| parent | aad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (diff) | |
Update upstream source from tag 'upstream/4.2.0'
Update to upstream version '4.2.0'
with Debian dir 1b38df7bbcf313223de3c50107ac0255090fe647
Diffstat (limited to 'xsd/tests/cxx/parser/validation/choice')
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/driver.cxx | 127 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/makefile | 93 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-000.std | 22 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-000.xml | 30 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-001.std | 4 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-001.xml | 10 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-002.std | 11 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-002.xml | 17 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-003.std | 5 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-003.xml | 11 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-004.std | 4 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test-004.xml | 11 | ||||
| -rw-r--r-- | xsd/tests/cxx/parser/validation/choice/test.xsd | 24 | 
13 files changed, 0 insertions, 369 deletions
| diff --git a/xsd/tests/cxx/parser/validation/choice/driver.cxx b/xsd/tests/cxx/parser/validation/choice/driver.cxx deleted file mode 100644 index fd1e651..0000000 --- a/xsd/tests/cxx/parser/validation/choice/driver.cxx +++ /dev/null @@ -1,127 +0,0 @@ -// file      : tests/cxx/parser/validation/choice/driver.cxx -// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC -// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the choice compositor validation. -// - -#include <string> -#include <fstream> -#include <iostream> - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; -using xml_schema::ro_string; - -struct choice_pimpl: choice_pskel -{ -  virtual void -  pre () -  { -    cout << "{" << endl; -  } - -  virtual void -  a (string const& v) -  { -    cout << "  a = " << v << endl; -  } - -  virtual void -  b (string const& v) -  { -    cout << "  b = " << v << endl; -  } - -  virtual void -  c (string const& v) -  { -    cout << "  c = " << v << endl; -  } - -  virtual void -  d (string const& v) -  { -    cout << "  d = " << v << endl; -  } - -  virtual void -  _start_any_element (ro_string const& ns,  -                      ro_string const& name, -		      ro_string const*) -  { -    cout << "  any: " << ns << "#" << name << endl -         << "  {" << endl; -  } - -  virtual void -  _any_characters (ro_string const& v) -  { -    cout << "    chars = " << v << endl; -  } - -  virtual void -  _end_any_element (ro_string const&, ro_string const&) -  { -    cout << "  }" << endl; -  } - -  virtual void -  post_choice () -  { -    cout << "}" << endl -         << endl; -  } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ -  if (argc != 2) -  { -    cerr << "usage: " << argv[0] << " test.xml" << endl; -    return 1; -  } - -  try -  { -    xml_schema::string_pimpl string_p; -    choice_pimpl choice_p; -    type_pimpl type_p; - -    choice_p.parsers (string_p, string_p, string_p, string_p); -    type_p.parsers (choice_p); - -    xml_schema::document doc_p (type_p, "test", "root"); - -    try -    { -      ifstream ifs (argv[1]); -      type_p.pre (); -      doc_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); -      type_p.post_type (); -    } -    catch (xml_schema::exception const& e) -    { -      cout << "  " << e << endl -           << "}" << endl -           << endl; -    } -  } -  catch (xml_schema::exception const& e) -  { -    cerr << e << endl; -    return 1; -  } -  catch (ios_base::failure const&) -  { -    cerr << "io failure" << endl; -    return 1; -  } -} diff --git a/xsd/tests/cxx/parser/validation/choice/makefile b/xsd/tests/cxx/parser/validation/choice/makefile deleted file mode 100644 index ec86590..0000000 --- a/xsd/tests/cxx/parser/validation/choice/makefile +++ /dev/null @@ -1,93 +0,0 @@ -# file      : tests/cxx/parser/validation/choice/makefile -# 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 - -xsd := test.xsd -cxx := driver.cxx - -tests := 000 001 002 003 004 - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.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=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) -gen  := $(addprefix $(out_base)/,$(genf)) - -$(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options += --generate-validation -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std -	$(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) - - -# Clean. -# -$(clean): $(driver).o.clean                                \ -  $(addsuffix .cxx.clean,$(obj))                           \ -  $(addsuffix .cxx.clean,$(dep))                           \ -  $(addprefix $(out_base)/,$(xsd:.xsd=-pskel.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/parser/xsd-cxx.make) -endif - - -# Dependencies. -# -$(call import,$(src_root)/xsd/makefile) diff --git a/xsd/tests/cxx/parser/validation/choice/test-000.std b/xsd/tests/cxx/parser/validation/choice/test-000.std deleted file mode 100644 index 856b7f5..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-000.std +++ /dev/null @@ -1,22 +0,0 @@ -{ -  a = a -  b = b -} - -{ -  c = c -  d = d -  any: other#any -  { -    chars = any -  } -  a = a -} - -{ -  c = c -  d = d -  d = d -  a = a -} - diff --git a/xsd/tests/cxx/parser/validation/choice/test-000.xml b/xsd/tests/cxx/parser/validation/choice/test-000.xml deleted file mode 100644 index 39b9614..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-000.xml +++ /dev/null @@ -1,30 +0,0 @@ -<t:root xmlns:t="test" -        xmlns:o="other" -        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -        xsi:schemaLocation="test test.xsd"> - -  <choice> -    <a>a</a> - -    <b>b</b> -  </choice> - -  <choice> -    <c>c</c> -    <d>d</d> - -    <o:any>any</o:any> - -    <a>a</a> -  </choice> - -  <choice> -    <c>c</c> -    <d>d</d> - -    <d>d</d> - -    <a>a</a> -  </choice> - -</t:root> diff --git a/xsd/tests/cxx/parser/validation/choice/test-001.std b/xsd/tests/cxx/parser/validation/choice/test-001.std deleted file mode 100644 index 8a78666..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-001.std +++ /dev/null @@ -1,4 +0,0 @@ -{ -  :8:12 error: expected element 'a' -} - diff --git a/xsd/tests/cxx/parser/validation/choice/test-001.xml b/xsd/tests/cxx/parser/validation/choice/test-001.xml deleted file mode 100644 index c509e0d..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-001.xml +++ /dev/null @@ -1,10 +0,0 @@ -<t:root xmlns:t="test" -        xmlns:o="other" -        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -        xsi:schemaLocation="test test.xsd"> -	 -  <!-- invalid --> -  <choice> -  </choice> - -</t:root> diff --git a/xsd/tests/cxx/parser/validation/choice/test-002.std b/xsd/tests/cxx/parser/validation/choice/test-002.std deleted file mode 100644 index 1dc1a3a..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-002.std +++ /dev/null @@ -1,11 +0,0 @@ -{ -  c = c -  d = d -  any: other#any -  { -    chars = any -  } -  a = a -  :14:8 error: unexpected element 'b' -} - diff --git a/xsd/tests/cxx/parser/validation/choice/test-002.xml b/xsd/tests/cxx/parser/validation/choice/test-002.xml deleted file mode 100644 index 3b7e663..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-002.xml +++ /dev/null @@ -1,17 +0,0 @@ -<t:root xmlns:t="test" -        xmlns:o="other" -        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -        xsi:schemaLocation="test test.xsd"> - -  <!-- invalid --> -  <choice> -    <c>c</c> -    <d>d</d> - -    <o:any>any</o:any> - -    <a>a</a> -    <b>b</b> -  </choice> - -</t:root> diff --git a/xsd/tests/cxx/parser/validation/choice/test-003.std b/xsd/tests/cxx/parser/validation/choice/test-003.std deleted file mode 100644 index 29d5e44..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-003.std +++ /dev/null @@ -1,5 +0,0 @@ -{ -  c = c -  :9:12 error: expected element 'd' -} - diff --git a/xsd/tests/cxx/parser/validation/choice/test-003.xml b/xsd/tests/cxx/parser/validation/choice/test-003.xml deleted file mode 100644 index ba15c7e..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-003.xml +++ /dev/null @@ -1,11 +0,0 @@ -<t:root xmlns:t="test" -        xmlns:o="other" -        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -        xsi:schemaLocation="test test.xsd"> - -  <!-- invalid --> -  <choice> -    <c>c</c> -  </choice> - -</t:root> diff --git a/xsd/tests/cxx/parser/validation/choice/test-004.std b/xsd/tests/cxx/parser/validation/choice/test-004.std deleted file mode 100644 index 4a7530b..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-004.std +++ /dev/null @@ -1,4 +0,0 @@ -{ -  :8:8 error: expected element 'a' instead of 'x' -} - diff --git a/xsd/tests/cxx/parser/validation/choice/test-004.xml b/xsd/tests/cxx/parser/validation/choice/test-004.xml deleted file mode 100644 index f6960dd..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test-004.xml +++ /dev/null @@ -1,11 +0,0 @@ -<t:root xmlns:t="test" -        xmlns:o="other" -        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -        xsi:schemaLocation="test test.xsd"> - -  <!-- invalid --> -  <choice> -    <x>x</x> -  </choice> - -</t:root> diff --git a/xsd/tests/cxx/parser/validation/choice/test.xsd b/xsd/tests/cxx/parser/validation/choice/test.xsd deleted file mode 100644 index 8132bbb..0000000 --- a/xsd/tests/cxx/parser/validation/choice/test.xsd +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0"?> -<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> - -  <complexType name="choice"> -    <choice maxOccurs="3"> -      <element name="a" type="string"/> -      <element name="b" type="string" maxOccurs="unbounded"/> -      <sequence> -        <element name="c" type="string" minOccurs="0"/> -	<element name="d" type="string"/> -      </sequence> -      <any namespace="other" maxOccurs="unbounded"/> -    </choice> -  </complexType> - -  <complexType name="type"> -    <sequence> -      <element name="choice" type="t:choice" maxOccurs="unbounded"/> -    </sequence> -  </complexType> - -  <element name="root" type="t:type"/> - -</schema> | 
