Skip to content

Commit 8ace12c

Browse files
committed
renamed find_all_of() to count_all_of()
1 parent e6ea41d commit 8ace12c

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
@@ -253,7 +253,7 @@ class TestProcessExecutor : public TestFixture {
253253
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
254254
const std::string output_s = GET_REDIRECT_OUTPUT;
255255
// for each file: top5 results + overall + empty line
256-
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::find_all_of(output_s, '\n'));
256+
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::count_all_of(output_s, '\n'));
257257
}
258258

259259
void showtime_top5_summary() {
@@ -263,7 +263,7 @@ class TestProcessExecutor : public TestFixture {
263263
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
264264
const std::string output_s = GET_REDIRECT_OUTPUT;
265265
// once: top5 results + overall + empty line
266-
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::find_all_of(output_s, '\n'));
266+
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::count_all_of(output_s, '\n'));
267267
// should only report the top5 once
268268
ASSERT(output_s.find("1 result(s)") == std::string::npos);
269269
TODO_ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -275,7 +275,7 @@ class TestProcessExecutor : public TestFixture {
275275
"int main() {}",
276276
true, SHOWTIME_MODES::SHOWTIME_FILE);
277277
const std::string output_s = GET_REDIRECT_OUTPUT;
278-
TODO_ASSERT_EQUALS(2, 0, cppcheck::find_all_of(output_s, "Overall time:"));
278+
TODO_ASSERT_EQUALS(2, 0, cppcheck::count_all_of(output_s, "Overall time:"));
279279
}
280280

281281
void showtime_summary() {
@@ -296,7 +296,7 @@ class TestProcessExecutor : public TestFixture {
296296
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
297297
const std::string output_s = GET_REDIRECT_OUTPUT;
298298
// for each file: top5 results + overall + empty line
299-
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::find_all_of(output_s, '\n'));
299+
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::count_all_of(output_s, '\n'));
300300
}
301301

302302
void showtime_top5_summary_j() {
@@ -306,7 +306,7 @@ class TestProcessExecutor : public TestFixture {
306306
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
307307
const std::string output_s = GET_REDIRECT_OUTPUT;
308308
// once: top5 results + overall + empty line
309-
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::find_all_of(output_s, '\n'));
309+
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::count_all_of(output_s, '\n'));
310310
// should only report the top5 once
311311
ASSERT(output_s.find("1 result(s)") == std::string::npos);
312312
TODO_ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -318,7 +318,7 @@ class TestProcessExecutor : public TestFixture {
318318
"int main() {}",
319319
true, SHOWTIME_MODES::SHOWTIME_FILE);
320320
const std::string output_s = GET_REDIRECT_OUTPUT;
321-
TODO_ASSERT_EQUALS(2, 0, cppcheck::find_all_of(output_s, "Overall time:"));
321+
TODO_ASSERT_EQUALS(2, 0, cppcheck::count_all_of(output_s, "Overall time:"));
322322
}
323323

324324
void showtime_summary_j() {

test/testthreadexecutor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class TestThreadExecutor : public TestFixture {
251251
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
252252
const std::string output_s = GET_REDIRECT_OUTPUT;
253253
// for each file: top5 results + overall + empty line
254-
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::find_all_of(output_s, '\n'));
254+
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::count_all_of(output_s, '\n'));
255255
}
256256

257257
void showtime_top5_summary() {
@@ -261,7 +261,7 @@ class TestThreadExecutor : public TestFixture {
261261
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
262262
const std::string output_s = GET_REDIRECT_OUTPUT;
263263
// once: top5 results + overall + empty line
264-
ASSERT_EQUALS(5 + 1 + 1, cppcheck::find_all_of(output_s, '\n'));
264+
ASSERT_EQUALS(5 + 1 + 1, cppcheck::count_all_of(output_s, '\n'));
265265
// should only report the top5 once
266266
ASSERT(output_s.find("1 result(s)") == std::string::npos);
267267
ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -273,7 +273,7 @@ class TestThreadExecutor : public TestFixture {
273273
"int main() {}",
274274
true, SHOWTIME_MODES::SHOWTIME_FILE);
275275
const std::string output_s = GET_REDIRECT_OUTPUT;
276-
ASSERT_EQUALS(2, cppcheck::find_all_of(output_s, "Overall time:"));
276+
ASSERT_EQUALS(2, cppcheck::count_all_of(output_s, "Overall time:"));
277277
}
278278

279279
void showtime_summary() {
@@ -294,7 +294,7 @@ class TestThreadExecutor : public TestFixture {
294294
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
295295
const std::string output_s = GET_REDIRECT_OUTPUT;
296296
// for each file: top5 results + overall + empty line
297-
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::find_all_of(output_s, '\n'));
297+
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::count_all_of(output_s, '\n'));
298298
}
299299

300300
void showtime_top5_summary_j() {
@@ -304,7 +304,7 @@ class TestThreadExecutor : public TestFixture {
304304
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
305305
const std::string output_s = GET_REDIRECT_OUTPUT;
306306
// once: top5 results + overall + empty line
307-
ASSERT_EQUALS(5 + 1 + 1, cppcheck::find_all_of(output_s, '\n'));
307+
ASSERT_EQUALS(5 + 1 + 1, cppcheck::count_all_of(output_s, '\n'));
308308
// should only report the top5 once
309309
ASSERT(output_s.find("1 result(s)") == std::string::npos);
310310
ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -316,7 +316,7 @@ class TestThreadExecutor : public TestFixture {
316316
"int main() {}",
317317
true, SHOWTIME_MODES::SHOWTIME_FILE);
318318
const std::string output_s = GET_REDIRECT_OUTPUT;
319-
ASSERT_EQUALS(2, cppcheck::find_all_of(output_s, "Overall time:"));
319+
ASSERT_EQUALS(2, cppcheck::count_all_of(output_s, "Overall time:"));
320320
}
321321

322322
void showtime_summary_j() {

0 commit comments

Comments
 (0)