[gtk-doc] tests: add more scan tests for structs and unions



commit 7f1e40ef63887a167c7eef5fff4a21b997da6041
Author: Stefan Sauer <ensonic users sf net>
Date:   Thu Jan 31 07:45:33 2019 +0100

    tests: add more scan tests for structs and unions

 tests/scan.py | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
---
diff --git a/tests/scan.py b/tests/scan.py
index 530eb8e..ee3b296 100755
--- a/tests/scan.py
+++ b/tests/scan.py
@@ -449,6 +449,21 @@ class ScanHeaderContentStructs(ScanHeaderContentTestCase):
         slist, doc_comments = self.scanHeaderContent([header])
         self.assertNoDeclFound(slist)
 
+    def test_IgnoresPrivteStruct(self):
+        header = 'struct _x;'
+        slist, doc_comments = self.scanHeaderContent([header])
+        self.assertNoDeclFound(slist)
+
+    def test_OpaqueStructTypedefGeneratesEmptyDecl(self):
+        header = 'typedef struct _data data;'
+        slist, doc_comments = self.scanHeaderContent([header])
+        self.assertDecl('data', '', slist)
+
+    def test_OpaqueStructGeneratesEmptyDecl(self):
+        header = 'struct data;'
+        slist, doc_comments = self.scanHeaderContent([header])
+        self.assertDecl('data', header, slist)
+
 
 class ScanHeaderContentUnions(ScanHeaderContentTestCase):
     """Test parsing of union declarations."""
@@ -484,6 +499,21 @@ class ScanHeaderContentUnions(ScanHeaderContentTestCase):
         slist, doc_comments = self.scanHeaderContent([header])
         self.assertNoDeclFound(slist)
 
+    def test_IgnoresPrivteStruct(self):
+        header = 'union _x x;'
+        slist, doc_comments = self.scanHeaderContent([header])
+        self.assertNoDeclFound(slist)
+
+    def test_OpaqueUnionTypedefGeneratesEmptyDecl(self):
+        header = 'typedef union _data data;'
+        slist, doc_comments = self.scanHeaderContent([header])
+        self.assertDecl('data', '', slist)
+
+    def test_OpaqueUnionGeneratesEmptyDecl(self):
+        header = 'union data;'
+        slist, doc_comments = self.scanHeaderContent([header])
+        self.assertDecl('data', header, slist)
+
 
 class ScanHeaderContentUserFunction(ScanHeaderContentTestCase):
     """Test parsing of function pointer declarations."""


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]