[clang-tools-extra] r219788 - Reformatted code samples in the unit test. No functional changes.
Alexander Kornienko
alexfh at google.com
Wed Oct 15 04:36:48 PDT 2014
Author: alexfh
Date: Wed Oct 15 06:36:48 2014
New Revision: 219788
URL: http://llvm.org/viewvc/llvm-project?rev=219788&view=rev
Log:
Reformatted code samples in the unit test. No functional changes.
Modified:
clang-tools-extra/trunk/unittests/clang-tidy/LLVMModuleTest.cpp
Modified: clang-tools-extra/trunk/unittests/clang-tidy/LLVMModuleTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/LLVMModuleTest.cpp?rev=219788&r1=219787&r2=219788&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/LLVMModuleTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/LLVMModuleTest.cpp Wed Oct 15 06:36:48 2014
@@ -35,93 +35,140 @@ static std::string runHeaderGuardCheckWi
}
TEST(LLVMHeaderGuardCheckTest, FixHeaderGuards) {
- EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif\n",
- runHeaderGuardCheck("#ifndef FOO\n#define FOO\n#endif\n",
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif\n",
+ runHeaderGuardCheck("#ifndef FOO\n"
+ "#define FOO\n"
+ "#endif\n",
"include/llvm/ADT/foo.h",
/*ExpectedWarnings=*/1));
// Allow trailing underscores.
- EXPECT_EQ("#ifndef LLVM_ADT_FOO_H_\n#define LLVM_ADT_FOO_H_\n#endif\n",
- runHeaderGuardCheck(
- "#ifndef LLVM_ADT_FOO_H_\n#define LLVM_ADT_FOO_H_\n#endif\n",
- "include/llvm/ADT/foo.h", /*ExpectedWarnings=*/0));
-
- EXPECT_EQ(
- "#ifndef LLVM_CLANG_C_BAR_H\n#define LLVM_CLANG_C_BAR_H\n\n\n#endif\n",
- runHeaderGuardCheck("", "./include/clang-c/bar.h",
- /*ExpectedWarnings=*/1));
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H_\n"
+ "#define LLVM_ADT_FOO_H_\n"
+ "#endif\n",
+ runHeaderGuardCheck("#ifndef LLVM_ADT_FOO_H_\n"
+ "#define LLVM_ADT_FOO_H_\n"
+ "#endif\n",
+ "include/llvm/ADT/foo.h",
+ /*ExpectedWarnings=*/0));
+
+ EXPECT_EQ("#ifndef LLVM_CLANG_C_BAR_H\n"
+ "#define LLVM_CLANG_C_BAR_H\n"
+ "\n"
+ "\n"
+ "#endif\n",
+ runHeaderGuardCheck("", "./include/clang-c/bar.h",
+ /*ExpectedWarnings=*/1));
- EXPECT_EQ("#ifndef LLVM_CLANG_LIB_CODEGEN_C_H\n#define "
- "LLVM_CLANG_LIB_CODEGEN_C_H\n\n\n#endif\n",
+ EXPECT_EQ("#ifndef LLVM_CLANG_LIB_CODEGEN_C_H\n"
+ "#define LLVM_CLANG_LIB_CODEGEN_C_H\n"
+ "\n"
+ "\n"
+ "#endif\n",
runHeaderGuardCheck("", "tools/clang/lib/CodeGen/c.h",
/*ExpectedWarnings=*/1));
- EXPECT_EQ("#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_X_H\n#define "
- "LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_X_H\n\n\n#endif\n",
+ EXPECT_EQ("#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_X_H\n"
+ "#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_X_H\n"
+ "\n"
+ "\n"
+ "#endif\n",
runHeaderGuardCheck("", "tools/clang/tools/extra/clang-tidy/x.h",
/*ExpectedWarnings=*/1));
- EXPECT_EQ(
- "int foo;\n#ifndef LLVM_CLANG_BAR_H\n#define LLVM_CLANG_BAR_H\n#endif\n",
- runHeaderGuardCheck("int foo;\n#ifndef LLVM_CLANG_BAR_H\n"
- "#define LLVM_CLANG_BAR_H\n#endif\n",
- "include/clang/bar.h", /*ExpectedWarnings=*/1));
-
- EXPECT_EQ("#ifndef LLVM_CLANG_BAR_H\n#define LLVM_CLANG_BAR_H\n\n"
- "int foo;\n#ifndef FOOLOLO\n#define FOOLOLO\n#endif\n\n#endif\n",
- runHeaderGuardCheck(
- "int foo;\n#ifndef FOOLOLO\n#define FOOLOLO\n#endif\n",
- "include/clang/bar.h", /*ExpectedWarnings=*/1));
-
- EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif "
- " // LLVM_ADT_FOO_H\n",
- runHeaderGuardCheckWithEndif("#ifndef FOO\n#define FOO\n#endif\n",
+ EXPECT_EQ("int foo;\n"
+ "#ifndef LLVM_CLANG_BAR_H\n"
+ "#define LLVM_CLANG_BAR_H\n"
+ "#endif\n",
+ runHeaderGuardCheck("int foo;\n"
+ "#ifndef LLVM_CLANG_BAR_H\n"
+ "#define LLVM_CLANG_BAR_H\n"
+ "#endif\n",
+ "include/clang/bar.h", /*ExpectedWarnings=*/1));
+
+ EXPECT_EQ("#ifndef LLVM_CLANG_BAR_H\n"
+ "#define LLVM_CLANG_BAR_H\n"
+ "\n"
+ "int foo;\n"
+ "#ifndef FOOLOLO\n"
+ "#define FOOLOLO\n"
+ "#endif\n"
+ "\n"
+ "#endif\n",
+ runHeaderGuardCheck("int foo;\n"
+ "#ifndef FOOLOLO\n"
+ "#define FOOLOLO\n"
+ "#endif\n",
+ "include/clang/bar.h", /*ExpectedWarnings=*/1));
+
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif // LLVM_ADT_FOO_H\n",
+ runHeaderGuardCheckWithEndif("#ifndef FOO\n"
+ "#define FOO\n"
+ "#endif\n",
"include/llvm/ADT/foo.h",
/*ExpectedWarnings=*/1));
- EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif "
- " // LLVM_ADT_FOO_H\n",
- runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H\n#define "
- "LLVM_ADT_FOO_H\n#endif // LLVM_H\n",
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif // LLVM_ADT_FOO_H\n",
+ runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif // LLVM_H\n",
"include/llvm/ADT/foo.h",
/*ExpectedWarnings=*/1));
- EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif"
- " /* LLVM_ADT_FOO_H */\n",
- runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H\n#define "
- "LLVM_ADT_FOO_H\n"
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif /* LLVM_ADT_FOO_H */\n",
+ runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
"#endif /* LLVM_ADT_FOO_H */\n",
"include/llvm/ADT/foo.h",
/*ExpectedWarnings=*/0));
- EXPECT_EQ("#ifndef LLVM_ADT_FOO_H_\n#define LLVM_ADT_FOO_H_\n#endif "
- "// LLVM_ADT_FOO_H_\n",
- runHeaderGuardCheckWithEndif(
- "#ifndef LLVM_ADT_FOO_H_\n#define "
- "LLVM_ADT_FOO_H_\n#endif // LLVM_ADT_FOO_H_\n",
- "include/llvm/ADT/foo.h", /*ExpectedWarnings=*/0));
-
- EXPECT_EQ(
- "#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif // "
- "LLVM_ADT_FOO_H\n",
- runHeaderGuardCheckWithEndif(
- "#ifndef LLVM_ADT_FOO_H_\n#define LLVM_ADT_FOO_H_\n#endif // LLVM\n",
- "include/llvm/ADT/foo.h", /*ExpectedWarnings=*/1));
-
- EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif \\ \n// "
- "LLVM_ADT_FOO_H\n",
- runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H\n#define "
- "LLVM_ADT_FOO_H\n#endif \\ \n// "
- "LLVM_ADT_FOO_H\n",
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H_\n"
+ "#define LLVM_ADT_FOO_H_\n"
+ "#endif // LLVM_ADT_FOO_H_\n",
+ runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H_\n"
+ "#define LLVM_ADT_FOO_H_\n"
+ "#endif // LLVM_ADT_FOO_H_\n",
+ "include/llvm/ADT/foo.h",
+ /*ExpectedWarnings=*/0));
+
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif // LLVM_ADT_FOO_H\n",
+ runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H_\n"
+ "#define LLVM_ADT_FOO_H_\n"
+ "#endif // LLVM\n",
"include/llvm/ADT/foo.h",
/*ExpectedWarnings=*/1));
- EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif /* "
- "LLVM_ADT_FOO_H\\ \n FOO */",
- runHeaderGuardCheckWithEndif(
- "#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif /* "
- "LLVM_ADT_FOO_H\\ \n FOO */",
- "include/llvm/ADT/foo.h", /*ExpectedWarnings=*/0));
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif \\ \n"
+ "// LLVM_ADT_FOO_H\n",
+ runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif \\ \n"
+ "// LLVM_ADT_FOO_H\n",
+ "include/llvm/ADT/foo.h",
+ /*ExpectedWarnings=*/1));
+
+ EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif /* LLVM_ADT_FOO_H\\ \n"
+ " FOO */",
+ runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H\n"
+ "#define LLVM_ADT_FOO_H\n"
+ "#endif /* LLVM_ADT_FOO_H\\ \n"
+ " FOO */",
+ "include/llvm/ADT/foo.h",
+ /*ExpectedWarnings=*/0));
}
#endif
More information about the cfe-commits
mailing list