| 25 | |
| 26 | template <class FLOAT> |
| 27 | static string floatStr(FLOAT n) { |
| 28 | char str[32]; |
| 29 | auto length = WriteFloat(n, str, sizeof(str)); |
| 30 | CHECK(length == strlen(str)); |
| 31 | if (sizeof(FLOAT) >= sizeof(double)) { |
| 32 | // Test for 100% accurate double->string->double round-trip: |
| 33 | CHECK(ParseDouble(str) == n); |
| 34 | } |
| 35 | return string(str); |
| 36 | } |
| 37 | |
| 38 | |
| 39 | #define expectDescription(STR, N) CHECK(floatStr(N) == STR) |
nothing calls this directly
no test coverage detected