aboutsummaryrefslogtreecommitdiff
path: root/test/unicode_ut.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-05-10 12:52:45 -0600
committerTom Rini <trini@konsulko.com>2020-05-19 14:01:47 -0400
commitf91f366bd56ef290b7b1f24a40a8be02c148d6d9 (patch)
treed7c6b993a6fd5f5a4dea7731855baabde6ff16b1 /test/unicode_ut.c
parentd934b43a0294148267c88f22d47aa2ebd77512a5 (diff)
downloadu-boot-f91f366bd56ef290b7b1f24a40a8be02c148d6d9.zip
u-boot-f91f366bd56ef290b7b1f24a40a8be02c148d6d9.tar.gz
u-boot-f91f366bd56ef290b7b1f24a40a8be02c148d6d9.tar.bz2
test: Use ut_asserteq_mem() where possible
Quite a few tests still use ut_assertok(memcmp(...)) and variants. Modify them to use the macro designed for this purpose. Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Diffstat (limited to 'test/unicode_ut.c')
-rw-r--r--test/unicode_ut.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unicode_ut.c b/test/unicode_ut.c
index 5f932bf..26d9633 100644
--- a/test/unicode_ut.c
+++ b/test/unicode_ut.c
@@ -67,8 +67,9 @@ static int unicode_test_u16_strdup(struct unit_test_state *uts)
u16 *copy = u16_strdup(c4);
ut_assert(copy != c4);
- ut_assert(!memcmp(copy, c4, sizeof(c4)));
+ ut_asserteq_mem(copy, c4, sizeof(c4));
free(copy);
+
return 0;
}
UNICODE_TEST(unicode_test_u16_strdup);
@@ -80,7 +81,8 @@ static int unicode_test_u16_strcpy(struct unit_test_state *uts)
r = u16_strcpy(copy, c1);
ut_assert(r == copy);
- ut_assert(!memcmp(copy, c1, sizeof(c1)));
+ ut_asserteq_mem(copy, c1, sizeof(c1));
+
return 0;
}
UNICODE_TEST(unicode_test_u16_strcpy);