Skip to content

Commit effbeb8

Browse files
Balazs BenicshaoNoQ
authored andcommitted
[analyzer][NFC] Add unittests for CallDescription and split the old ones
This NFC change accomplishes three things: 1) Splits up the single unittest into reasonable segments. 2) Extends the test infra using a template to select the AST-node from which it is supposed to construct a `CallEvent`. 3) Adds a *lot* of different tests, documenting the current capabilities of the `CallDescription`. The corresponding tests are marked with `FIXME`s, where the current behavior should be different. Both `CXXMemberCallExpr` and `CXXOperatorCallExpr` are derived from `CallExpr`, so they are matched by using the default template parameter. On the other hand, `CXXConstructExpr` is not derived from `CallExpr`. In case we want to match for them, we need to pass the type explicitly to the `CallDescriptionAction`. About destructors: They have no AST-node, but they are generated in the CFG machinery in the analyzer. Thus, to be able to match against them, we would need to construct a CFG and walk on that instead of simply walking the AST. I'm also relaxing the `EXPECT`ation in the `CallDescriptionConsumer::performTest()`, to check the `LookupResult` only if we matched for the `CallDescription`. This is necessary to allow tests in which we expect *no* matches at all. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D111794 (cherry picked from commit 5644d15) (cherry picked from commit f9aad16d8e923d3902147222a9542087c25df39b)
1 parent 3666c2c commit effbeb8

File tree

1 file changed

+371
-38
lines changed

1 file changed

+371
-38
lines changed

0 commit comments

Comments
 (0)