summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-10-03 15:31:27 (GMT)
committerBrad King <brad.king@kitware.com>2017-10-03 16:01:15 (GMT)
commitb663caed7c6603a1b3c08d237174789424c00ed0 (patch)
tree100ba4dbad1ed421947efb787f36cd52c9754250 /test
parenta80084fb43452746b52e33bdf2460f9cec3c274b (diff)
downloadCastXML-b663caed7c6603a1b3c08d237174789424c00ed0.zip
CastXML-b663caed7c6603a1b3c08d237174789424c00ed0.tar.gz
CastXML-b663caed7c6603a1b3c08d237174789424c00ed0.tar.bz2
test: Add cases for anonymous struct and union types
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt4
-rw-r--r--test/expect/castxml1.any.Class-member-Struct-anonymous.xml.txt31
-rw-r--r--test/expect/castxml1.any.Class-member-Union-anonymous.xml.txt31
-rw-r--r--test/expect/castxml1.any.Typedef-to-Struct-anonymous.xml.txt8
-rw-r--r--test/expect/castxml1.any.Typedef-to-Union-anonymous.xml.txt8
-rw-r--r--test/expect/gccxml.any.Class-member-Struct-anonymous.xml.txt30
-rw-r--r--test/expect/gccxml.any.Class-member-Union-anonymous.xml.txt30
-rw-r--r--test/expect/gccxml.any.Typedef-to-Struct-anonymous.xml.txt18
-rw-r--r--test/expect/gccxml.any.Typedef-to-Union-anonymous.xml.txt18
-rw-r--r--test/input/Class-member-Struct-anonymous.cxx6
-rw-r--r--test/input/Class-member-Union-anonymous.cxx6
-rw-r--r--test/input/Typedef-to-Struct-anonymous.cxx3
-rw-r--r--test/input/Typedef-to-Union-anonymous.cxx3
13 files changed, 196 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 69b3cce..5e61282 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -361,8 +361,10 @@ castxml_test_output(Class-implicit-member-reference)
castxml_test_output(Class-implicit-members)
castxml_test_output(Class-incomplete)
castxml_test_output(Class-incomplete-twice)
+castxml_test_output(Class-member-Struct-anonymous)
castxml_test_output(Class-member-template)
castxml_test_output(Class-member-template-access)
+castxml_test_output(Class-member-Union-anonymous)
castxml_test_output(Class-partial-template-member-Typedef)
castxml_test_output(Class-template)
castxml_test_output(Class-template-Method-Argument-const)
@@ -447,6 +449,8 @@ castxml_test_output(Typedef-to-Enumeration)
castxml_test_output(Typedef-to-Enumeration-anonymous)
castxml_test_output(Typedef-to-FundamentalType-mode)
castxml_test_output(Typedef-to-extern-C-FundamentalType-mode)
+castxml_test_output(Typedef-to-Struct-anonymous)
+castxml_test_output(Typedef-to-Union-anonymous)
castxml_test_output(Variable)
castxml_test_output(Variable-annotate)
castxml_test_output(Variable-in-Class)
diff --git a/test/expect/castxml1.any.Class-member-Struct-anonymous.xml.txt b/test/expect/castxml1.any.Class-member-Struct-anonymous.xml.txt
new file mode 100644
index 0000000..1b5390c
--- /dev/null
+++ b/test/expect/castxml1.any.Class-member-Struct-anonymous.xml.txt
@@ -0,0 +1,31 @@
+^<\?xml version="1.0"\?>
+<CastXML[^>]*>
+ <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6 _7 _8" size="[0-9]+" align="[0-9]+"/>
+ <Struct id="_3" name="" context="_1" access="private" location="f1:3" file="f1" line="3" members="_9 _10 _11 _12" size="[0-9]+" align="[0-9]+"/>
+ <Field id="_4" name="s" type="_13" context="_1" access="private" location="f1:5" file="f1" line="5" offset="0"/>
+ <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_14" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_7" name="=" returns="_15" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_14" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_8" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_9" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_10" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?>
+ <Argument type="_16" location="f1:3" file="f1" line="3"/>
+ </Constructor>
+ <OperatorMethod id="_11" name="=" returns="_17" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_16" location="f1:3" file="f1" line="3"/>
+ </OperatorMethod>
+ <Destructor id="_12" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+ <ElaboratedType id="_13" type="_3"/>
+ <ReferenceType id="_14" type="_1c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <ReferenceType id="_15" type="_1" size="[0-9]+" align="[0-9]+"/>
+ <ReferenceType id="_16" type="_3c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_3c" type="_3" const="1"/>
+ <ReferenceType id="_17" type="_3" size="[0-9]+" align="[0-9]+"/>
+ <Namespace id="_2" name="::"/>
+ <File id="f1" name=".*/test/input/Class-member-Struct-anonymous.cxx"/>
+</CastXML>$
diff --git a/test/expect/castxml1.any.Class-member-Union-anonymous.xml.txt b/test/expect/castxml1.any.Class-member-Union-anonymous.xml.txt
new file mode 100644
index 0000000..5ac32ac
--- /dev/null
+++ b/test/expect/castxml1.any.Class-member-Union-anonymous.xml.txt
@@ -0,0 +1,31 @@
+^<\?xml version="1.0"\?>
+<CastXML[^>]*>
+ <Class id="_1" name="start" context="_2" location="f1:1" file="f1" line="1" members="_3 _4 _5 _6 _7 _8" size="[0-9]+" align="[0-9]+"/>
+ <Union id="_3" name="" context="_1" access="private" location="f1:3" file="f1" line="3" members="_9 _10 _11 _12" size="[0-9]+" align="[0-9]+"/>
+ <Field id="_4" name="u" type="_13" context="_1" access="private" location="f1:5" file="f1" line="5" offset="0"/>
+ <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_14" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_7" name="=" returns="_15" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_14" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_8" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_9" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_10" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?>
+ <Argument type="_16" location="f1:3" file="f1" line="3"/>
+ </Constructor>
+ <OperatorMethod id="_11" name="=" returns="_17" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_16" location="f1:3" file="f1" line="3"/>
+ </OperatorMethod>
+ <Destructor id="_12" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+ <ElaboratedType id="_13" type="_3"/>
+ <ReferenceType id="_14" type="_1c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <ReferenceType id="_15" type="_1" size="[0-9]+" align="[0-9]+"/>
+ <ReferenceType id="_16" type="_3c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_3c" type="_3" const="1"/>
+ <ReferenceType id="_17" type="_3" size="[0-9]+" align="[0-9]+"/>
+ <Namespace id="_2" name="::"/>
+ <File id="f1" name=".*/test/input/Class-member-Union-anonymous.cxx"/>
+</CastXML>$
diff --git a/test/expect/castxml1.any.Typedef-to-Struct-anonymous.xml.txt b/test/expect/castxml1.any.Typedef-to-Struct-anonymous.xml.txt
new file mode 100644
index 0000000..28ee047
--- /dev/null
+++ b/test/expect/castxml1.any.Typedef-to-Struct-anonymous.xml.txt
@@ -0,0 +1,8 @@
+^<\?xml version="1.0"\?>
+<CastXML[^>]*>
+ <Typedef id="_1" name="start" type="_2" context="_3" location="f1:3" file="f1" line="3"/>
+ <ElaboratedType id="_2" type="_4"/>
+ <Namespace id="_3" name="::"/>
+ <Struct id="_4" name="" context="_3" location="f1:1" file="f1" line="1" size="[0-9]+" align="[0-9]+"/>
+ <File id="f1" name=".*/test/input/Typedef-to-Struct-anonymous.cxx"/>
+</CastXML>$
diff --git a/test/expect/castxml1.any.Typedef-to-Union-anonymous.xml.txt b/test/expect/castxml1.any.Typedef-to-Union-anonymous.xml.txt
new file mode 100644
index 0000000..39294a0
--- /dev/null
+++ b/test/expect/castxml1.any.Typedef-to-Union-anonymous.xml.txt
@@ -0,0 +1,8 @@
+^<\?xml version="1.0"\?>
+<CastXML[^>]*>
+ <Typedef id="_1" name="start" type="_2" context="_3" location="f1:3" file="f1" line="3"/>
+ <ElaboratedType id="_2" type="_4"/>
+ <Namespace id="_3" name="::"/>
+ <Union id="_4" name="" context="_3" location="f1:1" file="f1" line="1" size="[0-9]+" align="[0-9]+"/>
+ <File id="f1" name=".*/test/input/Typedef-to-Union-anonymous.cxx"/>
+</CastXML>$
diff --git a/test/expect/gccxml.any.Class-member-Struct-anonymous.xml.txt b/test/expect/gccxml.any.Class-member-Struct-anonymous.xml.txt
new file mode 100644
index 0000000..ae46406
--- /dev/null
+++ b/test/expect/gccxml.any.Class-member-Struct-anonymous.xml.txt
@@ -0,0 +1,30 @@
+^<\?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 _8" size="[0-9]+" align="[0-9]+"/>
+ <Struct id="_3" name="" context="_1" access="private" location="f1:3" file="f1" line="3" members="_9 _10 _11 _12" size="[0-9]+" align="[0-9]+"/>
+ <Field id="_4" name="s" type="_3" context="_1" access="private" location="f1:5" file="f1" line="5" offset="0"/>
+ <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_13" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_7" name="=" returns="_14" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_13" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_8" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_9" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_10" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?>
+ <Argument type="_15" location="f1:3" file="f1" line="3"/>
+ </Constructor>
+ <OperatorMethod id="_11" name="=" returns="_16" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_15" location="f1:3" file="f1" line="3"/>
+ </OperatorMethod>
+ <Destructor id="_12" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+ <ReferenceType id="_13" type="_1c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <ReferenceType id="_14" type="_1" size="[0-9]+" align="[0-9]+"/>
+ <ReferenceType id="_15" type="_3c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_3c" type="_3" const="1"/>
+ <ReferenceType id="_16" type="_3" size="[0-9]+" align="[0-9]+"/>
+ <Namespace id="_2" name="::"/>
+ <File id="f1" name=".*/test/input/Class-member-Struct-anonymous.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Class-member-Union-anonymous.xml.txt b/test/expect/gccxml.any.Class-member-Union-anonymous.xml.txt
new file mode 100644
index 0000000..016e51e
--- /dev/null
+++ b/test/expect/gccxml.any.Class-member-Union-anonymous.xml.txt
@@ -0,0 +1,30 @@
+^<\?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 _8" size="[0-9]+" align="[0-9]+"/>
+ <Union id="_3" name="" context="_1" access="private" location="f1:3" file="f1" line="3" members="_9 _10 _11 _12" size="[0-9]+" align="[0-9]+"/>
+ <Field id="_4" name="u" type="_3" context="_1" access="private" location="f1:5" file="f1" line="5" offset="0"/>
+ <Constructor id="_5" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_6" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_13" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_7" name="=" returns="_14" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_13" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_8" name="start" context="_1" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_9" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_10" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?>
+ <Argument type="_15" location="f1:3" file="f1" line="3"/>
+ </Constructor>
+ <OperatorMethod id="_11" name="=" returns="_16" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_15" location="f1:3" file="f1" line="3"/>
+ </OperatorMethod>
+ <Destructor id="_12" context="_3" access="public" location="f1:3" file="f1" line="3" inline="1" artificial="1"( throw="")?/>
+ <ReferenceType id="_13" type="_1c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_1c" type="_1" const="1"/>
+ <ReferenceType id="_14" type="_1" size="[0-9]+" align="[0-9]+"/>
+ <ReferenceType id="_15" type="_3c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_3c" type="_3" const="1"/>
+ <ReferenceType id="_16" type="_3" size="[0-9]+" align="[0-9]+"/>
+ <Namespace id="_2" name="::"/>
+ <File id="f1" name=".*/test/input/Class-member-Union-anonymous.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Typedef-to-Struct-anonymous.xml.txt b/test/expect/gccxml.any.Typedef-to-Struct-anonymous.xml.txt
new file mode 100644
index 0000000..dc34930
--- /dev/null
+++ b/test/expect/gccxml.any.Typedef-to-Struct-anonymous.xml.txt
@@ -0,0 +1,18 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Typedef id="_1" name="start" type="_2" context="_3" location="f1:3" file="f1" line="3"/>
+ <Struct id="_2" name="" context="_3" location="f1:1" file="f1" line="1" members="_4 _5 _6 _7" size="[0-9]+" align="[0-9]+"/>
+ <Constructor id="_4" context="_2" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_5" context="_2" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_8" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_6" name="=" returns="_9" context="_2" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_8" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_7" context="_2" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <ReferenceType id="_8" type="_2c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_2c" type="_2" const="1"/>
+ <ReferenceType id="_9" type="_2" size="[0-9]+" align="[0-9]+"/>
+ <Namespace id="_3" name="::"/>
+ <File id="f1" name=".*/test/input/Typedef-to-Struct-anonymous.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Typedef-to-Union-anonymous.xml.txt b/test/expect/gccxml.any.Typedef-to-Union-anonymous.xml.txt
new file mode 100644
index 0000000..97cc258
--- /dev/null
+++ b/test/expect/gccxml.any.Typedef-to-Union-anonymous.xml.txt
@@ -0,0 +1,18 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Typedef id="_1" name="start" type="_2" context="_3" location="f1:3" file="f1" line="3"/>
+ <Union id="_2" name="" context="_3" location="f1:1" file="f1" line="1" members="_4 _5 _6 _7" size="[0-9]+" align="[0-9]+"/>
+ <Constructor id="_4" context="_2" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <Constructor id="_5" context="_2" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?>
+ <Argument type="_8" location="f1:1" file="f1" line="1"/>
+ </Constructor>
+ <OperatorMethod id="_6" name="=" returns="_9" context="_2" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")? mangled="[^"]+">
+ <Argument type="_8" location="f1:1" file="f1" line="1"/>
+ </OperatorMethod>
+ <Destructor id="_7" context="_2" access="public" location="f1:1" file="f1" line="1" inline="1" artificial="1"( throw="")?/>
+ <ReferenceType id="_8" type="_2c" size="[0-9]+" align="[0-9]+"/>
+ <CvQualifiedType id="_2c" type="_2" const="1"/>
+ <ReferenceType id="_9" type="_2" size="[0-9]+" align="[0-9]+"/>
+ <Namespace id="_3" name="::"/>
+ <File id="f1" name=".*/test/input/Typedef-to-Union-anonymous.cxx"/>
+</GCC_XML>$
diff --git a/test/input/Class-member-Struct-anonymous.cxx b/test/input/Class-member-Struct-anonymous.cxx
new file mode 100644
index 0000000..e868a50
--- /dev/null
+++ b/test/input/Class-member-Struct-anonymous.cxx
@@ -0,0 +1,6 @@
+class start
+{
+ struct
+ {
+ } s;
+};
diff --git a/test/input/Class-member-Union-anonymous.cxx b/test/input/Class-member-Union-anonymous.cxx
new file mode 100644
index 0000000..04dea43
--- /dev/null
+++ b/test/input/Class-member-Union-anonymous.cxx
@@ -0,0 +1,6 @@
+class start
+{
+ union
+ {
+ } u;
+};
diff --git a/test/input/Typedef-to-Struct-anonymous.cxx b/test/input/Typedef-to-Struct-anonymous.cxx
new file mode 100644
index 0000000..e0c2259
--- /dev/null
+++ b/test/input/Typedef-to-Struct-anonymous.cxx
@@ -0,0 +1,3 @@
+typedef struct
+{
+} start;
diff --git a/test/input/Typedef-to-Union-anonymous.cxx b/test/input/Typedef-to-Union-anonymous.cxx
new file mode 100644
index 0000000..fa15742
--- /dev/null
+++ b/test/input/Typedef-to-Union-anonymous.cxx
@@ -0,0 +1,3 @@
+typedef union
+{
+} start;