@@ -39,12 +39,10 @@ class TestDiagnosticConsumer : public DiagnosticConsumer {
3939struct TestDiagnostic : public Diagnostic {
4040 TestDiagnostic (DiagID ID, DiagGroupID GroupID) : Diagnostic(ID, GroupID) {}
4141};
42- } // end anonymous namespace
4342
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) {
4846 SourceManager sourceMgr;
4947 DiagnosticEngine diags (sourceMgr);
5048
@@ -66,7 +64,7 @@ static void diagnosticGroupsTestCase(
6664TEST (DiagnosticGroups, TargetAll) {
6765 // Test that uncategorized diagnostics are escalated when escalating all
6866 // warnings.
69- diagnosticGroupsTestCase (
67+ testCase (
7068 [](DiagnosticEngine &diags) {
7169 const std::vector rules = {
7270 WarningAsErrorRule (WarningAsErrorRule::Action::Enable)};
@@ -91,16 +89,16 @@ TEST(DiagnosticGroups, OverrideBehaviorLimitations) {
9189 DiagGroupID::DeprecatedDeclaration);
9290
9391 // Make sure ID actually is an error by default.
94- diagnosticGroupsTestCase (
92+ testCase (
9593 [&diagnostic](DiagnosticEngine &diags) {
9694 diags.diagnose (SourceLoc (), diagnostic);
9795 },
9896 [](const DiagnosticInfo &info) {
99- EXPECT_TRUE (info.Kind == DiagnosticKind::Error);
97+ EXPECT_EQ (info.Kind , DiagnosticKind::Error);
10098 },
10199 /* expectedNumCallbackCalls=*/ 1 );
102100
103- diagnosticGroupsTestCase (
101+ testCase (
104102 [&diagnostic](DiagnosticEngine &diags) {
105103 const std::vector rules = {WarningAsErrorRule (
106104 WarningAsErrorRule::Action::Enable, " DeprecatedDeclaration" )};
@@ -124,7 +122,7 @@ TEST(DiagnosticGroups, OverrideBehaviorLimitations) {
124122 DiagGroupID::DeprecatedDeclaration);
125123
126124 // Make sure ID actually is a warning by default.
127- diagnosticGroupsTestCase (
125+ testCase (
128126 [&diagnostic](DiagnosticEngine &diags) {
129127 diags.diagnose (SourceLoc (), diagnostic);
130128 },
@@ -133,7 +131,7 @@ TEST(DiagnosticGroups, OverrideBehaviorLimitations) {
133131 },
134132 /* expectedNumCallbackCalls=*/ 1 );
135133
136- diagnosticGroupsTestCase (
134+ testCase (
137135 [&diagnostic](DiagnosticEngine &diags) {
138136 const std::vector rules = {WarningAsErrorRule (
139137 WarningAsErrorRule::Action::Enable, " DeprecatedDeclaration" )};
@@ -148,3 +146,5 @@ TEST(DiagnosticGroups, OverrideBehaviorLimitations) {
148146 /* expectedNumCallbackCalls=*/ 1 );
149147 }
150148}
149+
150+ } // end anonymous namespace
0 commit comments