Skip to content

Commit

Permalink
Update testincompletestatement.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed May 8, 2024
1 parent f18d3fd commit 5472804
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/testincompletestatement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> files(1, "test.cpp");
std::vector<std::string> files(1, cpp ? "test.cpp" : "test.c");
Tokenizer tokenizer(settings1, *this);
PreprocessorHelper::preprocess(code, files, tokenizer, *this);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5472804

Please sign in to comment.