Index: Source/wtf/SaturatedArithmeticTest.cpp |
diff --git a/Source/wtf/SaturatedArithmeticTest.cpp b/Source/wtf/SaturatedArithmeticTest.cpp |
index 402471c6f6ef31a94292127b1d2166d2687cb093..00df8e97bbc7fb31005de9eea5d68046424b5939 100644 |
--- a/Source/wtf/SaturatedArithmeticTest.cpp |
+++ b/Source/wtf/SaturatedArithmeticTest.cpp |
@@ -104,52 +104,4 @@ |
EXPECT_EQ(INT_MAX, saturatedSubtraction(INT_MAX, INT_MIN)); |
} |
-TEST(SaturatedArithmeticTest, SetSigned) |
-{ |
- const int kFractionBits = 6; |
- const int intMaxForLayoutUnit = INT_MAX >> kFractionBits; |
- const int intMinForLayoutUnit = INT_MIN >> kFractionBits; |
- |
- EXPECT_EQ(0, saturatedSet(0, kFractionBits)); |
- |
- // Internally the max number we can represent (without saturating) |
- // is all the (non-sign) bits set except for the bottom n fraction bits |
- const int maxInternalRepresentation = INT_MAX ^ ((1 << kFractionBits)-1); |
- EXPECT_EQ(maxInternalRepresentation, |
- saturatedSet(intMaxForLayoutUnit, kFractionBits)); |
- |
- EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits), |
- saturatedSet(intMaxForLayoutUnit + 100, kFractionBits)); |
- |
- EXPECT_EQ((intMaxForLayoutUnit - 100) << kFractionBits, |
- saturatedSet(intMaxForLayoutUnit - 100, kFractionBits)); |
- |
- EXPECT_EQ(getMinSaturatedSetResultForTesting(kFractionBits), |
- saturatedSet(intMinForLayoutUnit, kFractionBits)); |
- |
- EXPECT_EQ(getMinSaturatedSetResultForTesting(kFractionBits), |
- saturatedSet(intMinForLayoutUnit - 100, kFractionBits)); |
- |
- EXPECT_EQ((intMinForLayoutUnit + 100) << kFractionBits, |
- saturatedSet(intMinForLayoutUnit + 100, kFractionBits)); |
-} |
- |
-TEST(SaturatedArithmeticTest, SetUnsigned) |
-{ |
- const int kFractionBits = 6; |
- const int intMaxForLayoutUnit = INT_MAX >> kFractionBits; |
- |
- EXPECT_EQ(0, saturatedSet((unsigned)0, kFractionBits)); |
- |
- EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits), |
- saturatedSet((unsigned)intMaxForLayoutUnit, kFractionBits)); |
- |
- EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits), |
- saturatedSet((unsigned)(intMaxForLayoutUnit+100), kFractionBits)); |
- |
- EXPECT_EQ((intMaxForLayoutUnit - 100) << kFractionBits, |
- saturatedSet((unsigned)(intMaxForLayoutUnit - 100), kFractionBits)); |
-} |
- |
- |
} // namespace |