[gobject-introspection] [tests] add tests for guint8 arrays
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] [tests] add tests for guint8 arrays
- Date: Wed, 19 Jan 2011 11:10:38 +0000 (UTC)
commit 639558ad4138dcc228ff898430f8e4c2a29b3ae9
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Jan 19 12:07:49 2011 +0100
[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
tests/gimarshallingtests.c | 14 ++++++++++++++
tests/gimarshallingtests.h | 2 ++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index c37aec4..0960bff 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 d15478f..0605883 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]