diff options
author | Johan Dahlin <johan@gnome.org> | 2010-09-14 19:31:46 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-09-14 19:37:52 -0300 |
commit | c31120dd00d2ea1513399832461ed4437c6940de (patch) | |
tree | 3a62e8ceb6509b80d34cf0cb8a33d519c6779130 /tests | |
parent | 839afcc48c492690e4d25ab763b081ce37cd1858 (diff) | |
download | gobject-introspection-c31120dd00d2ea1513399832461ed4437c6940de.tar.gz |
Add a parameter mismatch warning
https://bugzilla.gnome.org/show_bug.cgi?id=629708
Diffstat (limited to 'tests')
-rw-r--r-- | tests/warn/Makefile.am | 1 | ||||
-rw-r--r-- | tests/warn/unknown-parameter.h | 28 | ||||
-rw-r--r-- | tests/warn/warningtester.py | 2 |
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/warn/Makefile.am b/tests/warn/Makefile.am index 9e585bda..deece2f3 100644 --- a/tests/warn/Makefile.am +++ b/tests/warn/Makefile.am @@ -4,6 +4,7 @@ TESTS = \ callback-invalid-scope.h \ callback-missing-scope.h \ return-gobject.h \ + unknown-parameter.h \ unresolved-type.h EXTRA_DIST = warningtester.py common.h $(TESTS) diff --git a/tests/warn/unknown-parameter.h b/tests/warn/unknown-parameter.h new file mode 100644 index 00000000..5b43c759 --- /dev/null +++ b/tests/warn/unknown-parameter.h @@ -0,0 +1,28 @@ +/* See https://bugzilla.gnome.org/show_bug.cgi?id=629708 */ + +/** + * test_param_mismatch: + * @wrong_name: (out): + * + */ +void test_param_mismatch(int *out); + +// EXPECT:: Warning: Test: test_param_mismatch: unknown parameter 'wrong_name' in documentation comment, should be 'out' + +/** + * test_param_mismatch2: + * @wrong_name2: (out): + * + */ +void test_param_mismatch2(int a, int *out2); + +// EXPECT:: Warning: Test: test_param_mismatch2: unknown parameter 'wrong_name2' in documentation comment, should be one of 'a', 'out2' + +/** + * test_param_missing: + * @missing: (out): + * + */ +void test_param_missing(void); + +// EXPECT:: Warning: Test: test_param_missing: unknown parameter 'missing' in documentation comment diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py index f30e3e04..a3de1e8b 100644 --- a/tests/warn/warningtester.py +++ b/tests/warn/warningtester.py @@ -101,6 +101,8 @@ def check(args): failed_tests = 0 expected_warnings = _extract_expected(filename) + if '' in warnings: + warnings.remove('') if len(expected_warnings) != len(warnings): raise SystemExit( "ERROR: expected %d warnings, but got %d: %r\n" % ( |