From 7c75386ab255dc493b5c9e786b24151ece6d0e3d Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Tue, 30 Sep 2014 08:54:27 +0200 Subject: [PATCH] When garabage code is checked, iterate over all checks. --- test/testgarbage.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 95b9803ce..16719a49b 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -76,13 +76,11 @@ private: tokenizer.tokenize(istr, filename); tokenizer.simplifyTokenList2(); - // TODO: Run more checks - CheckOther checkOther(&tokenizer, &settings, this); - checkOther.runChecks(&tokenizer, &settings, this); - checkOther.runSimplifiedChecks(&tokenizer, &settings, this); - CheckStl checkStl(&tokenizer, &settings, this); - checkStl.runChecks(&tokenizer, &settings, this); - checkStl.runSimplifiedChecks(&tokenizer, &settings, this); + // call all "runChecks" in all registered Check classes + for (std::list::const_iterator it = Check::instances().begin(); it != Check::instances().end(); ++it) { + (*it)->runChecks(&tokenizer, &settings, this); + (*it)->runSimplifiedChecks(&tokenizer, &settings, this); + } return tokenizer.tokens()->stringifyList(false, false, false, true, false, 0, 0); }