Skip to content

Commit 8fab393

Browse files
committed
renamed find_all_of() to count_all_of()
1 parent 36427c3 commit 8fab393

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

test/helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class PreprocessorHelper
9494

9595
namespace cppcheck {
9696
template<typename T>
97-
std::size_t find_all_of(const std::string& str, T sub) {
97+
std::size_t count_all_of(const std::string& str, T sub) {
9898
std::size_t n = 0;
9999
std::string::size_type pos = 0;
100100
while ((pos = str.find(sub, pos)) != std::string::npos) {

test/testprocessexecutor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class TestProcessExecutor : public TestFixture {
242242
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
243243
const std::string output_s = GET_REDIRECT_OUTPUT;
244244
// for each file: top5 results + overall + empty line
245-
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::find_all_of(output_s, '\n'));
245+
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::count_all_of(output_s, '\n'));
246246
}
247247

248248
void showtime_top5_summary() {
@@ -252,7 +252,7 @@ class TestProcessExecutor : public TestFixture {
252252
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
253253
const std::string output_s = GET_REDIRECT_OUTPUT;
254254
// once: top5 results + overall + empty line
255-
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::find_all_of(output_s, '\n'));
255+
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::count_all_of(output_s, '\n'));
256256
// should only report the top5 once
257257
ASSERT(output_s.find("1 result(s)") == std::string::npos);
258258
TODO_ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -264,7 +264,7 @@ class TestProcessExecutor : public TestFixture {
264264
"int main() {}",
265265
true, SHOWTIME_MODES::SHOWTIME_FILE);
266266
const std::string output_s = GET_REDIRECT_OUTPUT;
267-
TODO_ASSERT_EQUALS(2, 0, cppcheck::find_all_of(output_s, "Overall time:"));
267+
TODO_ASSERT_EQUALS(2, 0, cppcheck::count_all_of(output_s, "Overall time:"));
268268
}
269269

270270
void showtime_summary() {
@@ -285,7 +285,7 @@ class TestProcessExecutor : public TestFixture {
285285
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
286286
const std::string output_s = GET_REDIRECT_OUTPUT;
287287
// for each file: top5 results + overall + empty line
288-
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::find_all_of(output_s, '\n'));
288+
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::count_all_of(output_s, '\n'));
289289
}
290290

291291
void showtime_top5_summary_j() {
@@ -295,7 +295,7 @@ class TestProcessExecutor : public TestFixture {
295295
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
296296
const std::string output_s = GET_REDIRECT_OUTPUT;
297297
// once: top5 results + overall + empty line
298-
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::find_all_of(output_s, '\n'));
298+
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::count_all_of(output_s, '\n'));
299299
// should only report the top5 once
300300
ASSERT(output_s.find("1 result(s)") == std::string::npos);
301301
TODO_ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -307,7 +307,7 @@ class TestProcessExecutor : public TestFixture {
307307
"int main() {}",
308308
true, SHOWTIME_MODES::SHOWTIME_FILE);
309309
const std::string output_s = GET_REDIRECT_OUTPUT;
310-
TODO_ASSERT_EQUALS(2, 0, cppcheck::find_all_of(output_s, "Overall time:"));
310+
TODO_ASSERT_EQUALS(2, 0, cppcheck::count_all_of(output_s, "Overall time:"));
311311
}
312312

313313
void showtime_summary_j() {

test/testthreadexecutor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class TestThreadExecutor : public TestFixture {
240240
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
241241
const std::string output_s = GET_REDIRECT_OUTPUT;
242242
// for each file: top5 results + overall + empty line
243-
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::find_all_of(output_s, '\n'));
243+
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::count_all_of(output_s, '\n'));
244244
}
245245

246246
void showtime_top5_summary() {
@@ -250,7 +250,7 @@ class TestThreadExecutor : public TestFixture {
250250
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
251251
const std::string output_s = GET_REDIRECT_OUTPUT;
252252
// once: top5 results + overall + empty line
253-
ASSERT_EQUALS(5 + 1 + 1, cppcheck::find_all_of(output_s, '\n'));
253+
ASSERT_EQUALS(5 + 1 + 1, cppcheck::count_all_of(output_s, '\n'));
254254
// should only report the top5 once
255255
ASSERT(output_s.find("1 result(s)") == std::string::npos);
256256
ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -262,7 +262,7 @@ class TestThreadExecutor : public TestFixture {
262262
"int main() {}",
263263
true, SHOWTIME_MODES::SHOWTIME_FILE);
264264
const std::string output_s = GET_REDIRECT_OUTPUT;
265-
ASSERT_EQUALS(2, cppcheck::find_all_of(output_s, "Overall time:"));
265+
ASSERT_EQUALS(2, cppcheck::count_all_of(output_s, "Overall time:"));
266266
}
267267

268268
void showtime_summary() {
@@ -283,7 +283,7 @@ class TestThreadExecutor : public TestFixture {
283283
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
284284
const std::string output_s = GET_REDIRECT_OUTPUT;
285285
// for each file: top5 results + overall + empty line
286-
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::find_all_of(output_s, '\n'));
286+
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::count_all_of(output_s, '\n'));
287287
}
288288

289289
void showtime_top5_summary_j() {
@@ -293,7 +293,7 @@ class TestThreadExecutor : public TestFixture {
293293
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
294294
const std::string output_s = GET_REDIRECT_OUTPUT;
295295
// once: top5 results + overall + empty line
296-
ASSERT_EQUALS(5 + 1 + 1, cppcheck::find_all_of(output_s, '\n'));
296+
ASSERT_EQUALS(5 + 1 + 1, cppcheck::count_all_of(output_s, '\n'));
297297
// should only report the top5 once
298298
ASSERT(output_s.find("1 result(s)") == std::string::npos);
299299
ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -305,7 +305,7 @@ class TestThreadExecutor : public TestFixture {
305305
"int main() {}",
306306
true, SHOWTIME_MODES::SHOWTIME_FILE);
307307
const std::string output_s = GET_REDIRECT_OUTPUT;
308-
ASSERT_EQUALS(2, cppcheck::find_all_of(output_s, "Overall time:"));
308+
ASSERT_EQUALS(2, cppcheck::count_all_of(output_s, "Overall time:"));
309309
}
310310

311311
void showtime_summary_j() {

0 commit comments

Comments
 (0)