Skip to content

Commit 22bd5bf

Browse files
committed
tests: shell: Improve compatibility with 64-bit platforms
Use %zu format specifier for size_t type to ensure compatibility with both 32-bit and 64-bit platforms. Signed-off-by: Tim Pambor <[email protected]>
1 parent 2d72d86 commit 22bd5bf

File tree

2 files changed

+2
-2
lines changed
  • tests/subsys/shell

2 files changed

+2
-2
lines changed

tests/subsys/shell/shell/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ ZTEST(sh, test_shell_fprintf)
333333
shell_fprintf(sh, SHELL_VT100_COLOR_DEFAULT, "testing %d %s %c",
334334
1, "2", '3');
335335
buf = shell_backend_dummy_get_output(sh, &size);
336-
zassert_true(size >= sizeof(expect), "Expected size > %u, got %d",
336+
zassert_true(size >= sizeof(expect), "Expected size > %zu, got %zu",
337337
sizeof(expect), size);
338338

339339
/*

tests/subsys/shell/shell_custom_header/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ZTEST(sh, test_shell_fprintf)
4444
shell_fprintf(sh, SHELL_VT100_COLOR_DEFAULT, "testing %d %s %c",
4545
1, "2", '3');
4646
buf = shell_backend_dummy_get_output(sh, &size);
47-
zassert_true(size >= sizeof(expect), "Expected size > %u, got %d",
47+
zassert_true(size >= sizeof(expect), "Expected size > %zu, got %zu",
4848
sizeof(expect), size);
4949

5050
/*

0 commit comments

Comments
 (0)