summaryrefslogtreecommitdiff
path: root/tests/gimarshallingtests.c
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2012-02-21 15:28:14 +0100
committerMartin Pitt <martinpitt@gnome.org>2012-03-27 17:42:39 +0200
commit61c9950f5096499e5a19c7b0aebb0c22f4b2fd87 (patch)
tree4a3f9565b8e64a819c1e7ce77647e6576ec80637 /tests/gimarshallingtests.c
parent4d8e35ecdc756fa7439a1dc4e08ebd9964d92a73 (diff)
downloadgobject-introspection-61c9950f5096499e5a19c7b0aebb0c22f4b2fd87.tar.gz
Add tests for vfuncs with callbacks as arguments
https://bugzilla.gnome.org/show_bug.cgi?id=663052 Signed-off-by: Martin Pitt <martinpitt@gnome.org>
Diffstat (limited to 'tests/gimarshallingtests.c')
-rw-r--r--tests/gimarshallingtests.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 7afe543a..e42233fb 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -3772,6 +3772,35 @@ gi_marshalling_tests_object_real_method_with_default_implementation (GIMarshalli
g_object_set_property (G_OBJECT (self), "int", &val);
}
+/**
+ * gi_marshalling_tests_object_vfunc_with_callback:
+ * @callback: (scope call) (closure callback_data):
+ * @callback_data: (allow-none):
+ *
+ * Virtual: vfunc_with_callback
+ */
+void
+gi_marshalling_tests_object_vfunc_with_callback (GIMarshallingTestsObject *object,
+ GIMarshallingTestsCallbackIntInt callback,
+ void *callback_data)
+{
+
+}
+
+static int
+_callback (int val, void *user_data)
+{
+ g_assert(user_data == 0xdeadbeef);
+ return val;
+}
+
+void
+gi_marshalling_tests_object_call_vfunc_with_callback (GIMarshallingTestsObject *object)
+{
+ GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (object)->vfunc_with_callback (object,
+ _callback,
+ (void *) 0xdeadbeef);
+}
/**
* gi_marshalling_tests_object_none_return: