summaryrefslogtreecommitdiff
path: root/tests/warn
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2011-02-04 13:16:20 +0100
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2011-02-22 17:15:19 +0100
commitc8e04058f412a1d8618e35589b738c92da017911 (patch)
treec117782928440ca95f9bbdf606653f6d923dff92 /tests/warn
parent8f320a6b3c5d468cd4d5be580c167da071fc0856 (diff)
downloadgobject-introspection-c8e04058f412a1d8618e35589b738c92da017911.tar.gz
Add warnings for the (constructor) annotation
https://bugzilla.gnome.org/show_bug.cgi?id=641347
Diffstat (limited to 'tests/warn')
-rw-r--r--tests/warn/Makefile.am1
-rw-r--r--tests/warn/invalid-constructor.h18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/warn/Makefile.am b/tests/warn/Makefile.am
index 571ca4a3..7d81d9ef 100644
--- a/tests/warn/Makefile.am
+++ b/tests/warn/Makefile.am
@@ -6,6 +6,7 @@ TESTS = \
return-gobject.h \
invalid-array.h \
invalid-closure.h \
+ invalid-constructor.h \
invalid-element-type.h \
invalid-method.h \
invalid-option.h \
diff --git a/tests/warn/invalid-constructor.h b/tests/warn/invalid-constructor.h
new file mode 100644
index 00000000..a80d79ea
--- /dev/null
+++ b/tests/warn/invalid-constructor.h
@@ -0,0 +1,18 @@
+#include "common.h"
+
+/**
+ * test_constructor_invalid_return: (constructor)
+ *
+ */
+int test_constructor_invalid_return();
+
+// EXPECT:7: Warning: Test: test_constructor_invalid_return: Constructors must return an instance of their class
+
+/**
+ * test_constructor_invalid_return_pointer: (constructor)
+ *
+ */
+GClosure *test_constructor_invalid_return_pointer();
+
+// EXPECT:15: Warning: Test: test_constructor_invalid_return_pointer: Constructors must belong to the same namespace as the class they belong to
+