diff --git a/test/cppcheck_suppressions.txt b/test/cppcheck_suppressions.txt index 2d5a2150..ebbc665e 100644 --- a/test/cppcheck_suppressions.txt +++ b/test/cppcheck_suppressions.txt @@ -96,7 +96,6 @@ cstyleCast functionStatic shadowFunction -constVariable stlcstrConstructor stlcstrStream uselessCallsSubstr diff --git a/test/optimization/optimization.cc b/test/optimization/optimization.cc index 5443065b..f4014058 100644 --- a/test/optimization/optimization.cc +++ b/test/optimization/optimization.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2023 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -114,8 +114,8 @@ int main(int argc, char **argv) { } std::cout << " Operators" << std::endl; - for (auto &z : operators) { - auto &s = z.second; + for (const auto &z : operators) { + const auto &s = z.second; std::cout << " " << std::left << std::setw(20) << z.first; std::cout << std::right << std::setw(4) << s; std::cout << std::endl; diff --git a/test/regression/regression.cc b/test/regression/regression.cc index b4c9dca3..6343c9e1 100644 --- a/test/regression/regression.cc +++ b/test/regression/regression.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2023 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -540,7 +540,7 @@ int main(int argc, char **argv) { } ModSecurityTestResults res; - for (std::string &a : keyList) { + for (const std::string &a : keyList) { test_number++; if ((test.m_test_number == 0) || (test_number == test.m_test_number)) { diff --git a/test/unit/unit.cc b/test/unit/unit.cc index 49aeabd2..4d75ba94 100644 --- a/test/unit/unit.cc +++ b/test/unit/unit.cc @@ -1,6 +1,6 @@ /* * ModSecurity, http://www.modsecurity.org/ - * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) + * Copyright (c) 2015 - 2023 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * You may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -168,7 +168,7 @@ int main(int argc, char **argv) { if (r.size() == 0) { std::cout << KGRN << "0 tests failed."; } else { - for (auto &i : r) { + for (const auto &i : r) { if (i->skipped == true) { skp++; } @@ -203,7 +203,7 @@ int main(int argc, char **argv) { std::cout << KGRN << "All tests passed" << RESET << std::endl; } else { int skp = 0; - for (auto &i : results) { + for (const auto &i : results) { if (i->skipped == true) { skp++; }