gimarshallingtests: Add test for value array of boxed structs
authorMartin Pitt <martinpitt@gnome.org>
Tue, 18 Dec 2012 21:43:25 +0000 (22:43 +0100)
committerMartin Pitt <martinpitt@gnome.org>
Tue, 18 Dec 2012 21:43:25 +0000 (22:43 +0100)
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
tests/gimarshallingtests.h

index 281f34f..95bb196 100644 (file)
@@ -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):
  */
index 8436634..e4875d6 100644 (file)
@@ -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);