From 5472804493277e0020350fb12af53d3cd058b5d0 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 8 May 2024 14:15:11 +0200 Subject: [PATCH] Update testincompletestatement.cpp --- test/testincompletestatement.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index c3a65ed4b66..e70cffc1480 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -34,10 +34,10 @@ class TestIncompleteStatement : public TestFixture { const Settings settings = settingsBuilder().severity(Severity::warning).build(); #define check(...) check_(__FILE__, __LINE__, __VA_ARGS__) - void check_(const char* file, int line, const char code[], bool inconclusive = false) { + void check_(const char* file, int line, const char code[], bool inconclusive = false, bool cpp = true) { const Settings settings1 = settingsBuilder(settings).certainty(Certainty::inconclusive, inconclusive).build(); - std::vector files(1, "test.cpp"); + std::vector files(1, cpp ? "test.cpp" : "test.c"); Tokenizer tokenizer(settings1, *this); PreprocessorHelper::preprocess(code, files, tokenizer, *this); @@ -743,7 +743,7 @@ class TestIncompleteStatement : public TestFixture { check("void f() { char * const * a, * const * b; }", true); ASSERT_EQUALS("", errout_str()); - check("void f() { char * const * a = 0, * volatile restrict * b; }", true); + check("void f() { char * const * a = 0, * volatile restrict * b; }", true, /*cpp*/ false); ASSERT_EQUALS("", errout_str()); check("void f() { char * const * a = 0, * volatile const * b; }", true);