summaryrefslogtreecommitdiff
path: root/tests/cxx/tree/comparison/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-17 07:15:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-17 07:15:29 +0200
commitf0510d2f90467de8e8f260b47d79a9baaf9bef17 (patch)
tree0b9929946f06a9cbe9b9e8f2a7600dae4e048f79 /tests/cxx/tree/comparison/driver.cxx
Start tracking XSD with git
Diffstat (limited to 'tests/cxx/tree/comparison/driver.cxx')
-rw-r--r--tests/cxx/tree/comparison/driver.cxx40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/cxx/tree/comparison/driver.cxx b/tests/cxx/tree/comparison/driver.cxx
new file mode 100644
index 0000000..eda2b59
--- /dev/null
+++ b/tests/cxx/tree/comparison/driver.cxx
@@ -0,0 +1,40 @@
+// file : tests/cxx/tree/comparison/driver.cxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2006-2009 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+// Test generated comparison operators.
+//
+
+#include <memory> // std::auto_ptr
+#include <iostream>
+
+#include "test.hxx"
+
+using namespace std;
+using namespace test;
+
+int
+main (int argc, char* argv[])
+{
+ if (argc != 2)
+ {
+ cerr << "usage: " << argv[0] << " test.xml" << endl;
+ return 1;
+ }
+
+ try
+ {
+ auto_ptr<type> r (root (argv[1]));
+
+ type::complex_sequence s (r->complex ());
+
+ assert (s[0] == s[0]);
+ assert (s[0] != s[1]);
+ }
+ catch (xml_schema::exception const& e)
+ {
+ cerr << e << endl;
+ return 1;
+ }
+}