Skip to content

Commit 5c6233b

Browse files
committed
renamed find_all_of() to count_all_of()
1 parent 1990b96 commit 5c6233b

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 ScopedFile {
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
@@ -238,7 +238,7 @@ class TestProcessExecutor : public TestFixture {
238238
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
239239
const std::string output_s = GET_REDIRECT_OUTPUT;
240240
// for each file: top5 results + overall + empty line
241-
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::find_all_of(output_s, '\n'));
241+
TODO_ASSERT_EQUALS((5 + 1 + 1) * 2, 0, cppcheck::count_all_of(output_s, '\n'));
242242
}
243243

244244
void showtime_top5_summary() {
@@ -248,7 +248,7 @@ class TestProcessExecutor : public TestFixture {
248248
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
249249
const std::string output_s = GET_REDIRECT_OUTPUT;
250250
// once: top5 results + overall + empty line
251-
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::find_all_of(output_s, '\n'));
251+
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::count_all_of(output_s, '\n'));
252252
// should only report the top5 once
253253
ASSERT(output_s.find("1 result(s)") == std::string::npos);
254254
TODO_ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -260,7 +260,7 @@ class TestProcessExecutor : public TestFixture {
260260
"int main() {}",
261261
true, SHOWTIME_MODES::SHOWTIME_FILE);
262262
const std::string output_s = GET_REDIRECT_OUTPUT;
263-
TODO_ASSERT_EQUALS(2, 0, cppcheck::find_all_of(output_s, "Overall time:"));
263+
TODO_ASSERT_EQUALS(2, 0, cppcheck::count_all_of(output_s, "Overall time:"));
264264
}
265265

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

287287
void showtime_top5_summary_j() {
@@ -291,7 +291,7 @@ class TestProcessExecutor : public TestFixture {
291291
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
292292
const std::string output_s = GET_REDIRECT_OUTPUT;
293293
// once: top5 results + overall + empty line
294-
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::find_all_of(output_s, '\n'));
294+
TODO_ASSERT_EQUALS(5 + 1 + 1, 0, cppcheck::count_all_of(output_s, '\n'));
295295
// should only report the top5 once
296296
ASSERT(output_s.find("1 result(s)") == std::string::npos);
297297
TODO_ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -303,7 +303,7 @@ class TestProcessExecutor : public TestFixture {
303303
"int main() {}",
304304
true, SHOWTIME_MODES::SHOWTIME_FILE);
305305
const std::string output_s = GET_REDIRECT_OUTPUT;
306-
TODO_ASSERT_EQUALS(2, 0, cppcheck::find_all_of(output_s, "Overall time:"));
306+
TODO_ASSERT_EQUALS(2, 0, cppcheck::count_all_of(output_s, "Overall time:"));
307307
}
308308

309309
void showtime_summary_j() {

test/testthreadexecutor.cpp

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

241241
void showtime_top5_summary() {
@@ -245,7 +245,7 @@ class TestThreadExecutor : public TestFixture {
245245
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
246246
const std::string output_s = GET_REDIRECT_OUTPUT;
247247
// once: top5 results + overall + empty line
248-
ASSERT_EQUALS(5 + 1 + 1, cppcheck::find_all_of(output_s, '\n'));
248+
ASSERT_EQUALS(5 + 1 + 1, cppcheck::count_all_of(output_s, '\n'));
249249
// should only report the top5 once
250250
ASSERT(output_s.find("1 result(s)") == std::string::npos);
251251
ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -257,7 +257,7 @@ class TestThreadExecutor : public TestFixture {
257257
"int main() {}",
258258
true, SHOWTIME_MODES::SHOWTIME_FILE);
259259
const std::string output_s = GET_REDIRECT_OUTPUT;
260-
ASSERT_EQUALS(2, cppcheck::find_all_of(output_s, "Overall time:"));
260+
ASSERT_EQUALS(2, cppcheck::count_all_of(output_s, "Overall time:"));
261261
}
262262

263263
void showtime_summary() {
@@ -278,7 +278,7 @@ class TestThreadExecutor : public TestFixture {
278278
true, SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
279279
const std::string output_s = GET_REDIRECT_OUTPUT;
280280
// for each file: top5 results + overall + empty line
281-
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::find_all_of(output_s, '\n'));
281+
ASSERT_EQUALS((5 + 1 + 1) * 2, cppcheck::count_all_of(output_s, '\n'));
282282
}
283283

284284
void showtime_top5_summary_j() {
@@ -288,7 +288,7 @@ class TestThreadExecutor : public TestFixture {
288288
true, SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY);
289289
const std::string output_s = GET_REDIRECT_OUTPUT;
290290
// once: top5 results + overall + empty line
291-
ASSERT_EQUALS(5 + 1 + 1, cppcheck::find_all_of(output_s, '\n'));
291+
ASSERT_EQUALS(5 + 1 + 1, cppcheck::count_all_of(output_s, '\n'));
292292
// should only report the top5 once
293293
ASSERT(output_s.find("1 result(s)") == std::string::npos);
294294
ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -300,7 +300,7 @@ class TestThreadExecutor : public TestFixture {
300300
"int main() {}",
301301
true, SHOWTIME_MODES::SHOWTIME_FILE);
302302
const std::string output_s = GET_REDIRECT_OUTPUT;
303-
ASSERT_EQUALS(2, cppcheck::find_all_of(output_s, "Overall time:"));
303+
ASSERT_EQUALS(2, cppcheck::count_all_of(output_s, "Overall time:"));
304304
}
305305

306306
void showtime_summary_j() {

0 commit comments

Comments
 (0)