From 54398c1583f18ef9daf1a9227691b14c3b7f4212 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 22 Mar 2022 22:32:55 +0200 Subject: libcamera: base: timer: Drop start() overload with int argument The start(unsigned int msec) overload is error-prone, as the argument unit can easily be mistaken in callers. Drop it and update all callers to use the start(std::chrono::milliseconds) overload instead. The callers now need to use std::chrono_literals. The using statement could be added to timer.h for convenience, but "using" is discouraged in header files to avoid namespace pollution. Update the callers instead, and while at it, sort the "using" statements alphabetically in tests. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain --- test/event.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/event.cpp') diff --git a/test/event.cpp b/test/event.cpp index d4765eb1..19dceae1 100644 --- a/test/event.cpp +++ b/test/event.cpp @@ -16,8 +16,9 @@ #include "test.h" -using namespace std; using namespace libcamera; +using namespace std; +using namespace std::chrono_literals; class EventTest : public Test { @@ -55,7 +56,7 @@ protected: return TestFail; } - timeout.start(100); + timeout.start(100ms); dispatcher->processEvents(); timeout.stop(); @@ -67,7 +68,7 @@ protected: /* Test read notification without data. */ notified_ = false; - timeout.start(100); + timeout.start(100ms); dispatcher->processEvents(); timeout.stop(); @@ -86,7 +87,7 @@ protected: return TestFail; } - timeout.start(100); + timeout.start(100ms); dispatcher->processEvents(); timeout.stop(); @@ -99,7 +100,7 @@ protected: notified_ = false; notifier_->setEnabled(true); - timeout.start(100); + timeout.start(100ms); dispatcher->processEvents(); timeout.stop(); -- cgit v1.2.1