Skip to content

Commit 81a80d1

Browse files
debug: Add usage of MBEDTLS_PRINTF_SIZET in print_msg test
1 parent bc5d916 commit 81a80d1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/suites/test_suite_debug.data

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Debug print msg (threshold 1, level 0)
2-
debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n"
2+
debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2, len=10\n"
33

44
Debug print msg (threshold 1, level 1)
5-
debug_print_msg_threshold:1:1:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n"
5+
debug_print_msg_threshold:1:1:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2, len=10\n"
66

77
Debug print msg (threshold 1, level 2)
88
debug_print_msg_threshold:1:2:"MyFile":999:""

tests/suites/test_suite_debug.function

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ void debug_print_msg_threshold(int threshold, int level, char *file,
5757
mbedtls_ssl_context ssl;
5858
mbedtls_ssl_config conf;
5959
struct buffer_data buffer;
60+
size_t len = 10;
6061

6162
MD_PSA_INIT();
6263

@@ -77,7 +78,7 @@ void debug_print_msg_threshold(int threshold, int level, char *file,
7778
mbedtls_debug_set_threshold(threshold);
7879

7980
mbedtls_debug_print_msg(&ssl, level, file, line,
80-
"Text message, 2 == %d", 2);
81+
"Text message, 2 == %d, len=%" MBEDTLS_PRINTF_SIZET, 2, len);
8182

8283
TEST_ASSERT(strcmp(buffer.buf, result_str) == 0);
8384

0 commit comments

Comments
 (0)