diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-26 15:36:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 12:49:42 +0000 |
commit | 994e38e336beeacbd983faafac480afc94d3947e (patch) | |
tree | f6dd4fc3427d9051701637d2d052a9a51bb76c88 /compilerplugins/clang/cppunitassertequals.cxx | |
parent | upload poppler 0.51.0 (diff) | |
download | core-994e38e336beeacbd983faafac480afc94d3947e.tar.gz core-994e38e336beeacbd983faafac480afc94d3947e.zip |
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>
Diffstat (limited to 'compilerplugins/clang/cppunitassertequals.cxx')
-rw-r--r-- | compilerplugins/clang/cppunitassertequals.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compilerplugins/clang/cppunitassertequals.cxx b/compilerplugins/clang/cppunitassertequals.cxx index f14dde6300e4..e9f4c0256516 100644 --- a/compilerplugins/clang/cppunitassertequals.cxx +++ b/compilerplugins/clang/cppunitassertequals.cxx @@ -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( |