(self, extension)
| 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"]: |
no test coverage detected