[gobject-introspection] Add test for a GPtrArray return with transfer full
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Add test for a GPtrArray return with transfer full
- Date: Thu, 16 Feb 2012 15:39:24 +0000 (UTC)
commit 4170ebb550c90249e0458410c59366af363cabe5
Author: Martin Pitt <martin pitt ubuntu com>
Date: Thu Feb 16 16:12:09 2012 +0100
Add test for a GPtrArray return with transfer full
This complements the already existing
regress_test_garray_container_return() test.
tests/scanner/Regress-1.0-expected.gir | 8 ++++++++
tests/scanner/regress.c | 16 ++++++++++++++++
tests/scanner/regress.h | 1 +
3 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 24e8d05..ae04725 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -2164,6 +2164,14 @@ call and can be released on return.</doc>
</array>
</return-value>
</function>
+ <function name="test_garray_full_return"
+ c:identifier="regress_test_garray_full_return">
+ <return-value transfer-ownership="full">
+ <array name="GLib.PtrArray" c:type="GPtrArray*">
+ <type name="utf8"/>
+ </array>
+ </return-value>
+ </function>
<function name="test_gerror_callback"
c:identifier="regress_test_gerror_callback">
<return-value transfer-ownership="none">
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index ec6a187..7e838d3 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -1333,6 +1333,22 @@ regress_test_garray_container_return (void)
return array;
}
+/**
+ * regress_test_garray_full_return:
+ *
+ * Returns: (transfer full) (type GLib.PtrArray) (element-type utf8):
+ */
+GPtrArray *
+regress_test_garray_full_return (void)
+{
+ GPtrArray *array;
+
+ array = g_ptr_array_new ();
+ g_ptr_array_add (array, g_strdup ("regress"));
+
+ return array;
+}
+
/************************************************************************/
/* error? */
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index 8942130..65a158a 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -113,6 +113,7 @@ GHashTable *regress_test_ghash_nested_everything_return2 (void);
/* GPtrArray */
GPtrArray *regress_test_garray_container_return (void);
+GPtrArray *regress_test_garray_full_return (void);
/* error? */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]