Skip to content

Commit

Permalink
Fix test regression from 9883c51.
Browse files Browse the repository at this point in the history
  • Loading branch information
eglaysher committed Jul 28, 2017
1 parent 0c1c7f1 commit 6c8669e
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions cpplint/cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1972,74 +1972,6 @@ def testDisallowMacrosAtEnd(self):
error_collector)
self.assertEquals('', error_collector.Results())

# DISALLOW* macros should be in the private: section.
def testMisplacedDisallowMacros(self):
for macro_name in (
'DISALLOW_COPY_AND_ASSIGN',
'DISALLOW_IMPLICIT_CONSTRUCTORS'):
self.TestMultiLineLint(
"""
class A {'
public:
%s(A);
};""" % macro_name,
('%s must be in the private: section' % macro_name) +
' [readability/constructors] [3]')

self.TestMultiLineLint(
"""
struct B {'
%s(B);
};""" % macro_name,
('%s must be in the private: section' % macro_name) +
' [readability/constructors] [3]')

self.TestMultiLineLint(
"""
class Outer1 {'
private:
struct Inner1 {
%s(Inner1);
};
%s(Outer1);
};""" % (macro_name, macro_name),
('%s must be in the private: section' % macro_name) +
' [readability/constructors] [3]')

self.TestMultiLineLint(
"""
class Outer2 {'
private:
class Inner2 {
%s(Inner2);
};
%s(Outer2);
};""" % (macro_name, macro_name),
'')
# Extra checks to make sure that nested classes are handled
# correctly. Use different macros for inner and outer classes so
# that we can tell the error messages apart.
self.TestMultiLineLint(
"""
class Outer3 {
struct Inner3 {
DISALLOW_COPY_AND_ASSIGN(Inner3);
};
DISALLOW_IMPLICIT_CONSTRUCTORS(Outer3);
};""",
('DISALLOW_COPY_AND_ASSIGN must be in the private: section'
' [readability/constructors] [3]'))
self.TestMultiLineLint(
"""
struct Outer4 {
class Inner4 {
DISALLOW_COPY_AND_ASSIGN(Inner4);
};
DISALLOW_IMPLICIT_CONSTRUCTORS(Outer4);
};""",
('DISALLOW_IMPLICIT_CONSTRUCTORS must be in the private: section'
' [readability/constructors] [3]'))

# Brace usage
def testBraces(self):
# Braces shouldn't be followed by a ; unless they're defining a struct
Expand Down

0 comments on commit 6c8669e

Please sign in to comment.