| 185 | |
| 186 | |
| 187 | def test_hash(tmpdir): |
| 188 | # Trac 14225 - warnings with hash |
| 189 | test_file = os.path.join(tmpdir, 'test.c') |
| 190 | addon_file = os.path.join(tmpdir, 'premiumaddon.py') |
| 191 | |
| 192 | with open(test_file, 'wt') as f: |
| 193 | f.write('void foo();\n') |
| 194 | |
| 195 | args = [f"--addon={addon_file}", '--xml', test_file] |
| 196 | |
| 197 | with open(addon_file, 'wt') as f: |
| 198 | f.write('print(\'{"addon":"a","column":1,"errorId":"id","extra":"","file":"test.c","hash":123,"linenr":1,"message":"bug","severity":"error"}\')') |
| 199 | |
| 200 | _, _, stderr = cppcheck(args) |
| 201 | assert '<error id="a-id" severity="error" msg="bug" verbose="bug" hash="123" ' in stderr |