MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / __test_inline_suppr

Function __test_inline_suppr

test/cli/other_test.py:2510–2534  ·  view source on GitHub ↗
(tmp_path, extra_args)

Source from the content-addressed store, hash-verified

2508
2509# TODO: remove all overrides when fully fixed
2510def __test_inline_suppr(tmp_path, extra_args): # #13087
2511 test_file = tmp_path / 'test.c'
2512 with open(test_file, 'wt') as f:
2513 f.write("""
2514void f() {
2515 // cppcheck-suppress memleak
2516}
2517""")
2518
2519 args = [
2520 '-q',
2521 '--template=simple',
2522 '--enable=information',
2523 '--inline-suppr',
2524 str(test_file)
2525 ]
2526
2527 args += extra_args
2528
2529 exitcode, stdout, stderr, = cppcheck(args)
2530 assert exitcode == 0, stdout
2531 assert stdout == ''
2532 assert stderr.splitlines() == [
2533 '{}:4:1: information: Unmatched suppression: memleak [unmatchedSuppression]'.format(test_file)
2534 ]
2535
2536
2537def test_inline_suppr(tmp_path):

Calls 4

cppcheckFunction · 0.90
strFunction · 0.85
formatMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected