You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testcppcheck.cpp
+29-1Lines changed: 29 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,7 @@ class TestCppcheck : public TestFixture {
81
81
TEST_CASE(getDumpFileContentsLibrary);
82
82
TEST_CASE(premiumResultsCache);
83
83
TEST_CASE(toomanyconfigs);
84
+
TEST_CASE(purgedConfiguration);
84
85
}
85
86
86
87
voidgetErrorMessages() const {
@@ -568,7 +569,7 @@ class TestCppcheck : public TestFixture {
568
569
// this is the "simple" format
569
570
constauto s = dinit(Settings,
570
571
$.templateFormat = templateFormat, // TODO: remove when we only longer rely on toString() in unique message handling
571
-
$.severity.enable (Severity::information);
572
+
$.severity.enable (Severity::information);
572
573
$.maxConfigs = 2);
573
574
Suppressions supprs;
574
575
ErrorLogger2 errorLogger;
@@ -584,6 +585,33 @@ class TestCppcheck : public TestFixture {
584
585
ASSERT_EQUALS("a.c:0:0: information: Too many #ifdef configurations - cppcheck only checks 2 of 4 configurations. Use --force to check all configurations. [toomanyconfigs]", it->toString(false, templateFormat, ""));
585
586
}
586
587
588
+
voidpurgedConfiguration() const
589
+
{
590
+
ScopedFile test_file("test.cpp",
591
+
"#ifdef X\n"
592
+
"#endif\n"
593
+
"int main() {}\n");
594
+
595
+
// this is the "simple" format
596
+
constauto s = dinit(Settings,
597
+
$.templateFormat = templateFormat, // TODO: remove when we only longer rely on toString() in unique message handling
0 commit comments