tests: Add vfunc taking a caller-allocated out parameter
authorMartin Pitt <martinpitt@gnome.org>
Fri, 1 Jun 2012 10:31:15 +0000 (12:31 +0200)
committerMartin Pitt <martinpitt@gnome.org>
Fri, 1 Jun 2012 10:31:15 +0000 (12:31 +0200)
This reproduces
https://bugzilla.gnome.org/show_bug.cgi?id=653151

tests/gimarshallingtests.c
tests/gimarshallingtests.h

index 9d58e26..aa78154 100644 (file)
@@ -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):
  */
index 2c022c6..7300b2a 100644 (file)
@@ -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);