Skip to content

Commit 1428543

Browse files
committed
test
1 parent edb0bf6 commit 1428543

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/cli/premium_test.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,16 @@ def test_hash(tmpdir):
199199

200200
_, _, stderr = cppcheck(args)
201201
assert '<error id="a-id" severity="error" msg="bug" verbose="bug" hash="123" ' in stderr
202+
203+
204+
def test_misra_unusedLabel(tmpdir):
205+
""" #14467 - unusedLabel should be activated by --premium=misra-c-20xx """
206+
test_file = os.path.join(tmpdir, 'test.c')
207+
with open(test_file, 'wt') as f:
208+
f.write('void foo() {\n'
209+
'L1:\n'
210+
'}\n')
211+
212+
exe = __copy_cppcheck_premium(tmpdir)
213+
_, _, stderr = cppcheck(['--premium=misra-c-2012', 'test.c'], cppcheck_exe=exe, cwd=tmpdir)
214+
assert "test.c:2:1: style: Label 'L1' is not used. [unusedLabel]" in stderr

0 commit comments

Comments
 (0)