RESOLVED FIXED 154714
Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
https://bugs.webkit.org/show_bug.cgi?id=154714
Summary Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
Chris Dumez
Reported 2016-02-25 21:02:15 PST
Attachments
Patch (16.88 KB, patch)
2016-02-25 21:05 PST, Chris Dumez
no flags
Patch (17.89 KB, patch)
2016-02-26 17:12 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-02-25 21:05:37 PST
Darin Adler
Comment 2 2016-02-26 07:52:13 PST
Comment on attachment 272293 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272293&action=review > Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:72 > + // Boundaries. > + EXPECT_EQ(-2147483648, testParseHTMLInteger("-2147483648")); > + EXPECT_EQ(2147483647, testParseHTMLInteger("2147483647")); We should include failure case tests that are just outside the boundaries: -2147483649, 2147483648. And maybe some other "too long number" tests. > Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:74 > + // Failure cases. Might be good to also include expected failures that are legal floating point numbers such as "1.0", "1.", "1e1", ".1", "infinity". Some ways of implementing this might accidentally allow those. > Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:124 > + EXPECT_EQ(4294967295u, testParseHTMLNonNegativeInteger("4294967295")); We should include a failure case test that is just outside the boundary: 4294967296. > Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:126 > + // Failure cases. Might be good to also include expected failures that are legal floating point numbers such as "1.0", "1.", "1e1", ".1", "infinity". Some ways of implementing this might accidentally allow those.
Chris Dumez
Comment 3 2016-02-26 17:12:57 PST
WebKit Commit Bot
Comment 4 2016-02-26 18:03:13 PST
Comment on attachment 272385 [details] Patch Clearing flags on attachment: 272385 Committed r197225: <http://trac.webkit.org/changeset/197225>
WebKit Commit Bot
Comment 5 2016-02-26 18:03:18 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.