CI: Add test for #11649 (#5380)

This commit is contained in:
Daniel Marjamäki 2023-08-31 16:46:20 +02:00 committed by GitHub
parent 1b061564d9
commit 22547beaaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -143,6 +143,19 @@ def test_progress_j(tmpdir):
assert stderr == ""
@pytest.mark.timeout(10)
def test_slow_array_many_floats(tmpdir):
# 11649
# cppcheck valueflow takes a long time when an array has many floats
filename = os.path.join(tmpdir, 'hang.c')
with open(filename, 'wt') as f:
f.write("const float f[] = {\n")
for i in range(20000):
f.write(' 13.6f,\n')
f.write("};\n")
cppcheck([filename]) # should not take more than ~1 second
@pytest.mark.timeout(10)
def test_slow_array_many_strings(tmpdir):
# 11901