Skip to content

Commit 45e3b2d

Browse files
committed
Nits
1 parent a576a54 commit 45e3b2d

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

lib/cppcheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::str
895895
if (Settings::terminated())
896896
return mLogger->exitcode();
897897

898-
Timer WholeFileTimer{file.spath(), mSettings.showtime};
898+
const Timer fileTotalTimer{file.spath(), mSettings.showtime};
899899

900900
if (!mSettings.quiet) {
901901
std::string fixedpath = Path::toNativeSeparators(file.spath());

lib/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class CPPCHECKLIB Timer {
9595
const std::string mStr;
9696
TimerResultsIntf* mTimerResults{};
9797
const SHOWTIME_MODES mShowTimeMode = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL;
98-
TimePoint mStartTimePoint{};
98+
TimePoint mStartTimePoint;
9999
};
100100

101101
//---------------------------------------------------------------------------

test/testtimer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ class TestTimer : public TestFixture {
3333
}
3434

3535
void result() const {
36-
// TODO add some tests
36+
TimerResultsData t1;
37+
t1.mDuration = Duration{1234};
38+
ASSERT(t1.getSeconds().count() > 1.233 && t1.getSeconds().count() < 1.235);
39+
40+
// TODO : more tests
3741
}
3842
};
3943

0 commit comments

Comments
 (0)