Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91c5e29

Browse files
committed
Test Stream::parseFloat() with a huge number of digits
Give a 311-digit number to Stream::parseFloat(). This makes the localvariable `value' overflow to infinity. With so many digits, the numbercannot 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 parent1266b08 commit91c5e29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎test/src/Stream/test_parseFloat.cpp‎

Lines changed: 1 addition & 1 deletion
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)

[8]ページ先頭

©2009-2025 Movatter.jp