diff options
author | danakj <danakj@chromium.org> | 2015-12-07 18:30:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-08 02:31:53 +0000 |
commit | 6ba4c1e61a03cba5dfd7a53da70437aa61583a7f (patch) | |
tree | 7214d675816a282a2e90713148ae229b70f4fcf9 /PRESUBMIT_test.py | |
parent | 6d0607b8f39ec4bdb76befa8409e6328b3e56b51 (diff) | |
download | chromium_src-6ba4c1e61a03cba5dfd7a53da70437aa61583a7f.zip chromium_src-6ba4c1e61a03cba5dfd7a53da70437aa61583a7f.tar.gz chromium_src-6ba4c1e61a03cba5dfd7a53da70437aa61583a7f.tar.bz2 |
Rename MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03
This renames the macro to be more standard and express its intent and
relationship to DISALLOW_COPY_AND_ASSIGN. It renames the macro to
DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND, as it does what
the old DISALLOW_COPY_AND_ASSIGN does, but also whitelists the type
for Bind/Callback to try move it.
R=Nico
TBR=sky
BUG=561749
Review URL: https://codereview.chromium.org/1501793003
Cr-Commit-Position: refs/heads/master@{#363712}
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-x | PRESUBMIT_test.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index e488c94..6b83350 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py @@ -416,45 +416,6 @@ class CheckSingletonInHeadersTest(unittest.TestCase): self.assertEqual(0, len(warnings)) -class CheckBaseMacrosInHeadersTest(unittest.TestCase): - def _make_h(self, macro, header, line_prefix=''): - return (""" -#include "base/%s.h" - -class Thing { - private: -%sDISALLOW_%s(Thing); -}; -""" % (macro, line_prefix, header)).splitlines() - - def testBaseMacrosInHeadersBad(self): - mock_input_api = MockInputApi() - mock_input_api.files = [ - MockAffectedFile('foo.h', self._make_h('not_macros', 'ASSIGN')), - MockAffectedFile('bar.h', self._make_h('not_macros', 'COPY')), - MockAffectedFile('baz.h', self._make_h('not_macros', 'COPY_AND_ASSIGN')), - MockAffectedFile('qux.h', self._make_h('not_macros', 'EVIL')), - ] - warnings = PRESUBMIT._CheckBaseMacrosInHeaders(mock_input_api, - MockOutputApi()) - self.assertEqual(1, len(warnings)) - self.assertEqual(4, len(warnings[0].items)) - - def testBaseMacrosInHeadersGood(self): - mock_input_api = MockInputApi() - mock_input_api.files = [ - MockAffectedFile('foo.h', self._make_h('macros', 'ASSIGN')), - MockAffectedFile('bar.h', self._make_h('macros', 'COPY')), - MockAffectedFile('baz.h', self._make_h('macros', 'COPY_AND_ASSIGN')), - MockAffectedFile('qux.h', self._make_h('macros', 'EVIL')), - MockAffectedFile('foz.h', self._make_h('not_macros', 'ASSIGN', '//')), - MockAffectedFile('foz.h', self._make_h('not_macros', 'ASSIGN', ' //')), - ] - warnings = PRESUBMIT._CheckBaseMacrosInHeaders(mock_input_api, - MockOutputApi()) - self.assertEqual(0, len(warnings)) - - class InvalidOSMacroNamesTest(unittest.TestCase): def testInvalidOSMacroNames(self): lines = ['#if defined(OS_WINDOWS)', |