summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Casal Quinteiro <icq@gnome.org>2011-01-19 12:07:49 +0100
committerIgnacio Casal Quinteiro <icq@gnome.org>2011-01-19 12:07:49 +0100
commit639558ad4138dcc228ff898430f8e4c2a29b3ae9 (patch)
tree01175b643cbe72655148d736e8af34725a89f8ff
parentf86575f337c6dce9a67b606712395d83bf8bfb92 (diff)
downloadgobject-introspection-639558ad4138dcc228ff898430f8e4c2a29b3ae9.tar.gz
[tests] add tests for guint8 arrays
* guint8 can be interpreted as array characters that can be memcpyied during marshalling so add a test to check if we are correctly handling this codepath
-rw-r--r--tests/gimarshallingtests.c14
-rw-r--r--tests/gimarshallingtests.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index c37aec49..0960bff2 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -1225,6 +1225,20 @@ gi_marshalling_tests_array_in (const gint *ints, gint length)
}
/**
+ * gi_marshalling_tests_array_uint8_in:
+ * @chars: (array length=length):
+ */
+void
+gi_marshalling_tests_array_uint8_in (const guint8 *chars, gint length)
+{
+ g_assert(length == 4);
+ g_assert(chars[0] == 'a');
+ g_assert(chars[1] == 'b');
+ g_assert(chars[2] == 'c');
+ g_assert(chars[3] == 'd');
+}
+
+/**
* gi_marshalling_tests_array_out:
* @ints: (out) (array length=length) (transfer none):
*/
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index d15478f6..06058839 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -281,6 +281,8 @@ const gint *gi_marshalling_tests_array_return (gint *length);
void gi_marshalling_tests_array_in (const gint *ints, gint length);
+void gi_marshalling_tests_array_uint8_in (const guint8 *chars, gint length);
+
void gi_marshalling_tests_array_out (gint **ints, gint *length);
void gi_marshalling_tests_array_inout (gint **ints, gint *length);