diff --git a/samples/multiCondition/good.c b/samples/multiCondition/good.c index 715844f85ca..ad4007458c4 100644 --- a/samples/multiCondition/good.c +++ b/samples/multiCondition/good.c @@ -8,4 +8,4 @@ int main() { f(true); return 0; -} \ No newline at end of file +} diff --git a/test/cli/other_test.py b/test/cli/other_test.py index 8e13489e114..618445495ba 100644 --- a/test/cli/other_test.py +++ b/test/cli/other_test.py @@ -157,7 +157,7 @@ def test_progress(tmpdir): int main(int argc) { } - """) +""") args = ['--report-progress=0', '--enable=all', '--inconclusive', '-j1', test_file] @@ -248,7 +248,7 @@ def test_progress_j(tmpdir): int main(int argc) { } - """) +""") args = ['--report-progress=0', '--enable=all', '--inconclusive', '-j2', '--disable=unusedFunction', test_file] @@ -2764,7 +2764,7 @@ def __test_addon_suppr(tmp_path, extra_args): // cppcheck-suppress misra-c2012-2.3 typedef int MISRA_5_6_VIOLATION; typedef int MISRA_5_6_VIOLATION_1; - """) +""") args = [ '-q', @@ -2818,7 +2818,7 @@ def test_ctu_path_builddir(tmp_path): # #11883 int *p = 0; f(p); } - """) +""") args = [ '-q', @@ -4522,7 +4522,7 @@ def run_and_assert_cppcheck(stdout_exp): # modified file with open(test_file, 'a') as f: - f.write('\n#define DEF') + f.write('\n#define DEF\n') run_and_assert_cppcheck([ "discarding cached result from '{}' for '{}' - hash mismatch".format(test_a1_file_s, test_file_s) @@ -4930,10 +4930,10 @@ def test_ipc_inline_suppressions(tmp_path): def test_ipc_hash_suppressions(tmp_path): test_file = tmp_path / 'test.c' with open(test_file, "w") as f: - f.write('void f() { int x = 1; }') + f.write('void f() { int x = 1; }\n') _, _, stderr = cppcheck(['--enable=style', '--xml-version=3', str(test_file)]) - error_hash = ElementTree.fromstring(stderr).find('.//error').get('hash') + error_hash = ElementTree.fromstring(stderr).find(".//error[@id='unreadVariable']").get('hash') suppr_file = tmp_path / 'suppr.xml' with open(suppr_file, "w") as f: diff --git a/test/cli/whole-program/odr.h b/test/cli/whole-program/odr.h index 29965892446..5d59c76411e 100644 --- a/test/cli/whole-program/odr.h +++ b/test/cli/whole-program/odr.h @@ -4,4 +4,4 @@ class Base { }; extern Base *c1_create(); -extern Base *c2_create(); \ No newline at end of file +extern Base *c2_create();