summaryrefslogtreecommitdiff
path: root/test/test_encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_encoding.c')
-rw-r--r--test/test_encoding.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_encoding.c b/test/test_encoding.c
index 3502838..a167359 100644
--- a/test/test_encoding.c
+++ b/test/test_encoding.c
@@ -32,3 +32,14 @@ char *test_decode_utf16le(void) {
free(out);
return NULL;
}
+
+
+char *test_encode_utf16le(void) {
+ char *in = "ABC", *out = malloc(8);
+ memset(out, '\xff', 8);
+ utf16le_encode(in, out, 3);
+ mu_assert("UTF16-LE encoding failure",
+ !memcmp(out, "\x41\x00\x42\x00\x43\x00\x00\x00", 8));
+ free(out);
+ return NULL;
+}