@@ -39,12 +39,10 @@ class TestDiagnosticConsumer : public DiagnosticConsumer {
39
39
struct TestDiagnostic : public Diagnostic {
40
40
TestDiagnostic (DiagID ID, DiagGroupID GroupID) : Diagnostic(ID, GroupID) {}
41
41
};
42
- } // end anonymous namespace
43
42
44
- static void diagnosticGroupsTestCase (
45
- llvm::function_ref<void (DiagnosticEngine &)> diagnose,
46
- llvm::function_ref<void(const DiagnosticInfo &)> callback,
47
- unsigned expectedNumCallbackCalls) {
43
+ static void testCase (llvm::function_ref<void (DiagnosticEngine &)> diagnose,
44
+ llvm::function_ref<void(const DiagnosticInfo &)> callback,
45
+ unsigned expectedNumCallbackCalls) {
48
46
SourceManager sourceMgr;
49
47
DiagnosticEngine diags (sourceMgr);
50
48
@@ -66,7 +64,7 @@ static void diagnosticGroupsTestCase(
66
64
TEST (DiagnosticGroups, TargetAll) {
67
65
// Test that uncategorized diagnostics are escalated when escalating all
68
66
// warnings.
69
- diagnosticGroupsTestCase (
67
+ testCase (
70
68
[](DiagnosticEngine &diags) {
71
69
const std::vector rules = {
72
70
WarningAsErrorRule (WarningAsErrorRule::Action::Enable)};
@@ -91,16 +89,16 @@ TEST(DiagnosticGroups, OverrideBehaviorLimitations) {
91
89
DiagGroupID::DeprecatedDeclaration);
92
90
93
91
// Make sure ID actually is an error by default.
94
- diagnosticGroupsTestCase (
92
+ testCase (
95
93
[&diagnostic](DiagnosticEngine &diags) {
96
94
diags.diagnose (SourceLoc (), diagnostic);
97
95
},
98
96
[](const DiagnosticInfo &info) {
99
- EXPECT_TRUE (info.Kind == DiagnosticKind::Error);
97
+ EXPECT_EQ (info.Kind , DiagnosticKind::Error);
100
98
},
101
99
/* expectedNumCallbackCalls=*/ 1 );
102
100
103
- diagnosticGroupsTestCase (
101
+ testCase (
104
102
[&diagnostic](DiagnosticEngine &diags) {
105
103
const std::vector rules = {WarningAsErrorRule (
106
104
WarningAsErrorRule::Action::Enable, " DeprecatedDeclaration" )};
@@ -124,7 +122,7 @@ TEST(DiagnosticGroups, OverrideBehaviorLimitations) {
124
122
DiagGroupID::DeprecatedDeclaration);
125
123
126
124
// Make sure ID actually is a warning by default.
127
- diagnosticGroupsTestCase (
125
+ testCase (
128
126
[&diagnostic](DiagnosticEngine &diags) {
129
127
diags.diagnose (SourceLoc (), diagnostic);
130
128
},
@@ -133,7 +131,7 @@ TEST(DiagnosticGroups, OverrideBehaviorLimitations) {
133
131
},
134
132
/* expectedNumCallbackCalls=*/ 1 );
135
133
136
- diagnosticGroupsTestCase (
134
+ testCase (
137
135
[&diagnostic](DiagnosticEngine &diags) {
138
136
const std::vector rules = {WarningAsErrorRule (
139
137
WarningAsErrorRule::Action::Enable, " DeprecatedDeclaration" )};
@@ -148,3 +146,5 @@ TEST(DiagnosticGroups, OverrideBehaviorLimitations) {
148
146
/* expectedNumCallbackCalls=*/ 1 );
149
147
}
150
148
}
149
+
150
+ } // end anonymous namespace
0 commit comments