summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/gimarshallingtests.c18
-rw-r--r--tests/gimarshallingtests.h4
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 9a533293..7f7abf81 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -1065,6 +1065,24 @@ gi_marshalling_tests_utf8_none_in (const gchar *utf8)
}
/**
+ * gi_marshalling_tests_utf8_as_uint8array_in:
+ * @array: (array length=len) (element-type guint8): Byte data that happens to be UTF-8
+ * @len: Length
+ *
+ * Takes data that happens to be UTF-8 as a byte array, to test
+ * binding conversion from their string type (e.g. JavaScript's
+ * UTF-16) to UTF-8.
+ */
+void
+gi_marshalling_tests_utf8_as_uint8array_in (const guint8 *array,
+ gsize len)
+{
+ gsize orig_len = strlen (GI_MARSHALLING_TESTS_CONSTANT_UTF8);
+ g_assert_cmpint (orig_len, ==, len);
+ g_assert (memcmp (GI_MARSHALLING_TESTS_CONSTANT_UTF8, array, len) == 0);
+}
+
+/**
* gi_marshalling_tests_utf8_none_out:
* @utf8: (out) (transfer none):
*/
diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h
index 23af6a52..840f763b 100644
--- a/tests/gimarshallingtests.h
+++ b/tests/gimarshallingtests.h
@@ -267,6 +267,10 @@ void gi_marshalling_tests_utf8_full_inout (gchar **utf8);
GSList *gi_marshalling_tests_filename_list_return (void);
+void gi_marshalling_tests_utf8_as_uint8array_in (const guint8 *array,
+ gsize len);
+
+
/* Enum */
typedef enum