summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-11-27 11:17:20 -0600
committerTom Rini <trini@konsulko.com>2024-12-02 16:34:30 -0600
commit5c8c0738877e15cfe263c721989969c43ff9e5bf (patch)
tree00a8cdee64150af32ce92b9e7751ce74c2deb3d5
parente46e4d6fd7f969f0e60b0f54b69830da543b0d96 (diff)
test: Adjust print_ut test to use unsigned char
Since char is unsigned on arm64, this test currently fails. It seems better to use unsigned anyway, since 0xff is written into the string at the start. Update the terminator-assert to use a character instead of a byte. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Changes in v6: - Re-introduce Changes in v2: - Use '\0' instead of 0 test/print_ut.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
-rw-r--r--test/common/print.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/common/print.c b/test/common/print.c
index 464e425edee..e3711b10809 100644
--- a/test/common/print.c
+++ b/test/common/print.c
@@ -241,7 +241,7 @@ COMMON_TEST(print_display_buffer, UTF_CONSOLE);
static int print_hexdump_line(struct unit_test_state *uts)
{
- char *linebuf;
+ u8 *linebuf;
u8 *buf;
int i;
@@ -254,10 +254,10 @@ static int print_hexdump_line(struct unit_test_state *uts)
linebuf = map_sysmem(0x400, BUF_SIZE);
memset(linebuf, '\xff', BUF_SIZE);
ut_asserteq(-ENOSPC, hexdump_line(0, buf, 1, 0x10, 0, linebuf, 75));
- ut_asserteq(-1, linebuf[0]);
+ ut_asserteq(0xff, linebuf[0]);
ut_asserteq(0x10, hexdump_line(0, buf, 1, 0x10, 0, linebuf, 76));
- ut_asserteq(0, linebuf[75]);
- ut_asserteq(-1, linebuf[76]);
+ ut_asserteq('\0', linebuf[75]);
+ ut_asserteq(0xff, linebuf[76]);
unmap_sysmem(buf);