[gobject-introspection] Add a regress test for a method returning GPtrArray
- From: Xavier Claessens <xclaesse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Add a regress test for a method returning GPtrArray
- Date: Fri, 26 Aug 2011 15:29:41 +0000 (UTC)
commit 76c8019b0d7d2b6ecc98daa8277e739e71a2c688
Author: Xavier Claessens <xclaesse gmail com>
Date: Tue Aug 2 12:03:57 2011 +0200
Add a regress test for a method returning GPtrArray
tests/scanner/Regress-1.0-expected.gir | 8 ++++++++
tests/scanner/regress.c | 18 ++++++++++++++++++
tests/scanner/regress.h | 3 +++
3 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index ce5af5c..156acc9 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -1928,6 +1928,14 @@ call and can be released on return.</doc>
</parameter>
</parameters>
</function>
+ <function name="test_garray_container_return"
+ c:identifier="regress_test_garray_container_return">
+ <return-value transfer-ownership="container">
+ <array name="GLib.PtrArray" c:type="GPtrArray*">
+ <type name="utf8" c:type="GPtrArray*"/>
+ </array>
+ </return-value>
+ </function>
<function name="test_ghash_container_return"
c:identifier="regress_test_ghash_container_return">
<return-value transfer-ownership="container">
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 276a7d1..191ae08 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -1316,6 +1316,24 @@ regress_test_ghash_nested_everything_return2 (void)
/************************************************************************/
+/**
+ * regress_test_garray_container_return:
+ *
+ * Returns: (transfer container) (type GLib.PtrArray) (element-type utf8):
+ */
+GPtrArray *
+regress_test_garray_container_return (void)
+{
+ GPtrArray *array;
+
+ array = g_ptr_array_new_with_free_func (g_object_unref);
+ g_ptr_array_add (array, g_strdup ("regress"));
+
+ return array;
+}
+
+/************************************************************************/
+
/* error? */
/* enums / flags */
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index 25d4358..2c6fa59 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -111,6 +111,9 @@ void regress_test_ghash_nothing_in2 (GHashTable *in);
GHashTable *regress_test_ghash_nested_everything_return (void);
GHashTable *regress_test_ghash_nested_everything_return2 (void);
+/* GPtrArray */
+GPtrArray *regress_test_garray_container_return (void);
+
/* error? */
/* closure */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]