Skip to content

Commit 07aef40

Browse files
committed
add test
1 parent ff4d7ce commit 07aef40

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/cli/dumpfile_test.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,17 @@ def test_container_methods(tmpdir):
132132
with open(dumpfile, 'rt') as f:
133133
dump = f.read()
134134
assert '<f name="emplace" action="push" yield="iterator"/>' in dump
135+
136+
def test_line_macro(tmpdir):
137+
test_file = str(tmpdir / 'test.cpp')
138+
with open(test_file, 'wt') as f:
139+
f.write('#define MACRO() __LINE__\n')
140+
f.write('int x = MACRO();\n')
141+
142+
exitcode, _, stderr = cppcheck(['--dump', test_file])
143+
assert exitcode == 0, stderr
144+
145+
dumpfile = test_file + '.dump'
146+
with open(dumpfile, 'rt') as f:
147+
dump = f.read()
148+
assert 'type="number" isInt="true" macroName="__LINE__"' in dump

0 commit comments

Comments
 (0)