Skip to content

Commit

Permalink
Fix, simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jan 4, 2025
1 parent 65e54b5 commit 25d1801
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/cli/whole-program_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,9 @@ def __test_nullpointer_file0(extra_args):
ret, stdout, stderr = cppcheck(args, cwd=__script_dir)
results = ET.fromstring(stderr)
file0 = ''
for e in results.findall('errors/error'):
if e.attrib['id'] == 'ctunullpointer':
if 'file0' in e.attrib:
file0 = e.attrib['file0']
for e in results.findall('errors/error[@id="ctunullpointer"]'):
if 'file0' in e.attrib:
file0 = e.attrib['file0']
assert file0 == 'whole-program/nullpointer1.cpp'
assert stdout == ''
assert ret == 1, stdout
Expand All @@ -385,7 +384,7 @@ def __test_nullpointer_file0(extra_args):
def test_nullpointer_file0():
__test_nullpointer_file0(['-j1'])

def test_nullpointer_file0_j():
def test_nullpointer_file0_j(tmpdir):
build_dir = os.path.join(tmpdir, 'b1')
os.mkdir(build_dir)
__test_nullpointer_file0(['-j2', '--cppcheck-build-dir={}'.format(build_dir)])

0 comments on commit 25d1801

Please sign in to comment.