summaryrefslogtreecommitdiff
path: root/tests/warn/invalid-nullable.h
diff options
context:
space:
mode:
authorGarrett Regier <garrett.regier@riftio.com>2015-10-04 12:17:40 -0400
committerColin Walters <walters@verbum.org>2015-10-04 12:17:55 -0400
commit849f1eef10b18eddaf41c1e0b2cca87bf5d93739 (patch)
treed36ede7d5b8879699e0a3c391b89a8f4263c456a /tests/warn/invalid-nullable.h
parent2699d5116ab5aaf801521c0f6c96bda09a23fb15 (diff)
downloadgobject-introspection-849f1eef10b18eddaf41c1e0b2cca87bf5d93739.tar.gz
scanner: Warn and ignore on incorrect optional/nullable/allow-none annotations
These can easily be misunderstood, especially optional. https://bugzilla.gnome.org/show_bug.cgi?id=752065 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
Diffstat (limited to 'tests/warn/invalid-nullable.h')
-rw-r--r--tests/warn/invalid-nullable.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/warn/invalid-nullable.h b/tests/warn/invalid-nullable.h
new file mode 100644
index 00000000..8a9174ab
--- /dev/null
+++ b/tests/warn/invalid-nullable.h
@@ -0,0 +1,14 @@
+#include "common.h"
+
+/**
+ * test_invalid_nullable:
+ * @param: (nullable):
+ * @param2: (nullable):
+ *
+ * Returns: (nullable):
+ */
+int test_invalid_nullable(int param, GType param2);
+
+// EXPECT:5: Warning: Test: invalid "nullable" annotation: only valid for pointer types and out parameters
+// EXPECT:6: Warning: Test: invalid "nullable" annotation: only valid for pointer types and out parameters
+// EXPECT:8: Warning: Test: invalid "nullable" annotation: only valid for pointer types and out parameters