| 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]')
|
|
|