From 78fe0ca49bacd47eed36b7977628ebaad65aa92f Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Mon, 22 Jan 2024 08:58:40 +0100 Subject: [PATCH] debug: Add usage of MBEDTLS_PRINTF_SIZET in print_msg test Signed-off-by: Ronald Cron --- tests/suites/test_suite_debug.data | 4 ++-- tests/suites/test_suite_debug.function | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_debug.data b/tests/suites/test_suite_debug.data index 0989e6108933..a51af1acb2d1 100644 --- a/tests/suites/test_suite_debug.data +++ b/tests/suites/test_suite_debug.data @@ -8,10 +8,10 @@ printf "%" MBEDTLS_PRINTF_MS_TIME, 0 printf_int_expr:PRINTF_MS_TIME:sizeof(mbedtls_ms_time_t):0:"0" Debug print msg (threshold 1, level 0) -debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n" +debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2, len=10\n" Debug print msg (threshold 1, level 1) -debug_print_msg_threshold:1:1:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n" +debug_print_msg_threshold:1:1:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2, len=10\n" Debug print msg (threshold 1, level 2) debug_print_msg_threshold:1:2:"MyFile":999:"" diff --git a/tests/suites/test_suite_debug.function b/tests/suites/test_suite_debug.function index 57b8f4e175ae..0b7d59d33282 100644 --- a/tests/suites/test_suite_debug.function +++ b/tests/suites/test_suite_debug.function @@ -144,6 +144,7 @@ void debug_print_msg_threshold(int threshold, int level, char *file, mbedtls_ssl_context ssl; mbedtls_ssl_config conf; struct buffer_data buffer; + size_t len = 10; mbedtls_ssl_init(&ssl); mbedtls_ssl_config_init(&conf); @@ -163,7 +164,8 @@ void debug_print_msg_threshold(int threshold, int level, char *file, mbedtls_debug_set_threshold(threshold); mbedtls_debug_print_msg(&ssl, level, file, line, - "Text message, 2 == %d", 2); + "Text message, 2 == %d, len=%" MBEDTLS_PRINTF_SIZET, + 2, len); TEST_ASSERT(strcmp(buffer.buf, result_str) == 0);