This NFC change accomplishes three things:
- Splits up the single unittest into reasonable segments.
- Extends the test infra using a template to select the AST-node from which it is supposed to construct a CallEvent.
- Adds a *lot* of different tests, documenting the current capabilities of the CallDescription. The corresponding tests are marked with FIXMEs, 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 EXPECTation 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.
If we had a call expr foo(1, 2) would that match {"foo", None} or {"foo", 2} ?