Skip to content

Commit b7e889a

Browse files
committed
Some test nits
1 parent 2ba38c4 commit b7e889a

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

test/testsingleexecutor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ class TestSingleExecutorBase : public TestFixture {
242242
dinit(CheckOptions,
243243
$.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE));
244244
const std::string output_s = GET_REDIRECT_OUTPUT;
245-
// for each file: top5 results + overall + empty line
246-
ASSERT_EQUALS((5 + 1 + 1) * 2LL, cppcheck::count_all_of(output_s, '\n'));
245+
// for each file: top5 results + overall
246+
ASSERT_EQUALS((5 + 1) * 2LL, cppcheck::count_all_of(output_s, '\n'));
247247
}
248248

249249
void showtime_top5_summary() {
@@ -253,8 +253,8 @@ class TestSingleExecutorBase : public TestFixture {
253253
dinit(CheckOptions,
254254
$.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY));
255255
const std::string output_s = GET_REDIRECT_OUTPUT;
256-
// once: top5 results + overall + empty line
257-
ASSERT_EQUALS(5 + 1 + 1, cppcheck::count_all_of(output_s, '\n'));
256+
// once: top5 results + overall
257+
ASSERT_EQUALS(5 + 1, cppcheck::count_all_of(output_s, '\n'));
258258
// should only report the top5 once
259259
ASSERT(output_s.find("1 result(s)") == std::string::npos);
260260
ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -267,7 +267,7 @@ class TestSingleExecutorBase : public TestFixture {
267267
dinit(CheckOptions,
268268
$.showtime = SHOWTIME_MODES::SHOWTIME_FILE));
269269
const std::string output_s = GET_REDIRECT_OUTPUT;
270-
ASSERT_EQUALS(2, cppcheck::count_all_of(output_s, "Overall time:"));
270+
ASSERT_EQUALS(1, cppcheck::count_all_of(output_s, "Overall time:"));
271271
}
272272

273273
void showtime_summary() {

test/testthreadexecutor.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,9 @@ class TestThreadExecutorBase : public TestFixture {
233233
"int main() {}",
234234
dinit(CheckOptions,
235235
$.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE));
236-
// for each file: top5 results + overall + empty line
237236
const std::string output_s = GET_REDIRECT_OUTPUT;
238-
// for each file: top5 results + overall + empty line
239-
ASSERT_EQUALS((5 + 1 + 1) * 2LL, cppcheck::count_all_of(output_s, '\n'));
237+
// for each file: top5 results + overall
238+
ASSERT_EQUALS((5 + 1) * 2LL, cppcheck::count_all_of(output_s, '\n'));
240239
}
241240

242241
void showtime_top5_summary() {
@@ -246,8 +245,8 @@ class TestThreadExecutorBase : public TestFixture {
246245
dinit(CheckOptions,
247246
$.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_SUMMARY));
248247
const std::string output_s = GET_REDIRECT_OUTPUT;
249-
// once: top5 results + overall + empty line
250-
ASSERT_EQUALS(5 + 1 + 1, cppcheck::count_all_of(output_s, '\n'));
248+
// once: top5 results + overall
249+
ASSERT_EQUALS(5 + 1, cppcheck::count_all_of(output_s, '\n'));
251250
// should only report the top5 once
252251
ASSERT(output_s.find("1 result(s)") == std::string::npos);
253252
ASSERT(output_s.find("2 result(s)") != std::string::npos);
@@ -260,7 +259,7 @@ class TestThreadExecutorBase : public TestFixture {
260259
dinit(CheckOptions,
261260
$.showtime = SHOWTIME_MODES::SHOWTIME_FILE));
262261
const std::string output_s = GET_REDIRECT_OUTPUT;
263-
ASSERT_EQUALS(2, cppcheck::count_all_of(output_s, "Overall time:"));
262+
ASSERT_EQUALS(1, cppcheck::count_all_of(output_s, "Overall time:"));
264263
}
265264

266265
void showtime_summary() {

0 commit comments

Comments
 (0)