Skip to content

Commit a9edee3

Browse files
committed
const-ify some references in test folder
1 parent de2d053 commit a9edee3

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

test/cppcheck_suppressions.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ cstyleCast
9696
functionStatic
9797
shadowFunction
9898

99-
constVariable
10099
stlcstrConstructor
101100
stlcstrStream
102101
uselessCallsSubstr

test/optimization/optimization.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ModSecurity, http://www.modsecurity.org/
3-
* Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/)
3+
* Copyright (c) 2015 - 2023 Trustwave Holdings, Inc. (http://www.trustwave.com/)
44
*
55
* You may not use this file except in compliance with
66
* the License. You may obtain a copy of the License at
@@ -114,8 +114,8 @@ int main(int argc, char **argv) {
114114
}
115115

116116
std::cout << " Operators" << std::endl;
117-
for (auto &z : operators) {
118-
auto &s = z.second;
117+
for (const auto &z : operators) {
118+
const auto &s = z.second;
119119
std::cout << " " << std::left << std::setw(20) << z.first;
120120
std::cout << std::right << std::setw(4) << s;
121121
std::cout << std::endl;

test/regression/regression.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ModSecurity, http://www.modsecurity.org/
3-
* Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/)
3+
* Copyright (c) 2015 - 2023 Trustwave Holdings, Inc. (http://www.trustwave.com/)
44
*
55
* You may not use this file except in compliance with
66
* the License. You may obtain a copy of the License at
@@ -540,7 +540,7 @@ int main(int argc, char **argv) {
540540
}
541541

542542
ModSecurityTestResults<RegressionTestResult> res;
543-
for (std::string &a : keyList) {
543+
for (const std::string &a : keyList) {
544544
test_number++;
545545
if ((test.m_test_number == 0)
546546
|| (test_number == test.m_test_number)) {

test/unit/unit.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ModSecurity, http://www.modsecurity.org/
3-
* Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/)
3+
* Copyright (c) 2015 - 2023 Trustwave Holdings, Inc. (http://www.trustwave.com/)
44
*
55
* You may not use this file except in compliance with
66
* the License. You may obtain a copy of the License at
@@ -168,7 +168,7 @@ int main(int argc, char **argv) {
168168
if (r.size() == 0) {
169169
std::cout << KGRN << "0 tests failed.";
170170
} else {
171-
for (auto &i : r) {
171+
for (const auto &i : r) {
172172
if (i->skipped == true) {
173173
skp++;
174174
}
@@ -203,7 +203,7 @@ int main(int argc, char **argv) {
203203
std::cout << KGRN << "All tests passed" << RESET << std::endl;
204204
} else {
205205
int skp = 0;
206-
for (auto &i : results) {
206+
for (const auto &i : results) {
207207
if (i->skipped == true) {
208208
skp++;
209209
}

0 commit comments

Comments
 (0)