codeql icon indicating copy to clipboard operation
codeql copied to clipboard

C++: Port SimpleRangeAnalysis tests to the new range-analysis

Open MathiasVP opened this issue 3 years ago • 2 comments

This PR copy/pastes almost all the tests we had for SimpleRangeAnalysis into a testfile that's exercised by the new range-analysis library, and then moves the file over to use InlineExpectationsTest.

Commit-by-commit review recommended:

  • https://github.com/github/codeql/commit/c4c7c95db2889bbc19c4d46c6a6bf91054b8077d does the copy/paste. Nothing else is going on in this commit.
  • https://github.com/github/codeql/commit/d14b2c2880c1a53dc6c5fd96c0b1b848d0c0cc84 makes it possible for the expected values to have whitespace in them. This is needed to print expected values containing bounds with a toString that contains spaces (for example if a bound is call to foo + 42).
  • Finally, https://github.com/github/codeql/commit/56b5010f6b505ad03af1b36d2a20fd6d2921d4b6 converts the file to InlineExpectationsTest by adding a bunch of InlineExpectations comments.

MathiasVP avatar Sep 30 '22 13:09 MathiasVP

Needs a .expected file

rdmarsh2 avatar Sep 30 '22 15:09 rdmarsh2

There's already an RangeAnalysis.expected in the directory. So I don't think that should be needed? That said, I see that tests are failing, but I'm getting a 500 when trying to see the error :(

MathiasVP avatar Sep 30 '22 15:09 MathiasVP