summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2012-02-16 16:12:09 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2012-02-16 16:12:09 +0100
commit4170ebb550c90249e0458410c59366af363cabe5 (patch)
tree012b5e24cba9c6866e0e86a38cfbd8c1208037ed
parent29a790c19bbe06f4b70eaa9e0f600f145683c05b (diff)
downloadgobject-introspection-4170ebb550c90249e0458410c59366af363cabe5.tar.gz
Add test for a GPtrArray return with transfer full
This complements the already existing regress_test_garray_container_return() test.
-rw-r--r--tests/scanner/Regress-1.0-expected.gir8
-rw-r--r--tests/scanner/regress.c16
-rw-r--r--tests/scanner/regress.h1
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 24e8d050..ae047256 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 ec6a187f..7e838d34 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 8942130d..65a158a1 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? */