debug: Add usage of MBEDTLS_PRINTF_SIZET in print_msg test

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2024-01-22 08:58:40 +01:00
parent bc5d9165ae
commit 53b52b76bd
2 changed files with 5 additions and 3 deletions

View File

@ -1,8 +1,8 @@
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:""

View File

@ -57,6 +57,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;
MD_PSA_INIT();
@ -77,7 +78,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);