Skip to content

unit test failed for checking multiline comments #419

Open
@clock999

Description

@clock999

While running the unit tests for simple app, the case checking for multiline comments is failed. The test code is as below. The expected result of the test is to get an output "void f ( ) { }".

static void comment_multiline()
{
    const char code[] = "#define ABC {// \\\n"
                        "}\n"
                        "void f() ABC\n";
    ASSERT_EQUALS("\n\nvoid f ( ) { }", preprocess(code));
}

I think the translated result of "void f() ABC" should be "void f ( ) {". If we code the magic string in a real file, it should be as below.

#define ABC {// \
}
void f() ABC

If so, the ending brace should be commented.
https://sourceforge.net/p/cppcheck/discussion/general/thread/37c6eba151/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions