summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjakob <jakob@memeware.net>2017-05-10 20:42:36 -0400
committerjakob <jakob@memeware.net>2017-05-10 20:42:36 -0400
commit1885dd37171b1cf95210e7a4850c2179f21a9e08 (patch)
treea7be17e425fea7ec3ac7b1bb8044eb94d873dc4d /test
parentb38a284ffc56e292b79610bbd94ebaf086fb4421 (diff)
eliF entry creation for the archive table
Diffstat (limited to 'test')
-rw-r--r--test/test_encoding.c11
-rw-r--r--test/test_encoding.h1
-rw-r--r--test/test_run.c1
3 files changed, 13 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;
+}
diff --git a/test/test_encoding.h b/test/test_encoding.h
index 8bb66ad..c3369f7 100644
--- a/test/test_encoding.h
+++ b/test/test_encoding.h
@@ -20,3 +20,4 @@
#pragma once
char *test_decode_utf16le(void);
+char *test_encode_utf16le(void);
diff --git a/test/test_run.c b/test/test_run.c
index edccb10..f1dc80e 100644
--- a/test/test_run.c
+++ b/test/test_run.c
@@ -49,6 +49,7 @@ static char *run_all_tests(void) {
mu_run_test(test_table_elif);
mu_run_test(test_table_file);
mu_run_test(test_decode_utf16le);
+ mu_run_test(test_encode_utf16le);
return NULL;
}