MCPcopy Create free account
hub / github.com/cpplint/cpplint / doTestUnnamedNamespacesInHeaders

Method doTestUnnamedNamespacesInHeaders

cpplint_unittest.py:5103–5115  ·  view source on GitHub ↗
(self, extension)

Source from the content-addressed store, hash-verified

5101 self.doTestUnnamedNamespacesInHeaders(extension)
5102
5103 def doTestUnnamedNamespacesInHeaders(self, extension):
5104 self.TestLanguageRulesCheck(
5105 "foo." + extension,
5106 "namespace {",
5107 "Do not use unnamed namespaces in header files. See"
5108 " https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces"
5109 " for more information. [build/namespaces_headers] [4]",
5110 )
5111 # namespace registration macros are OK.
5112 self.TestLanguageRulesCheck("foo." + extension, "namespace { \\", "")
5113 # named namespaces are OK.
5114 self.TestLanguageRulesCheck("foo." + extension, "namespace foo {", "")
5115 self.TestLanguageRulesCheck("foo." + extension, "namespace foonamespace {", "")
5116
5117 def testUnnamedNamespacesInNonHeaders(self):
5118 for extension in ["c", "cc", "cpp", "cxx", "c++", "cu"]:

Callers 1

Calls 1

Tested by

no test coverage detected