[gobject-introspection] gimarshallingtests: Add test for value array of boxed structs



commit 2611eb1a69bfe4a098c60ab8efda32ec443c250c
Author: Martin Pitt <martinpitt gnome org>
Date:   Tue Dec 18 22:43:25 2012 +0100

    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(+), 0 deletions(-)
---
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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]