summaryrefslogtreecommitdiff
path: root/tests/gimarshallingtests.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2014-01-24 05:14:48 -0600
committerMike Gorse <mgorse@suse.com>2014-01-27 17:17:28 -0600
commit38e4e0d4f3fd8a9aa8f024f6d6283e619df74fe9 (patch)
tree6bf95b92f6b7b3a3b082f8dbd384c3ec3712589d /tests/gimarshallingtests.c
parent9776c2abbcc51cc76a10d38469654e0c15327b5a (diff)
downloadgobject-introspection-38e4e0d4f3fd8a9aa8f024f6d6283e619df74fe9.tar.gz
Add test passing an owned boxed structure to a callback
https://bugzilla.gnome.org/show_bug.cgi?id=722899
Diffstat (limited to 'tests/gimarshallingtests.c')
-rw-r--r--tests/gimarshallingtests.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 09333391..bd3fe811 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -4363,6 +4363,26 @@ glong
return return_value;
}
+/**
+ * gi_marshalling_tests_callback_owned_boxed:
+ * @callback: (scope call) (closure callback_data):
+ * @callback_data: (allow-none):
+ */
+glong
+gi_marshalling_tests_callback_owned_boxed (GIMarshallingTestsCallbackOwnedBoxed callback,
+ void *callback_data)
+{
+ static GIMarshallingTestsBoxedStruct *box = NULL;
+ glong ret;
+
+ if (!box)
+ box = gi_marshalling_tests_boxed_struct_new ();
+ box->long_++;
+ callback (box, callback_data);
+ ret = box->long_;
+ return ret;
+}
+
gboolean
gi_marshalling_tests_object_vfunc_meth_with_error (GIMarshallingTestsObject *self, gint x, GError **error)
{