Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2093)

Unified Diff: Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

Issue 153953009: Revert of Update the static_cast style check to check for DEFINE_TYPE_CASTS patterns as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Tools/Scripts/webkitpy/style/checkers/cpp.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8caac83b6f6af7a94335a785c6c4fde85401658d..6df53dac3bcf6c6d87158bc9baf8dcefc37ee4c2 100644
--- a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -300,7 +300,6 @@
def perform_avoid_static_cast_of_objects(self, code, filename='foo.cpp', fs=None):
basic_error_rules = ('-',
- '+security/casting',
'+runtime/casting')
return self.perform_lint(code, filename, basic_error_rules, fs)
@@ -759,7 +758,6 @@
self.assert_language_rules_check('foo.h', statement, error_message)
# Tests for static_cast readability.
- # FIXME: Add cases for testing the DEFINE_TYPE_CASTS usecases also.
def test_static_cast_on_objects_with_toFoo(self):
mock_header_contents = ['inline Foo* toFoo(Bar* bar)']
fs = FileSystem()
@@ -775,7 +773,7 @@
filename='casting.cpp',
fs=fs)
self.assertEqual(message, 'static_cast of class objects is not allowed. Use toFoo defined in Foo.h.'
- ' [security/casting] [4]')
+ ' [runtime/casting] [4]')
finally:
fs.read_text_file = orig_read_text_file_fn
@@ -793,7 +791,7 @@
'Foo* x = static_cast<Foo*>(bar);',
filename='casting.cpp',
fs=fs)
- self.assertEqual(message, 'static_cast of class objects is not allowed. Define cast macro DEFINE_TYPE_CASTS(Foo) in Foo.h and use it.'
+ self.assertEqual(message, 'static_cast of class objects is not allowed. Add toFoo in Foo.h and use it instead.'
' [runtime/casting] [4]')
finally:
fs.read_text_file = orig_read_text_file_fn
« no previous file with comments | « Tools/Scripts/webkitpy/style/checkers/cpp.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698