diff options
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r-- | clang/unittests/Format/ConfigParseTest.cpp | 40 | ||||
-rw-r--r-- | clang/unittests/Format/DefinitionBlockSeparatorTest.cpp | 2 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 16 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTestCSharp.cpp | 2 |
4 files changed, 29 insertions, 31 deletions
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp index ee8a556..8c74ed2 100644 --- a/clang/unittests/Format/ConfigParseTest.cpp +++ b/clang/unittests/Format/ConfigParseTest.cpp @@ -677,38 +677,36 @@ TEST(ConfigParseTest, ParsesConfiguration) { " AfterControlStatement: false", BraceWrapping.AfterControlStatement, FormatStyle::BWACS_Never); - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_All; - CHECK_PARSE("BreakAfterReturnType: None", AlwaysBreakAfterReturnType, + Style.BreakAfterReturnType = FormatStyle::RTBS_All; + CHECK_PARSE("BreakAfterReturnType: None", BreakAfterReturnType, FormatStyle::RTBS_None); - CHECK_PARSE("BreakAfterReturnType: Automatic", AlwaysBreakAfterReturnType, + CHECK_PARSE("BreakAfterReturnType: Automatic", BreakAfterReturnType, FormatStyle::RTBS_Automatic); - CHECK_PARSE("BreakAfterReturnType: ExceptShortType", - AlwaysBreakAfterReturnType, FormatStyle::RTBS_ExceptShortType); - CHECK_PARSE("BreakAfterReturnType: All", AlwaysBreakAfterReturnType, + CHECK_PARSE("BreakAfterReturnType: ExceptShortType", BreakAfterReturnType, + FormatStyle::RTBS_ExceptShortType); + CHECK_PARSE("BreakAfterReturnType: All", BreakAfterReturnType, FormatStyle::RTBS_All); - CHECK_PARSE("BreakAfterReturnType: TopLevel", AlwaysBreakAfterReturnType, + CHECK_PARSE("BreakAfterReturnType: TopLevel", BreakAfterReturnType, FormatStyle::RTBS_TopLevel); - CHECK_PARSE("BreakAfterReturnType: AllDefinitions", - AlwaysBreakAfterReturnType, FormatStyle::RTBS_AllDefinitions); - CHECK_PARSE("BreakAfterReturnType: TopLevelDefinitions", - AlwaysBreakAfterReturnType, + CHECK_PARSE("BreakAfterReturnType: AllDefinitions", BreakAfterReturnType, + FormatStyle::RTBS_AllDefinitions); + CHECK_PARSE("BreakAfterReturnType: TopLevelDefinitions", BreakAfterReturnType, FormatStyle::RTBS_TopLevelDefinitions); // For backward compatibility: - CHECK_PARSE("AlwaysBreakAfterReturnType: None", AlwaysBreakAfterReturnType, + CHECK_PARSE("AlwaysBreakAfterReturnType: None", BreakAfterReturnType, FormatStyle::RTBS_None); - CHECK_PARSE("AlwaysBreakAfterReturnType: Automatic", - AlwaysBreakAfterReturnType, FormatStyle::RTBS_Automatic); + CHECK_PARSE("AlwaysBreakAfterReturnType: Automatic", BreakAfterReturnType, + FormatStyle::RTBS_Automatic); CHECK_PARSE("AlwaysBreakAfterReturnType: ExceptShortType", - AlwaysBreakAfterReturnType, FormatStyle::RTBS_ExceptShortType); - CHECK_PARSE("AlwaysBreakAfterReturnType: All", AlwaysBreakAfterReturnType, + BreakAfterReturnType, FormatStyle::RTBS_ExceptShortType); + CHECK_PARSE("AlwaysBreakAfterReturnType: All", BreakAfterReturnType, FormatStyle::RTBS_All); - CHECK_PARSE("AlwaysBreakAfterReturnType: TopLevel", - AlwaysBreakAfterReturnType, FormatStyle::RTBS_TopLevel); + CHECK_PARSE("AlwaysBreakAfterReturnType: TopLevel", BreakAfterReturnType, + FormatStyle::RTBS_TopLevel); CHECK_PARSE("AlwaysBreakAfterReturnType: AllDefinitions", - AlwaysBreakAfterReturnType, FormatStyle::RTBS_AllDefinitions); + BreakAfterReturnType, FormatStyle::RTBS_AllDefinitions); CHECK_PARSE("AlwaysBreakAfterReturnType: TopLevelDefinitions", - AlwaysBreakAfterReturnType, - FormatStyle::RTBS_TopLevelDefinitions); + BreakAfterReturnType, FormatStyle::RTBS_TopLevelDefinitions); Style.BreakTemplateDeclarations = FormatStyle::BTDS_Yes; CHECK_PARSE("BreakTemplateDeclarations: Leave", BreakTemplateDeclarations, diff --git a/clang/unittests/Format/DefinitionBlockSeparatorTest.cpp b/clang/unittests/Format/DefinitionBlockSeparatorTest.cpp index f548949..7a12093 100644 --- a/clang/unittests/Format/DefinitionBlockSeparatorTest.cpp +++ b/clang/unittests/Format/DefinitionBlockSeparatorTest.cpp @@ -144,7 +144,7 @@ TEST_F(DefinitionBlockSeparatorTest, Basic) { Style); FormatStyle BreakAfterReturnTypeStyle = Style; - BreakAfterReturnTypeStyle.AlwaysBreakAfterReturnType = FormatStyle::RTBS_All; + BreakAfterReturnTypeStyle.BreakAfterReturnType = FormatStyle::RTBS_All; // Test uppercased long typename verifyFormat("class Foo {\n" " void\n" diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 79cd521..b0687eae 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -9870,7 +9870,7 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) { Style.ColumnLimit = 60; // No declarations or definitions should be moved to own line. - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None; + Style.BreakAfterReturnType = FormatStyle::RTBS_None; verifyFormat("class A {\n" " int f() { return 1; }\n" " int g();\n" @@ -9884,7 +9884,7 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) { Style); // It is now allowed to break after a short return type if necessary. - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_Automatic; + Style.BreakAfterReturnType = FormatStyle::RTBS_Automatic; verifyFormat("class A {\n" " int f() { return 1; }\n" " int g();\n" @@ -9898,7 +9898,7 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) { Style); // It now must never break after a short return type. - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_ExceptShortType; + Style.BreakAfterReturnType = FormatStyle::RTBS_ExceptShortType; verifyFormat("class A {\n" " int f() { return 1; }\n" " int g();\n" @@ -9913,7 +9913,7 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) { // All declarations and definitions should have the return type moved to its // own line. - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_All; + Style.BreakAfterReturnType = FormatStyle::RTBS_All; Style.TypenameMacros = {"LIST"}; verifyFormat("SomeType\n" "funcdecl(LIST(uint64_t));", @@ -9940,7 +9940,7 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) { // Top-level definitions, and no kinds of declarations should have the // return type moved to its own line. - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_TopLevelDefinitions; + Style.BreakAfterReturnType = FormatStyle::RTBS_TopLevelDefinitions; verifyFormat("class B {\n" " int f() { return 1; }\n" " int g();\n" @@ -9954,7 +9954,7 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) { // Top-level definitions and declarations should have the return type moved // to its own line. - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_TopLevel; + Style.BreakAfterReturnType = FormatStyle::RTBS_TopLevel; verifyFormat("class C {\n" " int f() { return 1; }\n" " int g();\n" @@ -9971,7 +9971,7 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) { // All definitions should have the return type moved to its own line, but no // kinds of declarations. - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; + Style.BreakAfterReturnType = FormatStyle::RTBS_AllDefinitions; verifyFormat("class D {\n" " int\n" " f() {\n" @@ -11939,7 +11939,7 @@ TEST_F(FormatTest, UnderstandsAttributes) { "aaaaaaaaaaaaaaaaaaaaaaa(int i);"); verifyFormat("__attribute__((nodebug)) ::qualified_type f();"); FormatStyle AfterType = getLLVMStyle(); - AfterType.AlwaysBreakAfterReturnType = FormatStyle::RTBS_All; + AfterType.BreakAfterReturnType = FormatStyle::RTBS_All; verifyFormat("__attribute__((nodebug)) void\n" "foo() {}", AfterType); diff --git a/clang/unittests/Format/FormatTestCSharp.cpp b/clang/unittests/Format/FormatTestCSharp.cpp index 6f5e1e4..de261c0 100644 --- a/clang/unittests/Format/FormatTestCSharp.cpp +++ b/clang/unittests/Format/FormatTestCSharp.cpp @@ -505,7 +505,7 @@ TEST_F(FormatTestCSharp, CSharpNullForgiving) { TEST_F(FormatTestCSharp, AttributesIndentation) { FormatStyle Style = getMicrosoftStyle(FormatStyle::LK_CSharp); - Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None; + Style.BreakAfterReturnType = FormatStyle::RTBS_None; verifyFormat("[STAThread]\n" "static void Main(string[] args)\n" |