summaryrefslogtreecommitdiff
path: root/tests/scanner/regress.c
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2016-02-06 20:59:11 -0800
committerPhilip Chimento <philip.chimento@gmail.com>2016-02-07 20:48:17 -0800
commitb20ac732d096c1140d856d99f4cf64f6c708de50 (patch)
treeb9ffcd72dda0abd1a67d966a3fe9b1dd8e3247ec /tests/scanner/regress.c
parentc2f0c7bce052af6107dfe676b956b60550786c56 (diff)
downloadgobject-introspection-b20ac732d096c1140d856d99f4cf64f6c708de50.tar.gz
tests: Add regression test for out array of struct
This is a regression test for returning out arrays of structs, like gdk_keymap_get_entries_for_keyval() for example. https://bugzilla.gnome.org/show_bug.cgi?id=761658
Diffstat (limited to 'tests/scanner/regress.c')
-rw-r--r--tests/scanner/regress.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index fa481054..6eac6f7b 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -1740,6 +1740,23 @@ regress_test_struct_a_parse (RegressTestStructA *a_out,
}
/**
+ * regress_test_array_struct_out:
+ * @arr: (out) (array length=len) (transfer full):
+ * @len: (out)
+ *
+ * This is similar to gdk_keymap_get_entries_for_keyval().
+ */
+void
+regress_test_array_struct_out (RegressTestStructA **arr, int *len)
+{
+ *arr = g_new0(RegressTestStructA, 3);
+ (*arr)[0].some_int = 22;
+ (*arr)[1].some_int = 33;
+ (*arr)[2].some_int = 44;
+ *len = 3;
+}
+
+/**
* regress_test_struct_b_clone:
* @b: the structure
* @b_out: (out): the cloned structure