[libcamera-devel] [PATCH 1/3] test: v4l2_videodevice: dequeue_watchdog: Log message on failures

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Apr 7 10:37:17 CEST 2022


Failing a test without an error message makes it difficult to debug
issues. Add a message when buffer allocation fails.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 test/v4l2_videodevice/dequeue_watchdog.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/v4l2_videodevice/dequeue_watchdog.cpp b/test/v4l2_videodevice/dequeue_watchdog.cpp
index 0cb4de6f81a0..2282e3958c03 100644
--- a/test/v4l2_videodevice/dequeue_watchdog.cpp
+++ b/test/v4l2_videodevice/dequeue_watchdog.cpp
@@ -33,8 +33,10 @@ protected:
 		Timer timeout;
 
 		int ret = capture_->allocateBuffers(bufferCount, &buffers_);
-		if (ret < 0)
+		if (ret < 0) {
+			std::cout << "Failed to allocate buffers" << std::endl;
 			return TestFail;
+		}
 
 		capture_->dequeueTimeout.connect(this, &DequeueWatchdogTest::barkCounter);
 		capture_->setDequeueTimeout(5ms);
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list