diff --git a/test/cli/proj-inline-suppress/1.c b/test/cli/proj-inline-suppress/1.c index 484aeee6d..440fbf7cf 100644 --- a/test/cli/proj-inline-suppress/1.c +++ b/test/cli/proj-inline-suppress/1.c @@ -1,2 +1,5 @@ #include <1.h> +// cppcheck-suppress some_warning_id ; there should be a unmatchedSuppression warning about this +x; + diff --git a/test/cli/test-inline-suppress.py b/test/cli/test-inline-suppress.py index 31dad1ab1..eab10467b 100644 --- a/test/cli/test-inline-suppress.py +++ b/test/cli/test-inline-suppress.py @@ -15,3 +15,7 @@ def test2(): assert ret == 0 assert len(stderr) > 0 +def test_unmatched_suppression(): + ret, stdout, stderr = cppcheck(['--inline-suppr', '--enable=information', '--error-exitcode=1', 'proj-inline-suppress']) + assert ret == 1 + assert 'Unmatched suppression: some_warning_id' in stderr