Merge pull request #8243 from gebart/pr/tests-snprintf

unittests: Fix printf float test BUFSIZE
This commit is contained in:
Sebastian Meiling 2017-12-19 14:08:46 +01:00 committed by GitHub
commit b151f95b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,7 @@
#include "tests-printf_float.h"
#define BUFSIZE (10)
#define BUFSIZE (12)
static const double in0 = 2016.0349;
static const double in1 = 123.4567;
@ -37,7 +37,7 @@ static void sfprintf_float(void)
char *str = tmp;
snprintf(str, BUFSIZE, "%f", in0);
TEST_ASSERT_EQUAL_STRING("2016.0349", str);
TEST_ASSERT_EQUAL_STRING("2016.034900", str);
snprintf(str, BUFSIZE, "%.2f", in0);
TEST_ASSERT_EQUAL_STRING("2016.03", str);