Summary: | Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, darin, ggaren, sam | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Chris Dumez
2016-02-25 21:02:15 PST
Created attachment 272293 [details]
Patch
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. Created attachment 272385 [details]
Patch
Comment on attachment 272385 [details] Patch Clearing flags on attachment: 272385 Committed r197225: <http://trac.webkit.org/changeset/197225> All reviewed patches have been landed. Closing bug. |