aboutsummaryrefslogtreecommitdiff
path: root/test/unicode_ut.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-07-14 17:47:46 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-07-16 22:17:23 +0000
commit02b31dce934d64edf26c3757fb5749f83eae621e (patch)
treefb5ed9a4d6221c0eba7e04835604f45931fe49bd /test/unicode_ut.c
parent317068b8b6b15ad38f7aa1019310e41764c80e5b (diff)
downloadu-boot-02b31dce934d64edf26c3757fb5749f83eae621e.zip
u-boot-02b31dce934d64edf26c3757fb5749f83eae621e.tar.gz
u-boot-02b31dce934d64edf26c3757fb5749f83eae621e.tar.bz2
test: unit test for u16_strlen()
Provide a unit test for u16_strlen(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'test/unicode_ut.c')
-rw-r--r--test/unicode_ut.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unicode_ut.c b/test/unicode_ut.c
index 8e1efe6..1ccd36e 100644
--- a/test/unicode_ut.c
+++ b/test/unicode_ut.c
@@ -50,6 +50,16 @@ static const char j1[] = {0x6a, 0x31, 0xa1, 0x6c, 0x00};
static const char j2[] = {0x6a, 0x32, 0xc3, 0xc3, 0x6c, 0x00};
static const char j3[] = {0x6a, 0x33, 0xf0, 0x90, 0xf0, 0x00};
+static int unicode_test_u16_strlen(struct unit_test_state *uts)
+{
+ ut_asserteq(6, u16_strlen(c1));
+ ut_asserteq(8, u16_strlen(c2));
+ ut_asserteq(3, u16_strlen(c3));
+ ut_asserteq(6, u16_strlen(c4));
+ return 0;
+}
+UNICODE_TEST(unicode_test_u16_strlen);
+
static int unicode_test_u16_strdup(struct unit_test_state *uts)
{
u16 *copy = u16_strdup(c4);