From: Martin Pitt Date: Tue, 18 Dec 2012 21:43:25 +0000 (+0100) Subject: gimarshallingtests: Add test for value array of boxed structs X-Git-Tag: GOBJECT_INTROSPECTION_1_35_4~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2611eb1a69bfe4a098c60ab8efda32ec443c250c;p=platform%2Fupstream%2Fgobject-introspection.git 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 --- 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);