summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-12-11 10:54:00 -0300
committerMartin Pitt <martinpitt@gnome.org>2012-12-17 16:05:36 +0100
commitf885e3ecce5e4f1df19659b76a89598d5df4fab5 (patch)
tree43c3878ff0e1e842ab1fe113b1fd82da9da2dccf
parenta021f0b29cf3208fa6a09bf715f23f298bca9cb2 (diff)
downloadgobject-introspection-f885e3ecce5e4f1df19659b76a89598d5df4fab5.tar.gz
gimarshallingtests:: Add test for returning a caller-allocated GArray
https://bugzilla.gnome.org/show_bug.cgi?id=690041
-rw-r--r--tests/gimarshallingtests.c17
-rw-r--r--tests/gimarshallingtests.h1
2 files changed, 18 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):
*/
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index 840f763b..84366346 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -438,6 +438,7 @@ void gi_marshalling_tests_garray_utf8_none_in (GArray *array_);
void gi_marshalling_tests_garray_utf8_none_out (GArray **array_);
void gi_marshalling_tests_garray_utf8_container_out (GArray **array_);
void gi_marshalling_tests_garray_utf8_full_out (GArray **array_);
+void gi_marshalling_tests_garray_utf8_full_out_caller_allocated (GArray *array_);
void gi_marshalling_tests_garray_utf8_none_inout (GArray **array_);
void gi_marshalling_tests_garray_utf8_container_inout (GArray **array_);