Skip to content
Snippets Groups Projects
Unverified Commit b151f95b authored by Sebastian Meiling's avatar Sebastian Meiling Committed by GitHub
Browse files

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

unittests: Fix printf float test BUFSIZE
parents ac99782d b55975fc
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "tests-printf_float.h" #include "tests-printf_float.h"
#define BUFSIZE (10) #define BUFSIZE (12)
static const double in0 = 2016.0349; static const double in0 = 2016.0349;
static const double in1 = 123.4567; static const double in1 = 123.4567;
...@@ -37,7 +37,7 @@ static void sfprintf_float(void) ...@@ -37,7 +37,7 @@ static void sfprintf_float(void)
char *str = tmp; char *str = tmp;
snprintf(str, BUFSIZE, "%f", in0); snprintf(str, BUFSIZE, "%f", in0);
TEST_ASSERT_EQUAL_STRING("2016.0349", str); TEST_ASSERT_EQUAL_STRING("2016.034900", str);
snprintf(str, BUFSIZE, "%.2f", in0); snprintf(str, BUFSIZE, "%.2f", in0);
TEST_ASSERT_EQUAL_STRING("2016.03", str); TEST_ASSERT_EQUAL_STRING("2016.03", str);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment