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

Commit5445db3

Browse files
committed
Test Stream::parseFloat() with a large number
1 parent8eb4013 commit5445db3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎test/src/Stream/test_parseFloat.cpp‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,16 @@ TEST_CASE ("Testing parseFloat(LookaheadMode lookahead = SKIP_ALL, char ignore =
4545
mock <<"\r\n\t 12.34";
4646
REQUIRE(mock.parseFloat() ==12.34f);
4747
}
48-
WHEN ("A float is provided with too many digits")
48+
WHEN ("A float is provided with too many digits after the decimal point")
4949
{
5050
mock <<"3.1415926535897932384";
5151
REQUIRE(mock.parseFloat() ==Approx(3.141592654f));
5252
}
53+
WHEN ("A float is larger than LONG_MAX")
54+
{
55+
mock <<"602200000000000000000000.00";
56+
REQUIRE(mock.parseFloat() ==Approx(6.022e23f));
57+
}
5358
}
5459

5560
TEST_CASE ("Testing parseFloat(LookaheadMode lookahead = SKIP_NONE, char ignore = NO_IGNORE_CHAR)","[Stream-parseFloat-02]")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp