Skip to content

Test the simplecpp portability reports and the macro usage arg in the dump - #4

Closed
JayToltTech wants to merge 1 commit into
cppchecksolutions:fix-15239from
JayToltTech:test-15239-portability
Closed

JayToltTech wants to merge 1 commit into
cppchecksolutions:fix-15239from
JayToltTech:test-15239-portability

Conversation

@JayToltTech

Copy link
Copy Markdown

Tests for cppcheck-opensource#9048, re the "Tests may be missing" note there. Two things that PR adds had no test.

portabilityReports checks that the backslash-space-newline and no-EOF-newline cases come out as simplecppPortabilityBackslash and simplecppPortabilityNoEofNewline with portability enabled, and that nothing is reported without it.

dumpMacroUsageArg checks that <macro-usage> gets arg="5" for INT64_C(5) and no arg for an ordinary function-like macro.

One commit on top of 69895d9. TestPreprocessor and TestSuppressions pass on macOS arm64 with -Werror, and runformat with uncrustify 0.80.1 makes no changes.

@JayToltTech
JayToltTech force-pushed the test-15239-portability branch from 23552e0 to 754456f Compare November 21, 2026 22:09
… dump

The simplecpp update reports PORTABILITY_BACKSLASH and
PORTABILITY_NO_EOF_NEWLINE as portability messages and writes the
argument of an integer constant macro call to <macro-usage>, with no
test for either. portabilityReports checks both ids are reported with
portability enabled and nothing without it. dumpMacroUsageArg checks
arg= is written for INT64_C(5) and left out for other macros.

getcode() now calls reportSimplecppPortability() after removeComments(),
as CppCheck::checkInternal does, so the main file's portability
messages reach the test logger.
@JayToltTech

Copy link
Copy Markdown
Author

cppcheck-opensource#9048 merged without these tests, so they're now a PR against main: cppcheck-opensource#9057.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant