summaryrefslogtreecommitdiff
path: root/tests/warn
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-02 17:18:35 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-02 17:19:18 -0300
commitb0b18465bc01e4b261670c40f7122d9516c430fd (patch)
treed09225deff43a4fc6d66c7e60eb8a5f3ff26af20 /tests/warn
parent4da9654e44eff6eb7c22510d89a3b00e969a16ab (diff)
downloadgobject-introspection-b0b18465bc01e4b261670c40f7122d9516c430fd.tar.gz
[tests] Add callback scope tests
And fix a bug in the warning call in the scanner
Diffstat (limited to 'tests/warn')
-rw-r--r--tests/warn/Makefile.am2
-rw-r--r--tests/warn/callback-invalid-scope.h11
-rw-r--r--tests/warn/callback-missing-scope.h5
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/warn/Makefile.am b/tests/warn/Makefile.am
index aefc7a70..2d3c3240 100644
--- a/tests/warn/Makefile.am
+++ b/tests/warn/Makefile.am
@@ -1,6 +1,8 @@
include $(top_srcdir)/common.mk
TESTS = \
+ callback-invalid-scope.h \
+ callback-missing-scope.h \
return-gobject.h \
unresolved-type.h
diff --git a/tests/warn/callback-invalid-scope.h b/tests/warn/callback-invalid-scope.h
new file mode 100644
index 00000000..c42a49a9
--- /dev/null
+++ b/tests/warn/callback-invalid-scope.h
@@ -0,0 +1,11 @@
+#include "common.h"
+
+/**
+ * test_callback_invalid:
+ * @callback: (scope invalid):
+ *
+ */
+void test_callback_invalid(GCallback *callback, gpointer user_data);
+
+// EXPECT:8: Warning: Test: test_callback_invalid: argument callback: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
+// EXPECT:8: Warning: Test: Invalid scope 'invalid' for parameter 'callback'
diff --git a/tests/warn/callback-missing-scope.h b/tests/warn/callback-missing-scope.h
new file mode 100644
index 00000000..7932198e
--- /dev/null
+++ b/tests/warn/callback-missing-scope.h
@@ -0,0 +1,5 @@
+#include "common.h"
+
+void test_callback(GCallback *callback, gpointer user_data);
+
+// EXPECT:3: Warning: Test: test_callback: argument callback: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)