Skip to content

Commit cc90cfe

Browse files
tpamborcfriedt
authored andcommitted
tests: logging: 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 cea6bc4 commit cc90cfe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/subsys/logging/log_backend_uart/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ZTEST_F(log_backend_uart, test_log_backend_uart_multi_instance)
6868

6969
tx_len = uart_emul_get_tx_data(fixture->dev[i], tx_content, sizeof(tx_content));
7070
zassert_equal(tx_len, strlen(TEST_DATA),
71-
"%d: TX buffer length does not match. Expected %d, got %d",
71+
"%zu: TX buffer length does not match. Expected %zu, got %zu",
7272
i, strlen(TEST_DATA), tx_len);
7373
zassert_mem_equal(tx_content, TEST_DATA, strlen(TEST_DATA));
7474
}

tests/subsys/logging/log_core_additional/src/log_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ ZTEST(test_log_core_additional, test_log_early_logging)
300300
}
301301

302302
zassert_equal(backend1_cb.total_logs, backend1_cb.counter,
303-
"Unexpected amount of messages received. %d",
303+
"Unexpected amount of messages received. %zu",
304304
backend1_cb.counter);
305305
}
306306
}

0 commit comments

Comments
 (0)