Title: [145587] trunk
- Revision
- 145587
- Author
- [email protected]
- Date
- 2013-03-12 14:51:39 -0700 (Tue, 12 Mar 2013)
Log Message
Add more Checked<> tests
https://bugs.webkit.org/show_bug.cgi?id=112190
Reviewed by Geoffrey Garen.
Source/WTF:
Export the CheckedState enum type
* wtf/CheckedArithmetic.h:
Tools:
Tests!
* TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp:
(TestWebKitAPI):
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (145586 => 145587)
--- trunk/Source/WTF/ChangeLog 2013-03-12 21:47:23 UTC (rev 145586)
+++ trunk/Source/WTF/ChangeLog 2013-03-12 21:51:39 UTC (rev 145587)
@@ -1,5 +1,16 @@
2013-03-12 Oliver Hunt <[email protected]>
+ Add more Checked<> tests
+ https://bugs.webkit.org/show_bug.cgi?id=112190
+
+ Reviewed by Geoffrey Garen.
+
+ Export the CheckedState enum type
+
+ * wtf/CheckedArithmetic.h:
+
+2013-03-12 Oliver Hunt <[email protected]>
+
Make CheckedArithmetic slightly more sane
https://bugs.webkit.org/show_bug.cgi?id=112178
Modified: trunk/Source/WTF/wtf/CheckedArithmetic.h (145586 => 145587)
--- trunk/Source/WTF/wtf/CheckedArithmetic.h 2013-03-12 21:47:23 UTC (rev 145586)
+++ trunk/Source/WTF/wtf/CheckedArithmetic.h 2013-03-12 21:51:39 UTC (rev 145587)
@@ -712,6 +712,7 @@
}
using WTF::Checked;
+using WTF::CheckedState;
using WTF::RecordOverflow;
#endif
Modified: trunk/Tools/ChangeLog (145586 => 145587)
--- trunk/Tools/ChangeLog 2013-03-12 21:47:23 UTC (rev 145586)
+++ trunk/Tools/ChangeLog 2013-03-12 21:51:39 UTC (rev 145587)
@@ -1,3 +1,15 @@
+2013-03-12 Oliver Hunt <[email protected]>
+
+ Add more Checked<> tests
+ https://bugs.webkit.org/show_bug.cgi?id=112190
+
+ Reviewed by Geoffrey Garen.
+
+ Tests!
+
+ * TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp:
+ (TestWebKitAPI):
+
2013-03-12 Julie Parent <[email protected]>
Cleanup: Move loading complete function into callback, rather than global.
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp (145586 => 145587)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp 2013-03-12 21:47:23 UTC (rev 145586)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp 2013-03-12 21:51:39 UTC (rev 145587)
@@ -70,6 +70,13 @@
EXPECT_EQ(true, (value += coerceLiteral(1)).hasOverflowed()); \
EXPECT_EQ(true, value.hasOverflowed()); \
value = 10; \
+ type _value; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (value * Checked<type, RecordOverflow>(0)).safeGet(_value)); \
+ EXPECT_EQ(true, 10 == _value); \
+ _value = 0; \
+ EXPECT_EQ(true, CheckedState::DidNotOverflow == (Checked<type, RecordOverflow>(0) * value).safeGet(_value)); \
+ EXPECT_EQ(true, 10 == _value); \
+ EXPECT_EQ(true, CheckedState::DidOverflow != (value * Checked<type, RecordOverflow>(std::numeric_limits<type>::max())).safeGet(_value)); \
MixedSignednessTest(EXPECT_EQ(coerceLiteral(0), (value + -10).unsafeGet())); \
MixedSignednessTest(EXPECT_EQ(0U, (value - 10U).unsafeGet())); \
MixedSignednessTest(EXPECT_EQ(coerceLiteral(0), (-10 + value).unsafeGet())); \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes