| 1291 | #if defined(UNITY_TEST_ALL_FLOATS_PRINT_OK) && defined(USING_OUTPUT_SPY) |
| 1292 | #ifdef UNITY_INCLUDE_DOUBLE |
| 1293 | static void printFloatValue(float f) |
| 1294 | { |
| 1295 | char expected[18]; |
| 1296 | |
| 1297 | startPutcharSpy(); |
| 1298 | UnityPrintFloat(f); |
| 1299 | |
| 1300 | sprintf(expected, "%.9g", f); |
| 1301 | /* We print all NaN's as "nan", not "-nan" */ |
| 1302 | if (strcmp(expected, "-nan") == 0) strcpy(expected, "nan"); |
| 1303 | |
| 1304 | if (strcmp(expected, getBufferPutcharSpy())) |
| 1305 | { |
| 1306 | /* Fail with diagnostic printing */ |
| 1307 | TEST_ASSERT_EQUAL_PRINT_FLOATING(expected, f); |
| 1308 | } |
| 1309 | } |
| 1310 | #else |
| 1311 | static void printFloatValue(float f) |
| 1312 | { |
no test coverage detected