Fixed Cppcheck shadowVar warnings

This commit is contained in:
Daniel Marjamäki 2019-04-30 21:01:18 +02:00
parent 66064fb2bb
commit 7260bdd6d8
2 changed files with 4 additions and 7 deletions

View File

@ -541,8 +541,8 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
return false; return false;
} }
for (const std::string &i : mSettings->project.guiProject.excludedPaths) for (const std::string &ignorePath : mSettings->project.guiProject.excludedPaths)
mIgnoredPaths.emplace_back(i); mIgnoredPaths.emplace_back(ignorePath);
const std::string platform(mSettings->project.guiProject.platform); const std::string platform(mSettings->project.guiProject.platform);

View File

@ -316,17 +316,14 @@ std::size_t TestFixture::runTests(const options& args)
countTests = 0; countTests = 0;
errmsg.str(""); errmsg.str("");
const std::set<std::string>& tests = args.which_test(); for (std::string classname : args.which_test()) {
for (std::string classname : tests) {
std::string testname; std::string testname;
if (classname.find("::") != std::string::npos) { if (classname.find("::") != std::string::npos) {
testname = classname.substr(classname.find("::") + 2); testname = classname.substr(classname.find("::") + 2);
classname.erase(classname.find("::")); classname.erase(classname.find("::"));
} }
const TestSet &tests = TestRegistry::theInstance().tests(); for (TestFixture * test : TestRegistry::theInstance().tests()) {
for (TestFixture * test : tests) {
if (classname.empty() || test->classname == classname) { if (classname.empty() || test->classname == classname) {
test->processOptions(args); test->processOptions(args);
test->run(testname); test->run(testname);