[gtk-doc] scan: move variable declaration tests into the unit test
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] scan: move variable declaration tests into the unit test
- Date: Tue, 27 Nov 2018 18:01:40 +0000 (UTC)
commit f08e96212164378038d5a3a355235d5de8f8a0c5
Author: Stefan Sauer <ensonic users sf net>
Date: Tue Nov 27 18:54:10 2018 +0100
scan: move variable declaration tests into the unit test
tests/bugs/docs/tester-sections.txt | 4 ----
tests/bugs/src/tester.h | 28 ----------------------------
tests/scan.py | 34 ++++++++++++++++++++++++++++++++--
3 files changed, 32 insertions(+), 34 deletions(-)
---
diff --git a/tests/bugs/docs/tester-sections.txt b/tests/bugs/docs/tester-sections.txt
index 1db0da9..52956c3 100644
--- a/tests/bugs/docs/tester-sections.txt
+++ b/tests/bugs/docs/tester-sections.txt
@@ -56,10 +56,6 @@ bug_623968c
bug_624200a
bug_624200b
bug_638330
-BUG_656773a
-BUG_656773b
-BUG_656773c
-BUG_656946
bug_624001a
bug_624001b
bug_624001c
diff --git a/tests/bugs/src/tester.h b/tests/bugs/src/tester.h
index 0042574..28abcd8 100644
--- a/tests/bugs/src/tester.h
+++ b/tests/bugs/src/tester.h
@@ -434,34 +434,6 @@ gst_play_marshal_BUFFER__BOXED (gint * closure,
gpointer marshal_data);
-/**
- * BUG_656773a:
- *
- * https://bugzilla.gnome.org/show_bug.cgi?id=656773
- */
-extern const char* const BUG_656773a;
-
-/**
- * BUG_656773b:
- *
- * https://bugzilla.gnome.org/show_bug.cgi?id=656773
- */
-extern const char* BUG_656773b;
-
-/**
- * BUG_656773c:
- *
- * https://bugzilla.gnome.org/show_bug.cgi?id=656773
- */
-const char* const BUG_656773c = "bug";
-
-/**
- * BUG_656946:
- *
- * https://bugzilla.gnome.org/show_bug.cgi?id=656946
- */
-extern short int BUG_656946;
-
#ifndef G_GNUC_DEPRECATED
#define G_GNUC_DEPRECATED
#endif
diff --git a/tests/scan.py b/tests/scan.py
index f280da5..c03e0da 100644
--- a/tests/scan.py
+++ b/tests/scan.py
@@ -211,7 +211,7 @@ class ScanHeaderContentStructs(ScanHeaderContentTestCase):
class ScanHeaderContentUnions(ScanHeaderContentTestCase):
- """Test parsing of Union declarations."""
+ """Test parsing of union declarations."""
def assertDecl(self, name, decl):
d = '<UNION>\n<NAME>%s</NAME>\n%s</UNION>\n' % (name, decl)
@@ -239,7 +239,37 @@ class ScanHeaderContentUnions(ScanHeaderContentTestCase):
self.assertDecl('Data', header)
-# VARIABLE
+class ScanHeaderContentVariabless(ScanHeaderContentTestCase):
+ """Test parsing of variable declarations."""
+
+ def assertDecl(self, name, decl):
+ d = '<VARIABLE>\n<NAME>%s</NAME>\n%s</VARIABLE>\n' % (name, decl)
+ self.assertEqual([d], self.decls)
+ self.assertEqual([], self.types)
+
+ def test_FindsExternInt(self):
+ header = 'extern int var;'
+ slist, doc_comments = self.scanHeaderContent(
+ header.splitlines(keepends=True))
+ self.assertDecl('var', header)
+
+ def test_FindsConstInt(self):
+ header = 'const int var = 42;'
+ slist, doc_comments = self.scanHeaderContent(
+ header.splitlines(keepends=True))
+ self.assertDecl('var', header)
+
+ def test_FindsExernCharPtr(self):
+ header = 'extern char* var;'
+ slist, doc_comments = self.scanHeaderContent(
+ header.splitlines(keepends=True))
+ self.assertDecl('var', header)
+
+ def test_FindConstCharPtr(self):
+ header = 'const char* var = "foo";'
+ slist, doc_comments = self.scanHeaderContent(
+ header.splitlines(keepends=True))
+ self.assertDecl('var', header)
if __name__ == '__main__':
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]