summaryrefslogtreecommitdiff
path: root/test/camera
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/camera
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/camera')
-rw-r--r--test/camera/buffer_import.cpp3
-rw-r--r--test/camera/camera_reconfigure.cpp3
-rw-r--r--test/camera/capture.cpp3
3 files changed, 6 insertions, 3 deletions
diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp
index c504ea09..92884004 100644
--- a/test/camera/buffer_import.cpp
+++ b/test/camera/buffer_import.cpp
@@ -25,6 +25,7 @@
#include "test.h"
using namespace libcamera;
+using namespace std::chrono_literals;
namespace {
@@ -135,7 +136,7 @@ protected:
EventDispatcher *dispatcher = Thread::current()->eventDispatcher();
Timer timer;
- timer.start(1000);
+ timer.start(1000ms);
while (timer.isRunning())
dispatcher->processEvents();
diff --git a/test/camera/camera_reconfigure.cpp b/test/camera/camera_reconfigure.cpp
index 0fd8ab70..f6076baa 100644
--- a/test/camera/camera_reconfigure.cpp
+++ b/test/camera/camera_reconfigure.cpp
@@ -23,6 +23,7 @@
using namespace libcamera;
using namespace std;
+using namespace std::chrono_literals;
namespace {
@@ -117,7 +118,7 @@ private:
EventDispatcher *dispatcher = Thread::current()->eventDispatcher();
Timer timer;
- timer.start(100);
+ timer.start(100ms);
while (timer.isRunning())
dispatcher->processEvents();
diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp
index f3824f95..de824083 100644
--- a/test/camera/capture.cpp
+++ b/test/camera/capture.cpp
@@ -18,6 +18,7 @@
using namespace libcamera;
using namespace std;
+using namespace std::chrono_literals;
namespace {
@@ -137,7 +138,7 @@ protected:
EventDispatcher *dispatcher = Thread::current()->eventDispatcher();
Timer timer;
- timer.start(1000);
+ timer.start(1000ms);
while (timer.isRunning())
dispatcher->processEvents();