summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-24 10:53:12 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-24 11:03:53 -0300
commit789321d97207d6989ef77805fe5fb5920b6935cc (patch)
treedb11c1cea605a1eb88520c68f67b7359a5bf6f5b /tests
parent7c3d1e7c5d6d209c262789b22ea6a99b0636771d (diff)
downloadgobject-introspection-789321d97207d6989ef77805fe5fb5920b6935cc.tar.gz
Add more array warnings + tests
Diffstat (limited to 'tests')
-rw-r--r--tests/warn/Makefile.am1
-rw-r--r--tests/warn/invalid-array.h44
2 files changed, 45 insertions, 0 deletions
diff --git a/tests/warn/Makefile.am b/tests/warn/Makefile.am
index 26c2dcbb..db006e57 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 \
+ invalid-array.h \
invalid-element-type.h \
invalid-option.h \
invalid-out.h \
diff --git a/tests/warn/invalid-array.h b/tests/warn/invalid-array.h
new file mode 100644
index 00000000..a4a4e47e
--- /dev/null
+++ b/tests/warn/invalid-array.h
@@ -0,0 +1,44 @@
+#include "common.h"
+
+/**
+ * test_invalid_array:
+ * @out1: (array foobar):
+ **/
+void
+test_invalid_array (char ***out1);
+
+// EXPECT:5: Warning: Test: invalid array annotation value: 'foobar'
+
+/**
+ * test_invalid_array_zero_terminated:
+ * @out1: (array zero-terminated):
+ * @out2: (array zero-terminated=foobar):
+ **/
+void
+test_invalid_array_zero_terminated (char ***out1,
+ char ***out2);
+
+// EXPECT:14: Warning: Test: array option zero-terminated needs a value
+// EXPECT:15: Warning: Test: invalid array zero-terminated option value 'foobar', must be an integer
+
+/**
+ * test_invalid_array_fixed_size:
+ * @out1: (array fixed-size):
+ * @out2: (array fixed-size=foobar):
+ **/
+void
+test_invalid_array_fixed_size (char ***out1,
+ char ***out2);
+
+// EXPECT:26: Warning: Test: array option fixed-size needs a value
+// EXPECT:27: Warning: Test: invalid array fixed-size option value 'foobar', must be an integer
+
+/**
+ * test_invalid_array_length:
+ * @out1: (array length):
+ **/
+void
+test_invalid_array_length (char ***out1,
+ char ***out2);
+
+// EXPECT:38: Warning: Test: array option length needs a value