@@ -46,6 +46,11 @@ class TestSuppressions : public TestFixture {
4646
4747private:
4848
49+ class CppCheckExecutorTest final : public CppCheckExecutor
50+ {
51+ friend class TestSuppressions ;
52+ };
53+
4954 const std::string templateFormat{" {callstack}: ({severity}) {inconclusive:inconclusive: }{message}" };
5055
5156 void run () override {
@@ -289,7 +294,7 @@ class TestSuppressions : public TestFixture {
289294 SingleExecutor executor (cppCheck, filelist, fileSettings, settings, supprs, *this , nullptr );
290295 unsigned int exitCode = executor.check ();
291296
292- const bool err = CppCheckExecutor ::reportUnmatchedSuppressions (settings, supprs.nomsg , filelist, fileSettings, *this );
297+ const bool err = CppCheckExecutorTest ::reportUnmatchedSuppressions (settings, supprs.nomsg , filelist, fileSettings, *this );
293298 if (err && exitCode == 0 )
294299 exitCode = 1 ;
295300
@@ -335,10 +340,10 @@ class TestSuppressions : public TestFixture {
335340 if (useFS)
336341 filelist.clear ();
337342
338- ThreadExecutor executor (filelist, fileSettings, settings, supprs, *this , nullptr , CppCheckExecutor ::executeCommand);
343+ ThreadExecutor executor (filelist, fileSettings, settings, supprs, *this , nullptr , CppCheckExecutorTest ::executeCommand);
339344 unsigned int exitCode = executor.check ();
340345
341- const bool err = CppCheckExecutor ::reportUnmatchedSuppressions (settings, supprs.nomsg , filelist, fileSettings, *this );
346+ const bool err = CppCheckExecutorTest ::reportUnmatchedSuppressions (settings, supprs.nomsg , filelist, fileSettings, *this );
342347 if (err && exitCode == 0 )
343348 exitCode = 1 ;
344349
@@ -385,10 +390,10 @@ class TestSuppressions : public TestFixture {
385390 if (useFS)
386391 filelist.clear ();
387392
388- ProcessExecutor executor (filelist, fileSettings, settings, supprs, *this , nullptr , CppCheckExecutor ::executeCommand);
393+ ProcessExecutor executor (filelist, fileSettings, settings, supprs, *this , nullptr , CppCheckExecutorTest ::executeCommand);
389394 unsigned int exitCode = executor.check ();
390395
391- const bool err = CppCheckExecutor ::reportUnmatchedSuppressions (settings, supprs.nomsg , filelist, fileSettings, *this );
396+ const bool err = CppCheckExecutorTest ::reportUnmatchedSuppressions (settings, supprs.nomsg , filelist, fileSettings, *this );
392397 if (err && exitCode == 0 )
393398 exitCode = 1 ;
394399
@@ -1534,7 +1539,7 @@ class TestSuppressions : public TestFixture {
15341539 // No unmatched suppression
15351540 {
15361541 SuppressionList suppressions;
1537- ASSERT_EQUALS (false , CppCheckExecutor ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
1542+ ASSERT_EQUALS (false , CppCheckExecutorTest ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
15381543 ASSERT_EQUALS (" " , errout_str ());
15391544 }
15401545
@@ -1543,7 +1548,7 @@ class TestSuppressions : public TestFixture {
15431548 SuppressionList suppressions;
15441549 addCheckedSuppression (suppressions, {" abc" , " a.c" , 10U });
15451550 addCheckedSuppression (suppressions, {" unmatchedSuppression" , " *" , SuppressionList::Suppression::NO_LINE});
1546- ASSERT_EQUALS (false , CppCheckExecutor ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
1551+ ASSERT_EQUALS (false , CppCheckExecutorTest ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
15471552 ASSERT_EQUALS (" " , errout_str ());
15481553 }
15491554
@@ -1552,7 +1557,7 @@ class TestSuppressions : public TestFixture {
15521557 SuppressionList suppressions;
15531558 addCheckedSuppression (suppressions, {" abc" , " a.c" , 10U });
15541559 addCheckedSuppression (suppressions, {" unmatchedSuppression" , " " , SuppressionList::Suppression::NO_LINE});
1555- ASSERT_EQUALS (false , CppCheckExecutor ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
1560+ ASSERT_EQUALS (false , CppCheckExecutorTest ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
15561561 ASSERT_EQUALS (" " , errout_str ());
15571562 }
15581563
@@ -1561,7 +1566,7 @@ class TestSuppressions : public TestFixture {
15611566 SuppressionList suppressions;
15621567 addCheckedSuppression (suppressions, {" abc" , " a.c" , 10U });
15631568 addCheckedSuppression (suppressions, {" unmatchedSuppression" , " a.c" , SuppressionList::Suppression::NO_LINE});
1564- ASSERT_EQUALS (false , CppCheckExecutor ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
1569+ ASSERT_EQUALS (false , CppCheckExecutorTest ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
15651570 ASSERT_EQUALS (" " , errout_str ());
15661571 }
15671572
@@ -1570,7 +1575,7 @@ class TestSuppressions : public TestFixture {
15701575 SuppressionList suppressions;
15711576 addCheckedSuppression (suppressions, {" abc" , " a.c" , 10U });
15721577 addCheckedSuppression (suppressions, {" unmatchedSuppression" , " a.c" , 10U });
1573- ASSERT_EQUALS (false , CppCheckExecutor ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
1578+ ASSERT_EQUALS (false , CppCheckExecutorTest ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
15741579 ASSERT_EQUALS (" " , errout_str ());
15751580 }
15761581
@@ -1579,7 +1584,7 @@ class TestSuppressions : public TestFixture {
15791584 SuppressionList suppressions;
15801585 addCheckedSuppression (suppressions, {" abc" , " a.c" , 10U });
15811586 addCheckedSuppression (suppressions, {" unmatchedSuppression" , " b.c" , SuppressionList::Suppression::NO_LINE});
1582- ASSERT_EQUALS (true , CppCheckExecutor ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
1587+ ASSERT_EQUALS (true , CppCheckExecutorTest ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
15831588 ASSERT_EQUALS (" [a.c:10:0]: (information) Unmatched suppression: abc [unmatchedSuppression]\n " , errout_str ());
15841589 }
15851590
@@ -1588,7 +1593,7 @@ class TestSuppressions : public TestFixture {
15881593 SuppressionList suppressions;
15891594 addCheckedSuppression (suppressions, {" abc" , " a.c" , 10U });
15901595 addCheckedSuppression (suppressions, {" unmatchedSuppression" , " a.c" , 1U });
1591- ASSERT_EQUALS (true , CppCheckExecutor ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
1596+ ASSERT_EQUALS (true , CppCheckExecutorTest ::reportUnmatchedSuppressions (settingsDefault, suppressions, files, fs, *this ));
15921597 ASSERT_EQUALS (" [a.c:10:0]: (information) Unmatched suppression: abc [unmatchedSuppression]\n " , errout_str ());
15931598 }
15941599 }
0 commit comments