Skip to content

Commit 22547be

Browse files
authored
CI: Add test for #11649 (#5380)
1 parent 1b06156 commit 22547be

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/cli/test-other.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,19 @@ def test_progress_j(tmpdir):
143143
assert stderr == ""
144144

145145

146+
@pytest.mark.timeout(10)
147+
def test_slow_array_many_floats(tmpdir):
148+
# 11649
149+
# cppcheck valueflow takes a long time when an array has many floats
150+
filename = os.path.join(tmpdir, 'hang.c')
151+
with open(filename, 'wt') as f:
152+
f.write("const float f[] = {\n")
153+
for i in range(20000):
154+
f.write(' 13.6f,\n')
155+
f.write("};\n")
156+
cppcheck([filename]) # should not take more than ~1 second
157+
158+
146159
@pytest.mark.timeout(10)
147160
def test_slow_array_many_strings(tmpdir):
148161
# 11901

0 commit comments

Comments
 (0)