diff options
author | Simon McVittie <smcv@debian.org> | 2020-08-23 16:50:30 +0100 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2020-09-19 21:55:32 -0700 |
commit | 3e2cca38b6b923fad018b56ab5f497a208170159 (patch) | |
tree | a1fc834c46db8490ca488fd7bef31a3970d45d12 /tests/gimarshallingtests.c | |
parent | 7c9edf260b7c58a1587aa9b31c9f747bd6964487 (diff) | |
download | gobject-introspection-3e2cca38b6b923fad018b56ab5f497a208170159.tar.gz |
tests: Add a test-case for a vfunc returning flags in different ways
We already had a test for enums, but flags are not precisely the same,
so testing both can give bindings better coverage.
Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'tests/gimarshallingtests.c')
-rw-r--r-- | tests/gimarshallingtests.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 53c17818..fbb1273e 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -4767,6 +4767,33 @@ gi_marshalling_tests_object_vfunc_out_enum (GIMarshallingTestsObject *self, GIMa g_assert_cmpint (local, ==, 0x12345678); } +/** + * gi_marshalling_tests_object_vfunc_return_flags: + */ +GIMarshallingTestsFlags +gi_marshalling_tests_object_vfunc_return_flags (GIMarshallingTestsObject *self) +{ + /* make sure that local variables don't get smashed */ + GIMarshallingTestsFlags return_value; + glong local = 0x12345678; + return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_flags (self); + g_assert_cmpint (local, ==, 0x12345678); + return return_value; +} + +/** + * gi_marshalling_tests_object_vfunc_out_flags: + * @flags: (out): + */ +void +gi_marshalling_tests_object_vfunc_out_flags (GIMarshallingTestsObject *self, GIMarshallingTestsFlags *flags) +{ + /* make sure that local variables don't get smashed */ + gulong local = 0x12345678; + GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_out_flags (self, flags); + g_assert_cmpuint (local, ==, 0x12345678); +} + /* NOTE: * |