From 6c8669edb20249cd5534c78cfb48e7cf0978dda3 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Fri, 28 Jul 2017 14:54:33 -0700 Subject: [PATCH] Fix test regression from 9883c51578015. --- cpplint/cpplint_unittest.py | 68 ------------------------------------- 1 file changed, 68 deletions(-) diff --git a/cpplint/cpplint_unittest.py b/cpplint/cpplint_unittest.py index 3086269..4931523 100755 --- a/cpplint/cpplint_unittest.py +++ b/cpplint/cpplint_unittest.py @@ -1972,74 +1972,6 @@ class CpplintTest(CpplintTestBase): 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