Skip to content

Commit 52fb092

Browse files
dmcppcheckclaude
andcommitted
Tests: a function-like macro name at the end of the file should not be an error
gcc outputs the name, simplecpp reports wrong number of parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent df3b4c0 commit 52fb092

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎test.cpp‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,9 @@ static void define_invalid_3()
11501150
const char code[] = "#define R()\n"
11511151
"R\n";
11521152
simplecpp::OutputList outputList;
1153-
ASSERT_EQUALS("", preprocess(code, &outputList));
1154-
ASSERT_EQUALS("file0,2,syntax_error,failed to expand 'R', Wrong number of parameters for macro 'R'.\n", toString(outputList));
1153+
// TODO: a function-like macro name at the end of the file is not a macro call, gcc outputs R
1154+
TODO_ASSERT_EQUALS("\nR", "", preprocess(code, &outputList));
1155+
TODO_ASSERT_EQUALS("", "file0,2,syntax_error,failed to expand 'R', Wrong number of parameters for macro 'R'.\n", toString(outputList));
11551156
}
11561157

11571158
static void define_wrong_number_of_arguments()
@@ -1195,8 +1196,9 @@ static void define_invalid_4()
11951196
const char code[] = "#define X(...)\n"
11961197
"X\n";
11971198
simplecpp::OutputList outputList;
1198-
ASSERT_EQUALS("", preprocess(code, &outputList));
1199-
ASSERT_EQUALS("file0,2,syntax_error,failed to expand 'X', Wrong number of parameters for macro 'X'.\n", toString(outputList));
1199+
// TODO: a function-like macro name at the end of the file is not a macro call, gcc outputs X
1200+
TODO_ASSERT_EQUALS("\nX", "", preprocess(code, &outputList));
1201+
TODO_ASSERT_EQUALS("", "file0,2,syntax_error,failed to expand 'X', Wrong number of parameters for macro 'X'.\n", toString(outputList));
12001202
}
12011203

12021204
static void define_define_1()

0 commit comments

Comments
 (0)