Skip to content

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Sep 6, 2025

No description provided.

@firewave
Copy link
Collaborator Author

firewave commented Sep 6, 2025

Since simplecpp.cpp is standalone and not too small it makes for a good file to run on. It does not contain much modern code at the moment but I still think this makes for a nice smoketest for the AST and ValueFlow internals we usually only verify by the way the findings change.

@firewave firewave marked this pull request as ready for review September 8, 2025 08:57
Copy link

sonarqubecloud bot commented Sep 8, 2025

Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spontanously don't have a good feeling about this. such golden files are not easy to maintain. so if we fix various tokenizer, ast and valueflow problems we will potentially have to update the golden file even though nothing is wrong. We will not spot problems that exist in such big data.

Write tests that check if we do the right thing and don't need constant maintenance..

@firewave
Copy link
Collaborator Author

I understand that but we need something like this. The test coverage is not enough and this makes e.f. ValueFlow optimization work safer. I had several cases where the output didn't change but it is was actually totally wrong. We need to catch such things before going in daca. And it might not even manifest in there.

I chose simplecpp since it is just a single file. So there is no need to manually edit files but just pull the newer version from the CI and overwrite it.

I wanted to maintain this externally but that will most certainly bitrot if it is not tied to the build.

@firewave
Copy link
Collaborator Author

See #7768 (comment) for a case where this found a subtle bug I would have introduced.

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.

2 participants