Refactor CheckedArithmeticOperations.cpp to use templates instead of macros.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jun 2015 17:58:22 +0000 (17:58 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jun 2015 17:58:22 +0000 (17:58 +0000)
commit15174ecac489e8f0f86e00cbe0dbb3695e1ae3b6
treede457cee97b39251292f7d0005ca4c1e8ad0379d
parent63bbe45024e1115ca623eddf5958a99d659632e9
Refactor CheckedArithmeticOperations.cpp to use templates instead of macros.
https://bugs.webkit.org/show_bug.cgi?id=146103

Reviewed by Anders Carlsson.

Presently, the tests in CheckedArithmeticOperations.cpp are all implemented as
part of a large macro.  This makes them harder to:

1. write: no editor help with indentations, have to add trailing '\'s,
   inconvenient to add line breaks and comments.

2. read: no chroma coding / syntax highlighting.

3. debug: compile time errors are reported as being on the single line where
   the macro is used.

Refactoring the tests to use C++ templates solves all these issues.

* TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp:
(TestWebKitAPI::CheckedArithmeticTester::run):
(TestWebKitAPI::AllowMixedSignednessTest::run):
(TestWebKitAPI::IgnoreMixedSignednessTest::run):
(TestWebKitAPI::CoerceLiteralToUnsigned::coerce):
(TestWebKitAPI::CoerceLiteralNop::coerce):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@185708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp