From 42a00cb6172230b822f5c8a910b73e94d4be84cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Mon, 24 Feb 2020 19:54:38 +0100 Subject: test: camera: buffer_import: Fix error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error message for when a device name can't be resolved to a video device is wrong and applies to the next operation below it. Move it to its correct location and add a new error message to highlight the resolution failure. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- test/camera/buffer_import.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/camera') diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp index ab6e74bd..6997ea78 100644 --- a/test/camera/buffer_import.cpp +++ b/test/camera/buffer_import.cpp @@ -74,12 +74,15 @@ public: video_ = V4L2VideoDevice::fromEntityName(media_.get(), videoDeviceName); if (!video_) { - std::cout << "Unable to open " << videoDeviceName << std::endl; + std::cout << "Failed to get video device from entity " + << videoDeviceName << std::endl; return TestFail; } - if (video_->open()) + if (video_->open()) { + std::cout << "Unable to open " << videoDeviceName << std::endl; return TestFail; + } /* Configure the format. */ V4L2DeviceFormat format; -- cgit v1.2.1