Skip to content

Commit 9ca69cf

Browse files
authored
Merge pull request #11925 from rajkan01/feature-gt-bare-metal-minimal-printf
Fixed greentea minimal-printf test for microlib
2 parents 959f410 + 2fa57d6 commit 9ca69cf

File tree

1 file changed

+5
-0
lines changed
  • TESTS/mbed_platform/minimal-printf/compliance

1 file changed

+5
-0
lines changed

TESTS/mbed_platform/minimal-printf/compliance/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,11 +856,16 @@ static control_t test_snprintf_buffer_overflow_generic(const char *fmt, T data)
856856
char buffer_minimal[buf_size];
857857
int result_baseline;
858858
int result_minimal;
859+
#if !defined(__MICROLIB)
860+
// Microlib snprintf always returns zero if the size
861+
// to copy from the buffer is zero.
862+
// See reported microlib bug SDCOMP-54710
859863

860864
/* empty buffer test */
861865
result_minimal = mbed_snprintf(buffer_minimal, 0, fmt, data);
862866
result_baseline = snprintf(buffer_baseline, 0, fmt, data);
863867
TEST_ASSERT_EQUAL_INT(result_baseline, result_minimal);
868+
#endif
864869

865870
/* buffer isn't large enough, output needs to be truncated */
866871
result_minimal = mbed_snprintf(buffer_minimal, buf_size - 2, fmt, data);

0 commit comments

Comments
 (0)