loplugin: use TypeCheck instead of getQualifiedNameAsString

since the latter is rather slow

Change-Id: Ib73cdb923585580777c2265b561c1808e93b2baa
Reviewed-on: https://gerrit.libreoffice.org/33585
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-01-26 15:36:47 +02:00
parent eb6c18dfbe
commit 994e38e336
11 changed files with 58 additions and 47 deletions

View File

@@ -13,6 +13,7 @@
#include <fstream>
#include <set>
#include "plugin.hxx"
#include "check.hxx"
/**
Check for calls to CPPUNIT_ASSERT when it should be using CPPUNIT_ASSERT_EQUALS
@@ -87,7 +88,9 @@ void CppunitAssertEquals::checkExpr(const Stmt* stmt)
return;
}
const FunctionDecl* functionDecl = callExpr->getDirectCallee()->getCanonicalDecl();
if (!functionDecl || functionDecl->getQualifiedNameAsString().find("Asserter::failIf") == std::string::npos) {
if (!functionDecl ||
!loplugin::DeclCheck(functionDecl).Function("failIf").Namespace("Asserter").Namespace("CppUnit").GlobalNamespace())
{
return;
}
report(