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

Function test_stack_overflow_AST

test/cli/performance_test.py:150–170  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

148
149@pytest.mark.timeout(35)
150def test_stack_overflow_AST(tmpdir):
151 # 14435
152 filename = os.path.join(tmpdir, 'hang.cpp')
153 with open(filename, 'wt') as f:
154 f.write("""
155#define ROW 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
156#define ROW8 ROW ROW ROW ROW ROW ROW ROW ROW
157#define ROW64 ROW8 ROW8 ROW8 ROW8 ROW8 ROW8 ROW8 ROW8
158#define ROW512 ROW64 ROW64 ROW64 ROW64 ROW64 ROW64 ROW64 ROW64
159#define ROW4096 ROW512 ROW512 ROW512 ROW512 ROW512 ROW512 ROW512 ROW512
160#define ROW32768 ROW4096 ROW4096 ROW4096 ROW4096 ROW4096 ROW4096 ROW4096 ROW4096
161void f(std::vector<int>& v) {
162 v = {
163 ROW32768 0
164 };
165}
166 """)
167
168 my_env = os.environ.copy()
169 my_env["DISABLE_VALUEFLOW"] = "1"
170 cppcheck([filename], env=my_env)
171
172
173@pytest.mark.timeout(10)

Callers

nothing calls this directly

Calls 4

cppcheckFunction · 0.90
joinMethod · 0.45
writeMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected