summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-12-09 10:34:29 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-12-09 10:41:26 +0100
commit5720c77acde1b2348f3c3d08e3a27cf624be1323 (patch)
treeaed9e8b2af27d70234edb5c2fb26ab6feb1760ca /tests
parentee5a93788618d85e4be1b4c96cb8ba3daf0b6173 (diff)
downloadgobject-introspection-5720c77acde1b2348f3c3d08e3a27cf624be1323.tar.gz
sourcescanner: Allow empty declarations. Fixes #216
As far as I see these are not valid C and only allowed in C++11. But they do occur in the wild (mingw headers) so let's try to handle them.
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/test_sourcescanner.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/scanner/test_sourcescanner.py b/tests/scanner/test_sourcescanner.py
index 2f383af7..c731049b 100644
--- a/tests/scanner/test_sourcescanner.py
+++ b/tests/scanner/test_sourcescanner.py
@@ -72,6 +72,12 @@ void foo(int bar) {
self.assertEqual(len(list(scanner.get_comments())), 1)
self.assertFalse(scanner.get_errors())
+ def test_empty_decl(self):
+ # https://gitlab.gnome.org/GNOME/gobject-introspection/issues/216
+ scanner = self._parse_files(";int foo;")
+ self.assertEqual(len(list(scanner.get_symbols())), 1)
+ self.assertFalse(scanner.get_errors())
+
if __name__ == '__main__':
unittest.main()