From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>, Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [v6 02/12] test: Adjust print_ut test to use unsigned char
Date: Wed, 27 Nov 2024 11:17:20 -0600 [thread overview]
Message-ID: <20241127172247.1488685-3-trini@konsulko.com> (raw)
In-Reply-To: <20241127172247.1488685-1-trini@konsulko.com>
From: Simon Glass <sjg@chromium.org>
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(-)
---
test/common/print.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/common/print.c b/test/common/print.c
index 464e425edee5..e3711b108091 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);
--
2.43.0
next prev parent reply other threads:[~2024-11-27 17:23 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 17:17 [v6 0/12] CI: Set up for an arm64 runner Tom Rini
2024-11-27 17:17 ` [v6 01/12] sandbox: efi_loader: Correct use of addresses as pointers Tom Rini
2024-11-27 18:40 ` Heinrich Schuchardt
2024-11-27 18:51 ` Tom Rini
2024-11-27 19:13 ` Heinrich Schuchardt
2024-11-27 19:38 ` Heinrich Schuchardt
2024-11-27 21:09 ` Simon Glass
2024-11-27 21:14 ` Tom Rini
2024-11-30 20:24 ` Simon Glass
2024-11-27 17:17 ` Tom Rini [this message]
2024-11-27 17:17 ` [v6 03/12] docker: Add kernel.org x86_64 toolchain Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 04/12] docker: Use "make -j$(nproc)" when invoking make Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 05/12] docker: Update to grub-2.12 Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 06/12] docker: Build grub for all architectures Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 07/12] docker: Use cache mounts for apt Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 08/12] docker: Support building for multiple architectures Tom Rini
2024-11-27 17:17 ` [v6 09/12] docker: Adjust installed packages slightly Tom Rini
2024-11-27 17:17 ` [v6 10/12] docker: Fix LegacyKeyValueFormat warning with PYTHONPATH Tom Rini
2024-11-27 17:17 ` [v6 11/12] docker: Install toolchains on arm64 host Tom Rini
2024-11-27 17:17 ` [v6 12/12] CI: Add platform variable Tom Rini
2024-12-03 19:57 ` [v6 0/12] CI: Set up for an arm64 runner Tom Rini
2024-12-17 19:45 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241127172247.1488685-3-trini@konsulko.com \
--to=trini@konsulko.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox