test: camera: buffer_import: Fix error messages

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 <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund 2020-02-24 19:54:38 +01:00
parent a14b6baca9
commit 42a00cb617

View file

@ -74,12 +74,15 @@ public:
video_ = V4L2VideoDevice::fromEntityName(media_.get(), videoDeviceName); video_ = V4L2VideoDevice::fromEntityName(media_.get(), videoDeviceName);
if (!video_) { if (!video_) {
std::cout << "Unable to open " << videoDeviceName << std::endl; std::cout << "Failed to get video device from entity "
<< videoDeviceName << std::endl;
return TestFail; return TestFail;
} }
if (video_->open()) if (video_->open()) {
std::cout << "Unable to open " << videoDeviceName << std::endl;
return TestFail; return TestFail;
}
/* Configure the format. */ /* Configure the format. */
V4L2DeviceFormat format; V4L2DeviceFormat format;