From 2611eb1a69bfe4a098c60ab8efda32ec443c250c Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 18 Dec 2012 22:43:25 +0100 Subject: [PATCH] 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 --- tests/gimarshallingtests.c | 13 +++++++++++++ tests/gimarshallingtests.h | 1 + 2 files changed, 14 insertions(+) diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c index 281f34f..95bb196 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 8436634..e4875d6 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); -- 2.7.4