summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-08-18 17:51:09 (GMT)
committerBrad King <brad.king@kitware.com>2015-08-18 19:12:17 (GMT)
commit1932cf268d410f9b9f60374de0a5a65147ee0849 (patch)
treeea0619fe5d4c7f347161119c65c6323dba0e4de5
parent5332497fc15af20f19c7ce19766a78aae926a0d0 (diff)
downloadCastXML-1932cf268d410f9b9f60374de0a5a65147ee0849.zip
CastXML-1932cf268d410f9b9f60374de0a5a65147ee0849.tar.gz
CastXML-1932cf268d410f9b9f60374de0a5a65147ee0849.tar.bz2
test: Add tests for Constructor, Destructor, and Converter elements
-rw-r--r--test/CMakeLists.txt3
-rw-r--r--test/expect/gccxml.any.Constructor.xml.txt17
-rw-r--r--test/expect/gccxml.any.Converter.xml.txt19
-rw-r--r--test/expect/gccxml.any.Destructor.xml.txt17
-rw-r--r--test/input/Constructor.cxx3
-rw-r--r--test/input/Converter.cxx3
-rw-r--r--test/input/Destructor.cxx3
7 files changed, 65 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d71d3e1..23e956d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -191,7 +191,10 @@ castxml_test_gccxml(Class-template-friends)
castxml_test_gccxml(Class-template-member-Typedef)
castxml_test_gccxml(Class-template-member-Typedef-const)
castxml_test_gccxml(Class-template-member-template)
+castxml_test_gccxml(Constructor)
+castxml_test_gccxml(Converter)
castxml_test_gccxml(CvQualifiedType)
+castxml_test_gccxml(Destructor)
castxml_test_gccxml(Enumeration)
castxml_test_gccxml(Enumeration-anonymous)
castxml_test_gccxml(Field)
diff --git a/test/expect/gccxml.any.Constructor.xml.txt b/test/expect/gccxml.any.Constructor.xml.txt
new file mode 100644
index 0000000..4aec461
--- /dev/null
+++ b/test/expect/gccxml.any.Constructor.xml.txt
@@ -0,0 +1,17 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6" size="[0-9]+" align="[0-9]+"/>
+ <Constructor id="_3" name="start" context="_1" access="private" location="f1:2" file="f1" line="2"/>
+ <Constructor id="_4" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_7" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_5" name="=" returns="_8" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_7" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <ReferenceType id="_7" type="_1c"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <ReferenceType id="_8" type="_1"/>
+ <Namespace id="_2" name="::"/>
+ <File id="f1" name=".*/test/input/Constructor.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Converter.xml.txt b/test/expect/gccxml.any.Converter.xml.txt
new file mode 100644
index 0000000..0c563a3
--- /dev/null
+++ b/test/expect/gccxml.any.Converter.xml.txt
@@ -0,0 +1,19 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6 _7" size="[0-9]+" align="[0-9]+"/>
+ <Converter id="_3" returns="_8" context="_1" access="private" location="f1:2" file="f1" line="2" mangled="[^"]+"/>
+ <Constructor id="_4" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_9" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_6" name="=" returns="_10" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_9" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_7" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <FundamentalType id="_8" name="int" size="[0-9]+" align="[0-9]+"/>
+ <ReferenceType id="_9" type="_1c"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <ReferenceType id="_10" type="_1"/>
+ <Namespace id="_2" name="::"/>
+ <File id="f1" name=".*/test/input/Converter.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Destructor.xml.txt b/test/expect/gccxml.any.Destructor.xml.txt
new file mode 100644
index 0000000..130b197
--- /dev/null
+++ b/test/expect/gccxml.any.Destructor.xml.txt
@@ -0,0 +1,17 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6" size="[0-9]+" align="[0-9]+"/>
+ <Destructor id="_3" name="start" context="_1" access="private" location="f1:2" file="f1" line="2"/>
+ <Constructor id="_4" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_7" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_6" name="=" returns="_8" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_7" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <ReferenceType id="_7" type="_1c"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <ReferenceType id="_8" type="_1"/>
+ <Namespace id="_2" name="::"/>
+ <File id="f1" name=".*/test/input/Destructor.cxx"/>
+</GCC_XML>$
diff --git a/test/input/Constructor.cxx b/test/input/Constructor.cxx
new file mode 100644
index 0000000..e6e7948
--- /dev/null
+++ b/test/input/Constructor.cxx
@@ -0,0 +1,3 @@
+class start {
+ start();
+};
diff --git a/test/input/Converter.cxx b/test/input/Converter.cxx
new file mode 100644
index 0000000..64bad53
--- /dev/null
+++ b/test/input/Converter.cxx
@@ -0,0 +1,3 @@
+class start {
+ operator int();
+};
diff --git a/test/input/Destructor.cxx b/test/input/Destructor.cxx
new file mode 100644
index 0000000..6a42e1a
--- /dev/null
+++ b/test/input/Destructor.cxx
@@ -0,0 +1,3 @@
+class start {
+ ~start();
+};