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

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

Issue 1981763002: check-webkit-style: Add checks for deprecated wtf/Assertions.h macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « third_party/WebKit/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: third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index b1d5a5756442c6890d5c606e08bbe0d3854277c4..d3b549ff4c97d65fed8431bf56bd7ce6274ae815 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -1587,6 +1587,24 @@ class CppStyleTest(CppStyleTestBase):
self.assert_lint('CHECK_EQ("foo", "foo")', '')
+ def test_check_deprecated_macros(self):
+ self.assert_lint('ASSERT(foo)', 'ASSERT is deprecated. Use DCHECK or '
+ 'its variants instead. [build/deprecated] [5]')
+ self.assert_lint(' ASSERT_UNUSED(foo, foo)', 'ASSERT_UNUSED is '
+ 'deprecated. Use DCHECK or its variants instead. '
+ '[build/deprecated] [5]')
+ self.assert_lint('ASSERT_NOT_REACHED()', 'ASSERT_NOT_REACHED is '
+ 'deprecated. Use NOTREACHED instead. '
+ '[build/deprecated] [5]')
+ self.assert_lint('ASSERT_WITH_SECURITY_IMPLICATION(foo)',
+ 'ASSERT_WITH_SECURITY_IMPLICATION is deprecated. Use '
+ 'SECURITY_DCHECK instead. [build/deprecated] [5]')
+ self.assert_lint('WTF_LOG(foo)', 'WTF_LOG is deprecated. Use DVLOG '
+ 'instead. [build/deprecated] [5]')
+
+ self.assert_lint('FOO_BAR_ASSERT()', '')
+ self.assert_lint('ASSERT_NO_EXCEPTIONS', '')
+
def test_brace_at_begin_of_line(self):
self.assert_lint('{',
'This { should be at the end of the previous line'
@@ -3387,14 +3405,14 @@ class NoNonVirtualDestructorsTest(CppStyleTestBase):
'More than one command on the same line [whitespace/newline] [4]')
self.assert_multi_line_lint(
'class MyClass {\n'
- ' int getIntValue() { ASSERT(m_ptr); return *m_ptr; }\n'
+ ' int getIntValue() { DCHECK(m_ptr); return *m_ptr; }\n'
'};\n',
'')
self.assert_multi_line_lint(
'class MyClass {\n'
' int getIntValue()\n'
' {\n'
- ' ASSERT(m_ptr); return *m_ptr;\n'
+ ' DCHECK(m_ptr); return *m_ptr;\n'
' }\n'
'};\n',
'More than one command on the same line [whitespace/newline] [4]')
« no previous file with comments | « third_party/WebKit/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