summaryrefslogtreecommitdiff
path: root/tests/gimarshallingtests.h
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-01-02 02:14:08 -0800
committerSimon Feltman <sfeltman@src.gnome.org>2013-01-30 16:39:36 -0800
commit1fb2d14693fc7ecf74322c7f9ca7ca40907e7649 (patch)
tree2641a8efe8e94a4728f14e9132ccc6518a65464b /tests/gimarshallingtests.h
parent7878dd0b7c172c5defdc6e1079b6542b2756e42e (diff)
downloadgobject-introspection-1fb2d14693fc7ecf74322c7f9ca7ca40907e7649.tar.gz
gimarshallingtests: Add test helpers for marshaling of object arguments
Add a number of vfuncs and methods which can be used for testing marshaling of objects with different combinations of ownership transference. An important part of these test vfuncs and methods is they do not pass object returns and arguments through them. Instead the methods return reference counts and floating attributes. This allows isolation and ensures any problem with round trip object marshaling does not obscure what should be tested from the perspective of C as the caller of a vfunc. Tests and vfuncs can then be written in any language with gi bindings. https://bugzilla.gnome.org/show_bug.cgi?id=687522
Diffstat (limited to 'tests/gimarshallingtests.h')
-rw-r--r--tests/gimarshallingtests.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index 803b02c7..82137a75 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -803,6 +803,47 @@ struct _GIMarshallingTestsObjectClass
* @error: A #GError
*/
gboolean (*vfunc_meth_with_err) (GIMarshallingTestsObject *object, gint x, GError **error);
+
+
+ /**
+ * GIMarshallingTestsObjectClass::vfunc_return_object_transfer_none:
+ *
+ * Returns: (transfer none)
+ */
+ GObject* (* vfunc_return_object_transfer_none) (GIMarshallingTestsObject *self);
+
+ /**
+ * GIMarshallingTestsObjectClass::vfunc_return_object_tansfer_full:
+ *
+ * Returns: (transfer full)
+ */
+ GObject* (* vfunc_return_object_tansfer_full) (GIMarshallingTestsObject *self);
+
+ /**
+ * GIMarshallingTestsObjectClass::vfunc_out_object_transfer_none:
+ * @object: (out) (transfer none):
+ */
+ void (* vfunc_out_object_transfer_none) (GIMarshallingTestsObject *self, GObject **object);
+
+ /**
+ * GIMarshallingTestsObjectClass::vfunc_out_object_tansfer_full:
+ * @object: (out) (transfer full):
+ */
+ void (* vfunc_out_object_tansfer_full) (GIMarshallingTestsObject *self, GObject **object);
+
+ /**
+ * GIMarshallingTestsObjectClass::vfunc_in_object_tansfer_none:
+ * @object: (in) (transfer none):
+ */
+ void (* vfunc_in_object_tansfer_none) (GIMarshallingTestsObject *self, GObject *object);
+
+ /**
+ * GIMarshallingTestsObjectClass::vfunc_in_object_tansfer_full:
+ * @object: (in) (transfer full):
+ */
+ void (* vfunc_in_object_tansfer_full) (GIMarshallingTestsObject *self, GObject *object);
+
+
};
struct _GIMarshallingTestsObject
@@ -840,6 +881,13 @@ glong gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter (GIMa
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);
+void gi_marshalling_tests_object_get_ref_info_for_vfunc_return_object_transfer_none (GIMarshallingTestsObject *self, guint *ref_count, gboolean *is_floating);
+void gi_marshalling_tests_object_get_ref_info_for_vfunc_return_object_transfer_full (GIMarshallingTestsObject *self, guint *ref_count, gboolean *is_floating);
+void gi_marshalling_tests_object_get_ref_info_for_vfunc_out_object_transfer_none (GIMarshallingTestsObject *self, guint *ref_count, gboolean *is_floating);
+void gi_marshalling_tests_object_get_ref_info_for_vfunc_out_object_transfer_full (GIMarshallingTestsObject *self, guint *ref_count, gboolean *is_floating);
+void gi_marshalling_tests_object_get_ref_info_for_vfunc_in_object_transfer_none (GIMarshallingTestsObject *self, GType type, guint *ref_count, gboolean *is_floating);
+void gi_marshalling_tests_object_get_ref_info_for_vfunc_in_object_transfer_full (GIMarshallingTestsObject *self, GType type, guint *ref_count, gboolean *is_floating);
+
GIMarshallingTestsObject *gi_marshalling_tests_object_none_return (void);
GIMarshallingTestsObject *gi_marshalling_tests_object_full_return (void);
@@ -1085,6 +1133,7 @@ struct _GIMarshallingTestsPropertiesObject {
GIMarshallingTestsBoxedStruct* some_boxed_struct;
GList* some_boxed_glist;
GVariant *some_variant;
+ GObject *some_object;
};
struct _GIMarshallingTestsPropertiesObjectClass {