[gtk-doc] tests: move more function tests to the unit tests
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] tests: move more function tests to the unit tests
- Date: Fri, 30 Nov 2018 20:59:06 +0000 (UTC)
commit 5a763b8e1fa48559d638903c722064626b761c59
Author: Stefan Sauer <ensonic users sf net>
Date: Fri Nov 30 21:46:04 2018 +0100
tests: move more function tests to the unit tests
tests/bugs/docs/tester-sections.txt | 4 ----
tests/bugs/src/tester.h | 19 -------------------
tests/scan.py | 23 ++++++++++++++++++-----
3 files changed, 18 insertions(+), 28 deletions(-)
---
diff --git a/tests/bugs/docs/tester-sections.txt b/tests/bugs/docs/tester-sections.txt
index 59b4762..338e31a 100644
--- a/tests/bugs/docs/tester-sections.txt
+++ b/tests/bugs/docs/tester-sections.txt
@@ -11,16 +11,13 @@ Bug446648
Bug512154
Bug644291
Bug000000Scope
-bug_411739_rettype
<SUBSECTION Functions>
bug_000000_va1
BUG_000000_VA2
BUG_000000_VA3
bug_141869_a
bug_141869_b
-bug_379466
bug_380824
-bug_411739
bug_419997
bug_445693
bug_460127
@@ -34,7 +31,6 @@ bug_512155c_function_pointer_t
bug_532395a
bug_532395b
bug_544172
-bug_552602
bug_554833
bug_574654a
bug_574654b
diff --git a/tests/bugs/src/tester.h b/tests/bugs/src/tester.h
index 05e1cf2..ea72c28 100644
--- a/tests/bugs/src/tester.h
+++ b/tests/bugs/src/tester.h
@@ -68,25 +68,8 @@ GLIB_VAR guint64 (*bug_477532) (void);
void bug_141869_a (unsigned pid);
void bug_141869_b (signed pid);
-void bug_379466 (int
- pid);
-
int bug_380824 (int arg);
-
-/**
- * bug_411739_rettype:
- * @test: field
- *
- * http://bugzilla.gnome.org/show_bug.cgi?id=411739
- */
-struct bug_411739_rettype {
- int test;
-};
-
-struct bug_411739_rettype *
-bug_411739 (void);
-
void bug_419997 (int const_values);
void bug_445693 (unsigned long pid);
@@ -94,8 +77,6 @@ void bug_445693 (unsigned long pid);
G_CONST_RETURN gchar* G_CONST_RETURN *
bug_471014 (void);
-const char* const * bug_552602 (void);
-
/**
* Bug446648:
* @BUG_446648_FOO: foo
diff --git a/tests/scan.py b/tests/scan.py
index 9f10881..149a9b5 100644
--- a/tests/scan.py
+++ b/tests/scan.py
@@ -147,12 +147,12 @@ class ScanHeaderContentFunctions(ScanHeaderContentTestCase):
slist, doc_comments = self.scanHeaderContent([header])
self.assertDecl('func', 'void', '', slist)
- def test_FindsFunctionVoidVoid(self):
+ def test_FindsFunctionVoid_Void(self):
header = 'void func(void);'
slist, doc_comments = self.scanHeaderContent([header])
self.assertDecl('func', 'void', 'void', slist)
- def test_FindsFunctionStrucVoidMultiline(self):
+ def test_FindsFunctionStruct_Void(self):
header = textwrap.dedent("""\
struct ret *
func (void);""")
@@ -160,6 +160,20 @@ class ScanHeaderContentFunctions(ScanHeaderContentTestCase):
header.splitlines(keepends=True))
self.assertDecl('func', 'struct ret *', 'void', slist)
+ def test_FindsFunctionVoid_IntWithLinebreak(self):
+ header = textwrap.dedent("""\
+ void func (int
+ pid);""")
+ slist, doc_comments = self.scanHeaderContent(
+ header.splitlines(keepends=True))
+ self.assertDecl('func', 'void', 'int pid', slist)
+
+ def test_FindsFunctionConstCharPtConstPtr_Void(self):
+ header = 'const char* const * func(void);'
+ slist, doc_comments = self.scanHeaderContent([header])
+ # TODO: remove the *
+ self.assertDecl('func', 'const char * const *', 'void', slist)
+
class ScanHeaderContentMacros(ScanHeaderContentTestCase):
"""Test parsing of macro declarations."""
@@ -188,10 +202,9 @@ class ScanHeaderContentMacros(ScanHeaderContentTestCase):
])
self.assertDecl('FOO', '#define FOO(x) (x << 1)', slist)
- # TODO: test for a few variants
def test_IgnoresInternalMacro(self):
slist, doc_comments = self.scanHeaderContent([
- '#define _BUG_000000b (a) (a*a)'
+ '#define _INTERNAL (a) (a)'
])
self.assertNoDeclFound(slist)
@@ -327,4 +340,4 @@ if __name__ == '__main__':
#
# t = ScanHeaderContentFunctions()
# t.setUp()
- # t.test_FindsFunctionStrucVoidMultiline()
+ # t.test_FindsFunctionConstCharPtConstPtr_Void()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]