diff options
author | Simon Glass <sjg@chromium.org> | 2020-05-10 21:52:45 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-05-19 21:01:47 +0300 |
commit | f91f366bd56ef290b7b1f24a40a8be02c148d6d9 (patch) | |
tree | d7c6b993a6fd5f5a4dea7731855baabde6ff16b1 /test/unicode_ut.c | |
parent | d934b43a0294148267c88f22d47aa2ebd77512a5 (diff) | |
download | u-boot-f91f366bd56ef290b7b1f24a40a8be02c148d6d9.tar.xz |
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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unicode_ut.c b/test/unicode_ut.c index 5f932bffd3..26d96336f3 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); |