summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-06-01 12:31:15 +0200
committerMartin Pitt <martinpitt@gnome.org>2012-06-01 12:31:15 +0200
commit932bf2a700368e46b30b58ec9b6beb3ff09a081c (patch)
tree27fc12be71e5b37a6e6245e202afb978b7f7b3f0
parent784b60e85561a3b4a98e33df159a77ae2daef1c7 (diff)
downloadgobject-introspection-932bf2a700368e46b30b58ec9b6beb3ff09a081c.tar.gz
tests: Add vfunc taking a caller-allocated out parameter
This reproduces https://bugzilla.gnome.org/show_bug.cgi?id=653151
-rw-r--r--tests/gimarshallingtests.c13
-rw-r--r--tests/gimarshallingtests.h7
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 9d58e260..aa78154a 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -4020,6 +4020,19 @@ gi_marshalling_tests_object_vfunc_multiple_out_parameters (GIMarshallingTestsObj
}
/**
+ * gi_marshalling_tests_object_vfunc_caller_allocated_out_parameter:
+ * @a: (out):
+ */
+void
+gi_marshalling_tests_object_vfunc_caller_allocated_out_parameter (GIMarshallingTestsObject *self, GValue *a)
+{
+ /* make sure that local variables don't get smashed */
+ gulong local = 0x12345678;
+ GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_caller_allocated_out_parameter (self, a);
+ g_assert_cmpint(local, ==, 0x12345678);
+}
+
+/**
* gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter:
* @a: (out):
*/
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index 2c022c6d..7300b2ad 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -735,6 +735,12 @@ struct _GIMarshallingTestsObjectClass
void (* vfunc_multiple_out_parameters) (GIMarshallingTestsObject *self, gfloat *a, gfloat *b);
/**
+ * GIMarshallingTestsObjectClass::vfunc_caller_allocated_out_parameter:
+ * @a: (out):
+ */
+ void (* vfunc_caller_allocated_out_parameter) (GIMarshallingTestsObject *self, GValue *a);
+
+ /**
* GIMarshallingTestsObjectClass::vfunc_return_value_and_one_out_parameter:
* @a: (out):
*/
@@ -780,6 +786,7 @@ void gi_marshalling_tests_object_method_with_default_implementation (GIMarshalli
glong gi_marshalling_tests_object_vfunc_return_value_only (GIMarshallingTestsObject *self);
void gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObject *self, gfloat *a);
void gi_marshalling_tests_object_vfunc_multiple_out_parameters (GIMarshallingTestsObject *self, gfloat *a, gfloat *b);
+void gi_marshalling_tests_object_vfunc_caller_allocated_out_parameter (GIMarshallingTestsObject *self, GValue *a);
glong gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter (GIMarshallingTestsObject *self, glong *a);
glong gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters (GIMarshallingTestsObject *self, glong *a, glong *b);
gboolean gi_marshalling_tests_object_vfunc_meth_with_error (GIMarshallingTestsObject *object, gint x, GError **error);