From 22547beaaf4ed53a60c962a593138b5c4664fa6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 31 Aug 2023 16:46:20 +0200 Subject: [PATCH] CI: Add test for #11649 (#5380) --- test/cli/test-other.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/cli/test-other.py b/test/cli/test-other.py index 56a45af53..2d58b2584 100644 --- a/test/cli/test-other.py +++ b/test/cli/test-other.py @@ -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