Changeset 140205 in webkit
- Timestamp:
- Jan 18, 2013 1:56:24 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r140204 r140205 1 2013-01-18 Emil A Eklund <eae@chromium.org> 2 3 Update LayoutUnit rounding unit test 4 https://bugs.webkit.org/show_bug.cgi?id=107322 5 6 Reviewed by Levi Weintraub. 7 8 Update the LayoutUnitRounding test to use fromFloatRound for 9 values that cannot accurately be represented as a LayoutUnit 10 (the default behavior is to floor the value to the nearest 11 LayoutUnit). 12 13 * TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp: 14 (TestWebKitAPI::TEST): 15 1 16 2013-01-18 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 17 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp
r140192 r140205 84 84 ASSERT_EQ(LayoutUnit(-1.9f).round(), -2); 85 85 ASSERT_EQ(LayoutUnit(-1.6f).round(), -2); 86 ASSERT_EQ(LayoutUnit (-1.52f).round(), -2);87 ASSERT_EQ(LayoutUnit (-1.5f).round(), -1);88 ASSERT_EQ(LayoutUnit (-1.49f).round(), -1);86 ASSERT_EQ(LayoutUnit::fromFloatRound(-1.51f).round(), -2); 87 ASSERT_EQ(LayoutUnit::fromFloatRound(-1.5f).round(), -1); 88 ASSERT_EQ(LayoutUnit::fromFloatRound(-1.49f).round(), -1); 89 89 ASSERT_EQ(LayoutUnit(-1.0f).round(), -1); 90 ASSERT_EQ(LayoutUnit (-0.99f).round(), -1);91 ASSERT_EQ(LayoutUnit (-0.51f).round(), 0);92 ASSERT_EQ(LayoutUnit (-0.50f).round(), 0);93 ASSERT_EQ(LayoutUnit (-0.49f).round(), 0);90 ASSERT_EQ(LayoutUnit::fromFloatRound(-0.99f).round(), -1); 91 ASSERT_EQ(LayoutUnit::fromFloatRound(-0.51f).round(), -1); 92 ASSERT_EQ(LayoutUnit::fromFloatRound(-0.50f).round(), 0); 93 ASSERT_EQ(LayoutUnit::fromFloatRound(-0.49f).round(), 0); 94 94 ASSERT_EQ(LayoutUnit(-0.1f).round(), 0); 95 95 ASSERT_EQ(LayoutUnit(0.0f).round(), 0); 96 96 ASSERT_EQ(LayoutUnit(0.1f).round(), 0); 97 ASSERT_EQ(LayoutUnit(0.49f).round(), 0); 98 ASSERT_EQ(LayoutUnit(0.50f).round(), 1); 97 ASSERT_EQ(LayoutUnit::fromFloatRound(0.49f).round(), 0); 98 ASSERT_EQ(LayoutUnit::fromFloatRound(0.50f).round(), 1); 99 ASSERT_EQ(LayoutUnit::fromFloatRound(0.51f).round(), 1); 99 100 ASSERT_EQ(LayoutUnit(0.99f).round(), 1); 100 101 ASSERT_EQ(LayoutUnit(1.0f).round(), 1); 101 ASSERT_EQ(LayoutUnit(1.49f).round(), 1); 102 ASSERT_EQ(LayoutUnit(1.5f).round(), 2); 102 ASSERT_EQ(LayoutUnit::fromFloatRound(1.49f).round(), 1); 103 ASSERT_EQ(LayoutUnit::fromFloatRound(1.5f).round(), 2); 104 ASSERT_EQ(LayoutUnit::fromFloatRound(1.51f).round(), 2); 103 105 } 104 106
Note: See TracChangeset
for help on using the changeset viewer.