Skip to content

Commit 78fe0ca

Browse files
debug: Add usage of MBEDTLS_PRINTF_SIZET in print_msg test
Signed-off-by: Ronald Cron <[email protected]>
1 parent 3189752 commit 78fe0ca

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/suites/test_suite_debug.data

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ printf "%" MBEDTLS_PRINTF_MS_TIME, 0
88
printf_int_expr:PRINTF_MS_TIME:sizeof(mbedtls_ms_time_t):0:"0"
99

1010
Debug print msg (threshold 1, level 0)
11-
debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n"
11+
debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2, len=10\n"
1212

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

1616
Debug print msg (threshold 1, level 2)
1717
debug_print_msg_threshold:1:2:"MyFile":999:""

tests/suites/test_suite_debug.function

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ void debug_print_msg_threshold(int threshold, int level, char *file,
144144
mbedtls_ssl_context ssl;
145145
mbedtls_ssl_config conf;
146146
struct buffer_data buffer;
147+
size_t len = 10;
147148

148149
mbedtls_ssl_init(&ssl);
149150
mbedtls_ssl_config_init(&conf);
@@ -163,7 +164,8 @@ void debug_print_msg_threshold(int threshold, int level, char *file,
163164
mbedtls_debug_set_threshold(threshold);
164165

165166
mbedtls_debug_print_msg(&ssl, level, file, line,
166-
"Text message, 2 == %d", 2);
167+
"Text message, 2 == %d, len=%" MBEDTLS_PRINTF_SIZET,
168+
2, len);
167169

168170
TEST_ASSERT(strcmp(buffer.buf, result_str) == 0);
169171

0 commit comments

Comments
 (0)