Skip to content

Commit 91c5e29

Browse files
committed
Test Stream::parseFloat() with a huge number of digits
Give a 311-digit number to Stream::parseFloat(). This makes the local variable `value' overflow to infinity. With so many digits, the number cannot be parsed into an integer, not even into an integer stored as a `double'. Note that 40 digits would be enough to unveil this issue on AVR.
1 parent 1266b08 commit 91c5e29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/src/Stream/test_parseFloat.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ TEST_CASE ("Testing parseFloat(LookaheadMode lookahead = SKIP_ALL, char ignore =
4747
}
4848
WHEN ("A float is provided with too many digits after the decimal point")
4949
{
50-
mock << "3.1415926535897932384";
50+
mock << "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870064";
5151
REQUIRE(mock.parseFloat() == Approx(3.141592654f));
5252
}
5353
WHEN ("A float is larger than LONG_MAX")

0 commit comments

Comments
 (0)