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>
This commit is contained in:
Simon Glass
2020-05-10 12:52:45 -06:00
committed by Tom Rini
parent d934b43a02
commit f91f366bd5
11 changed files with 109 additions and 99 deletions

View File

@@ -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);