diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-12-11 10:54:00 -0300 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2012-12-17 16:05:36 +0100 |
commit | f885e3ecce5e4f1df19659b76a89598d5df4fab5 (patch) | |
tree | 43c3878ff0e1e842ab1fe113b1fd82da9da2dccf /tests/gimarshallingtests.c | |
parent | a021f0b29cf3208fa6a09bf715f23f298bca9cb2 (diff) | |
download | gobject-introspection-f885e3ecce5e4f1df19659b76a89598d5df4fab5.tar.gz |
gimarshallingtests:: Add test for returning a caller-allocated GArray
https://bugzilla.gnome.org/show_bug.cgi?id=690041
Diffstat (limited to 'tests/gimarshallingtests.c')
-rw-r--r-- | tests/gimarshallingtests.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 7f7abf81..281f34f3 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -1925,6 +1925,23 @@ gi_marshalling_tests_garray_utf8_full_out (GArray **array_) } /** + * gi_marshalling_tests_garray_utf8_full_out_caller_allocated: + * @array_: (out caller-allocates) (array) (element-type utf8) (transfer full): + */ +void +gi_marshalling_tests_garray_utf8_full_out_caller_allocated (GArray *array_) +{ + static gchar *values[] = {"0", "1", "2", NULL}; + gint i; + + g_array_set_size (array_, 0); + for (i = 0; values[i]; i++) { + gchar *str = g_strdup (values[i]); + g_array_append_val (array_, str); + } +} + +/** * gi_marshalling_tests_garray_utf8_none_inout: * @array_: (inout) (element-type utf8) (transfer none): */ |