Skip to content

TestAstUtils: fixed consistency of language being used in isSameExpressionTest / added a few language checks - #5728

Merged
chrchr-github merged 3 commits into
cppcheck-opensource:mainfrom
firewave:astutils-test
Jan 17, 2024
Merged

TestAstUtils: fixed consistency of language being used in isSameExpressionTest / added a few language checks#5728
chrchr-github merged 3 commits into
cppcheck-opensource:mainfrom
firewave:astutils-test

Conversation

@firewave

@firewavefirewave commented Dec 5, 2023

Copy link
Copy Markdown
Collaborator

For the isSameExpression() test we were tokenizing the code as C++ but were treating it as C later on.

@firewave

firewave commented Dec 5, 2023

Copy link
Copy Markdown
CollaboratorAuthor

Extracted from #5725. Still needs to actual fixes/improvements done. Could need some help with the failures though as I don't really understand what it tests.

@firewave

firewave commented Dec 11, 2023

Copy link
Copy Markdown
CollaboratorAuthor

There's lots of more inconsistencies in these tests. All of these need to be tested with C and C++ tokenizing. But I have no idea how to do this without duplicating most of the code. It is not ass simple as the executor tests which can simply get a global boolean passed in.

e.g. the isNullOperand() implementation is checking for C++ casts no matter the configured one.

@firewave
firewaveforce-pushed the astutils-test branch 2 times, most recently from 12c4f60 to 2173eb4CompareDecember 12, 2023 15:40
@firewave
firewaveforce-pushed the astutils-test branch 2 times, most recently from 6ec5ac1 to 60fb50bCompareJanuary 15, 2024 13:52
@firewave
firewave marked this pull request as ready for review January 15, 2024 13:52
@firewave

firewave commented Jan 15, 2024

Copy link
Copy Markdown
CollaboratorAuthor

The changes in the tests are expected. In case of C++ a + b and b + a are not being treated as being the same.

@firewavefirewave changed the title TestAstUtils: fixed consistency and improved coverageTestAstUtils: fixed consistency of language being usedJan 15, 2024
@firewavefirewave changed the title TestAstUtils: fixed consistency of language being usedTestAstUtils: fixed consistency of language being used in isSameExpressionTestJan 15, 2024
@firewavefirewave changed the title TestAstUtils: fixed consistency of language being used in isSameExpressionTestTestAstUtils: fixed consistency of language being used in isSameExpressionTest / added a few language checksJan 15, 2024
Comment threadtest/testastutils.cpp
firewaveand others added 3 commits January 17, 2024 13:06
…nTest()` asserts / added some TODOs about missing test coverage
Co-authored-by: chrchr-github <78114321+chrchr-github@users.noreply.github.com>
@chrchr-github
chrchr-github merged commit b7a43ff into cppcheck-opensource:mainJan 17, 2024
@firewave
firewave deleted the astutils-test branch January 17, 2024 13:49
Sign up for freeto 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.

2 participants

@firewave@chrchr-github