Skip to content

Commit

Permalink
debug: Add usage of MBEDTLS_PRINTF_SIZET in print_msg test
Browse files Browse the repository at this point in the history
  • Loading branch information
ronald-cron-arm committed Jan 22, 2024
1 parent bc5d916 commit 81a80d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/suites/test_suite_debug.data
Original file line number Diff line number Diff line change
@@ -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:""
Expand Down
3 changes: 2 additions & 1 deletion tests/suites/test_suite_debug.function
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -77,7 +78,7 @@ 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);

Expand Down

0 comments on commit 81a80d1

Please sign in to comment.