diff options
Diffstat (limited to 'tests/gimarshallingtests.c')
-rw-r--r-- | tests/gimarshallingtests.c | 70 |
1 files changed, 64 insertions, 6 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 92868016..53c17818 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -3167,13 +3167,13 @@ gi_marshalling_tests_ghashtable_double_in (GHashTable *hash_table) double *value; value = g_hash_table_lookup (hash_table, "-1"); - g_assert_cmpfloat (*value, ==, -0.1); + g_assert_cmpfloat_with_epsilon (*value, -0.1, 0.01); value = g_hash_table_lookup (hash_table, "0"); g_assert_cmpfloat (*value, ==, 0.0); value = g_hash_table_lookup (hash_table, "1"); - g_assert_cmpfloat (*value, ==, 0.1); + g_assert_cmpfloat_with_epsilon (*value, 0.1, 0.01); value = g_hash_table_lookup (hash_table, "2"); - g_assert_cmpfloat (*value, ==, 0.2); + g_assert_cmpfloat_with_epsilon (*value, 0.2, 0.01); } /** @@ -3188,13 +3188,13 @@ gi_marshalling_tests_ghashtable_float_in (GHashTable *hash_table) float *value; value = g_hash_table_lookup (hash_table, "-1"); - g_assert_cmpfloat (*value, ==, -0.1f); + g_assert_cmpfloat_with_epsilon (*value, -0.1f, 0.01f); value = g_hash_table_lookup (hash_table, "0"); g_assert_cmpfloat (*value, ==, 0.0f); value = g_hash_table_lookup (hash_table, "1"); - g_assert_cmpfloat (*value, ==, 0.1f); + g_assert_cmpfloat_with_epsilon (*value, 0.1f, 0.01f); value = g_hash_table_lookup (hash_table, "2"); - g_assert_cmpfloat (*value, ==, 0.2f); + g_assert_cmpfloat_with_epsilon (*value, 0.2f, 0.01f); } /** @@ -4584,6 +4584,33 @@ gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObject *s } /** + * gi_marshalling_tests_object_vfunc_one_inout_parameter: + * @a: (inout): + */ +void +gi_marshalling_tests_object_vfunc_one_inout_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_inout_parameter (self, a); + g_assert_cmpint (local, ==, 0x12345678); +} + +/** + * gi_marshalling_tests_object_vfunc_multiple_inout_parameters: + * @a: (inout): + * @b: (inout): + */ +void +gi_marshalling_tests_object_vfunc_multiple_inout_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_inout_parameters (self, a, b); + g_assert_cmpint (local, ==, 0x12345678); +} + +/** * gi_marshalling_tests_object_vfunc_multiple_out_parameters: * @a: (out): * @b: (out): @@ -4652,6 +4679,37 @@ glong } /** + * gi_marshalling_tests_object_vfunc_return_value_and_one_inout_parameter: + * @a: (inout): + */ +glong gi_marshalling_tests_object_vfunc_return_value_and_one_inout_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_inout_parameter (self, a); + g_assert_cmpint (local, ==, 0x12345678); + return return_value; +} + +/** + * gi_marshalling_tests_object_vfunc_return_value_and_multiple_inout_parameters: + * @a: (inout): + * @b: (inout): + */ +glong + gi_marshalling_tests_object_vfunc_return_value_and_multiple_inout_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_inout_parameters (self, a, b); + g_assert_cmpint (local, ==, 0x12345678); + return return_value; +} + +/** * gi_marshalling_tests_callback_owned_boxed: * @callback: (scope call) (closure callback_data): * @callback_data: (allow-none): |