summaryrefslogtreecommitdiff
path: root/test/event-dispatcher.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-03-22 22:32:55 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-03-25 13:11:12 +0200
commit54398c1583f18ef9daf1a9227691b14c3b7f4212 (patch)
treea172cf3f6ebc881f5b0ac9e7235e140c4ddebe1f /test/event-dispatcher.cpp
parent074fa98ac4ea903049ba9d7386cdb2f050ea3b48 (diff)
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'test/event-dispatcher.cpp')
-rw-r--r--test/event-dispatcher.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/event-dispatcher.cpp b/test/event-dispatcher.cpp
index 1cc17b04..9b07ab2b 100644
--- a/test/event-dispatcher.cpp
+++ b/test/event-dispatcher.cpp
@@ -16,8 +16,9 @@
#include "test.h"
-using namespace std;
using namespace libcamera;
+using namespace std;
+using namespace std::chrono_literals;
static EventDispatcher *dispatcher;
static bool interrupt;
@@ -50,7 +51,7 @@ protected:
/* Event processing interruption by signal. */
std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now();
- timer.start(1000);
+ timer.start(1000ms);
struct itimerval itimer = {};
itimer.it_value.tv_usec = 500000;
@@ -69,7 +70,7 @@ protected:
}
/* Event processing interruption. */
- timer.start(1000);
+ timer.start(1000ms);
dispatcher->interrupt();
dispatcher->processEvents();
@@ -79,7 +80,7 @@ protected:
return TestFail;
}
- timer.start(1000);
+ timer.start(1000ms);
itimer.it_value.tv_usec = 500000;
interrupt = true;
setitimer(ITIMER_REAL, &itimer, nullptr);