From 7260bdd6d8c00c4effefd61c7192df7d42ff7406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 30 Apr 2019 21:01:18 +0200 Subject: [PATCH] Fixed Cppcheck shadowVar warnings --- cli/cmdlineparser.cpp | 4 ++-- test/testsuite.cpp | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index f6710c010..a9c97c892 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -541,8 +541,8 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[]) return false; } - for (const std::string &i : mSettings->project.guiProject.excludedPaths) - mIgnoredPaths.emplace_back(i); + for (const std::string &ignorePath : mSettings->project.guiProject.excludedPaths) + mIgnoredPaths.emplace_back(ignorePath); const std::string platform(mSettings->project.guiProject.platform); diff --git a/test/testsuite.cpp b/test/testsuite.cpp index 167ced325..a696d528a 100644 --- a/test/testsuite.cpp +++ b/test/testsuite.cpp @@ -316,17 +316,14 @@ std::size_t TestFixture::runTests(const options& args) countTests = 0; errmsg.str(""); - const std::set& tests = args.which_test(); - for (std::string classname : tests) { + for (std::string classname : args.which_test()) { std::string testname; if (classname.find("::") != std::string::npos) { testname = classname.substr(classname.find("::") + 2); classname.erase(classname.find("::")); } - const TestSet &tests = TestRegistry::theInstance().tests(); - - for (TestFixture * test : tests) { + for (TestFixture * test : TestRegistry::theInstance().tests()) { if (classname.empty() || test->classname == classname) { test->processOptions(args); test->run(testname);