diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2012-01-04 21:37:48 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2012-02-03 11:52:33 -0500 |
commit | b46da5f5e37e9748f6aa657fb5d49beaca7e5f0b (patch) | |
tree | 2ee7e5f7d372f79c95da06ecc3b7c1656d9c2027 /tests/gimarshallingtests.c | |
parent | 6920430e7034bba42258c7b010347037b1641fb1 (diff) | |
download | gobject-introspection-b46da5f5e37e9748f6aa657fb5d49beaca7e5f0b.tar.gz |
tests: Add marshalling tests for various kinds of vfunc callbacks
To make sure that bindings can sanely deal with multiple kinds
of callbacks, let's test some behaviors.
Diffstat (limited to 'tests/gimarshallingtests.c')
-rw-r--r-- | tests/gimarshallingtests.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 5eb33880..b57f36d3 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -3810,6 +3810,76 @@ gi_marshalling_tests_object_int8_out (GIMarshallingTestsObject *object, gint8 *o gi_marshalling_tests_object_method_int8_out (object, out); } +/** + * gi_marshalling_tests_object_vfunc_return_value_only: + */ +glong +gi_marshalling_tests_object_vfunc_return_value_only (GIMarshallingTestsObject *self) +{ + /* make sure that local variables don't get smashed */ + glong return_value; + gulong local = 0x12345678; + return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_only (self); + g_assert_cmpint(local, ==, 0x12345678); + return return_value; +} + +/** + * gi_marshalling_tests_object_vfunc_one_out_parameter: + * @a: (out): + */ +void +gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObject *self, gfloat *a) +{ + /* make sure that local variables don't get smashed */ + gulong local = 0x12345678; + GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_one_out_parameter (self, a); + g_assert_cmpint(local, ==, 0x12345678); +} + +/** + * gi_marshalling_tests_object_vfunc_multiple_out_parameters: + * @a: (out): + * @b: (out): + */ +void +gi_marshalling_tests_object_vfunc_multiple_out_parameters (GIMarshallingTestsObject *self, gfloat *a, gfloat *b) +{ + /* make sure that local variables don't get smashed */ + gulong local = 0x12345678; + GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_multiple_out_parameters (self, a, b); + g_assert_cmpint(local, ==, 0x12345678); +} + +/** + * gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter: + * @a: (out): + */ +glong +gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter (GIMarshallingTestsObject *self, glong *a) +{ + /* make sure that local variables don't get smashed */ + gulong return_value; + gulong local = 0x12345678; + return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_and_one_out_parameter (self, a); + g_assert_cmpint(local, ==, 0x12345678); + return return_value; +} + +/** + * gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters: + * @a: (out): + * @b: (out): + */ +glong +gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters (GIMarshallingTestsObject *self, glong *a, glong *b) +{ + gulong return_value; + gulong local = 0x12345678; + return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_and_multiple_out_parameters (self, a, b); + g_assert_cmpint(local, ==, 0x12345678); + return return_value; +} G_DEFINE_TYPE (GIMarshallingTestsSubObject, gi_marshalling_tests_sub_object, GI_MARSHALLING_TESTS_TYPE_OBJECT); |