Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions test/cli/other_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4402,3 +4402,31 @@ def test_ctu_function_call_path_slash(tmp_path): # #14591
file = function_call_paths[0].attrib['file']
assert file
assert not '\\' in file # the path was incorrectly converted to native


# TODO: Remove duplication/builddir when 7079 is merged
def test_inline_block_suppr_builddir_twice(tmp_path):
test_file = tmp_path / 'test.c'
with open(test_file, 'wt') as f:
f.write("""
// cppcheck-suppress-begin [zerodiv]
x = 10 / 0;
// cppcheck-suppress-end [zerodiv]
""")

build_dir = tmp_path / 'b'
os.mkdir(build_dir)

args = [
'-q',
'--cppcheck-build-dir={}'.format(build_dir),
'--enable=all',
'--inline-suppr',
str(test_file)
]

for _ in range(2):
exitcode, stdout, stderr = cppcheck(args)
assert exitcode == 0
assert stdout == ''
assert stderr == ''
Loading