Testing backwards compatible inline suppression
This commit is contained in:
parent
c3517924d0
commit
c3de128a5f
|
@ -0,0 +1,6 @@
|
|||
// From forum: https://sourceforge.net/p/cppcheck/discussion/general/thread/e67653efdb/
|
||||
void foo()
|
||||
{ // cppcheck-suppress zerodiv
|
||||
int x = 10000 / 0;
|
||||
}
|
||||
|
|
@ -24,3 +24,10 @@ def test_unmatched_suppression_path_with_extra_stuf():
|
|||
ret, stdout, stderr = cppcheck(['--inline-suppr', '--enable=information', '--error-exitcode=1', './proj-inline-suppress/2.c'])
|
||||
assert ret == 1
|
||||
assert 'Unmatched suppression: some_warning_id' in stderr
|
||||
|
||||
def test_backwards_compatibility():
|
||||
ret, stdout, stderr = cppcheck(['proj-inline-suppress/3.cpp'])
|
||||
assert '[zerodiv]' in stderr
|
||||
|
||||
ret, stdout, stderr = cppcheck(['--inline-suppr', 'proj-inline-suppress/3.cpp'])
|
||||
assert stderr == ''
|
||||
|
|
Loading…
Reference in New Issue