Index: Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py |
diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py |
index ab53f175ab62f010f666f6647fd8fee0791511c1..61b6f7bb31133e259aaf7346eccc7ae3072372b6 100644 |
--- a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py |
+++ b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py |
@@ -764,12 +764,17 @@ class CppStyleTest(CppStyleTestBase): |
self.assert_language_rules_check('foo.cpp', statement, error_message) |
self.assert_language_rules_check('foo.h', statement, error_message) |
- # Test for static_cast readability. |
- def test_static_cast_readability(self): |
+ # Tests for static_cast readability. |
+ def test_use_toFoo_readability(self): |
self.assert_lint( |
'Text* x = static_cast<Text*>(foo);', |
- 'Consider using toText helper function in WebCore/dom/Text.h ' |
- 'instead of static_cast<Text*>' |
+ 'static_cast of class objects is not allowed. Use toText defined in Text.h.' |
+ ' [readability/check] [4]') |
+ |
+ def test_create_and_use_toFoo_readability(self): |
+ self.assert_lint( |
+ 'HTMLButtonElement* x = static_cast<HTMLButtonElement*>(foo);', |
+ 'static_cast of class objects is not allowed. Add toHTMLButtonElement in HTMLButtonElement.h and use it instead.' |
' [readability/check] [4]') |
# We cannot test this functionality because of difference of |