diff options
author | Martin Pitt <martinpitt@gnome.org> | 2012-12-18 22:43:25 +0100 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2012-12-18 22:43:25 +0100 |
commit | 2611eb1a69bfe4a098c60ab8efda32ec443c250c (patch) | |
tree | 02147990f07d3c7cb6df16d5c3f372b688d24022 | |
parent | aae598e1e60aad3d30b21c398f55e9b6944be971 (diff) | |
download | gobject-introspection-2611eb1a69bfe4a098c60ab8efda32ec443c250c.tar.gz |
gimarshallingtests: Add test for value array of boxed structs
We already have tests for "array of simple structs"
(gi_marshalling_tests_array_simple_struct_in) and "array of pointers to
boxed structs" (gi_marshalling_tests_array_struct_in), but were missing
"array of boxed structs", which reproduces
https://bugzilla.gnome.org/show_bug.cgi?id=656312
-rw-r--r-- | tests/gimarshallingtests.c | 13 | ||||
-rw-r--r-- | tests/gimarshallingtests.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 281f34f3..95bb196e 100644 --- a/tests/gimarshallingtests.c +++ b/tests/gimarshallingtests.c @@ -1382,6 +1382,19 @@ gi_marshalling_tests_array_struct_in (GIMarshallingTestsBoxedStruct **structs, g } /** + * gi_marshalling_tests_array_struct_value_in: + * @structs: (array length=length): + */ +void +gi_marshalling_tests_array_struct_value_in (GIMarshallingTestsBoxedStruct *structs, gint length) +{ + g_assert_cmpint(length, ==, 3); + g_assert_cmpint(structs[0].long_, ==, 1); + g_assert_cmpint(structs[1].long_, ==, 2); + g_assert_cmpint(structs[2].long_, ==, 3); +} + +/** * gi_marshalling_tests_array_simple_struct_in: * @structs: (array length=length): */ diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h index 84366346..e4875d6e 100644 --- a/tests/gimarshallingtests.h +++ b/tests/gimarshallingtests.h @@ -389,6 +389,7 @@ void gi_marshalling_tests_array_in_len_zero_terminated (const gint *ints, gint l void gi_marshalling_tests_array_string_in (const gchar **strings, gint length); void gi_marshalling_tests_array_uint8_in (const guint8 *chars, gint length); void gi_marshalling_tests_array_struct_in (GIMarshallingTestsBoxedStruct **structs, gint length); +void gi_marshalling_tests_array_struct_value_in (GIMarshallingTestsBoxedStruct *structs, gint length); void gi_marshalling_tests_array_struct_take_in (GIMarshallingTestsBoxedStruct **structs, gint length); void gi_marshalling_tests_array_simple_struct_in (GIMarshallingTestsSimpleStruct *structs, gint length); void gi_marshalling_tests_multi_array_key_value_in (gint length, const gchar **keys, const GValue *values); |