Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Unified Diff: Source/WebKit/chromium/tests/DecimalTest.cpp

Issue 10786036: Merge 122552 - REGRESSION(r119948): [Forms] Spin button Up/Down actions make value to zero for inpu… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/platform/Decimal.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/DecimalTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/DecimalTest.cpp (revision 122851)
+++ Source/WebKit/chromium/tests/DecimalTest.cpp (working copy)
@@ -211,12 +211,14 @@
TEST_F(DecimalTest, Ceiling)
{
EXPECT_EQ(Decimal(1), Decimal(1).ceiling());
+ EXPECT_EQ(Decimal(1), encode(1, -10, Positive).ceiling());
EXPECT_EQ(Decimal(2), encode(11, -1, Positive).ceiling());
EXPECT_EQ(Decimal(2), encode(13, -1, Positive).ceiling());
EXPECT_EQ(Decimal(2), encode(15, -1, Positive).ceiling());
EXPECT_EQ(Decimal(2), encode(19, -1, Positive).ceiling());
EXPECT_EQ(Decimal(-1), Decimal(-1).ceiling());
+ EXPECT_EQ(Decimal(0), encode(1, -10, Negative).ceiling());
EXPECT_EQ(Decimal(-1), encode(11, -1, Negative).ceiling());
EXPECT_EQ(Decimal(-1), encode(13, -1, Negative).ceiling());
EXPECT_EQ(Decimal(-1), encode(15, -1, Negative).ceiling());
@@ -525,12 +527,14 @@
TEST_F(DecimalTest, Floor)
{
EXPECT_EQ(Decimal(1), Decimal(1).floor());
+ EXPECT_EQ(Decimal(0), encode(1, -10, Positive).floor());
EXPECT_EQ(Decimal(1), encode(11, -1, Positive).floor());
EXPECT_EQ(Decimal(1), encode(13, -1, Positive).floor());
EXPECT_EQ(Decimal(1), encode(15, -1, Positive).floor());
EXPECT_EQ(Decimal(1), encode(19, -1, Positive).floor());
EXPECT_EQ(Decimal(-1), Decimal(-1).floor());
+ EXPECT_EQ(Decimal(-1), encode(1, -10, Negative).floor());
EXPECT_EQ(Decimal(-2), encode(11, -1, Negative).floor());
EXPECT_EQ(Decimal(-2), encode(13, -1, Negative).floor());
EXPECT_EQ(Decimal(-2), encode(15, -1, Negative).floor());
« no previous file with comments | « Source/WebCore/platform/Decimal.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698