[gobject-introspection] gimarshallingtests:: Add test for returning a caller-allocated GArray
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] gimarshallingtests:: Add test for returning a caller-allocated GArray
- Date: Mon, 17 Dec 2012 15:10:30 +0000 (UTC)
commit f885e3ecce5e4f1df19659b76a89598d5df4fab5
Author: Gonzalo Odiard <godiard gmail com>
Date: Tue Dec 11 10:54:00 2012 -0300
gimarshallingtests:: Add test for returning a caller-allocated GArray
https://bugzilla.gnome.org/show_bug.cgi?id=690041
tests/gimarshallingtests.c | 17 +++++++++++++++++
tests/gimarshallingtests.h | 1 +
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 7f7abf8..281f34f 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 840f763..8436634 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_);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]