From patchwork Wed Mar 4 23:22:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 2957 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BEEEF62826 for ; Thu, 5 Mar 2020 00:23:45 +0100 (CET) X-Halon-ID: 31220227-5e6f-11ea-9f85-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 31220227-5e6f-11ea-9f85-005056917a89; Thu, 05 Mar 2020 00:23:44 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Thu, 5 Mar 2020 00:22:40 +0100 Message-Id: <20200304232246.325384-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200304232246.325384-1-niklas.soderlund@ragnatech.se> References: <20200304232246.325384-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/7] test: camera: buffer_import: Fix error messages X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2020 23:23:46 -0000 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp index ab6e74bd1671e6f5..6997ea78c9f608c9 100644 --- a/test/camera/buffer_import.cpp +++ b/test/camera/buffer_import.cpp @@ -74,13 +74,16 @@ public: video_ = V4L2VideoDevice::fromEntityName(media_.get(), videoDeviceName); if (!video_) { + std::cout << "Failed to get video device from entity " + << videoDeviceName << std::endl; + return TestFail; + } + + if (video_->open()) { std::cout << "Unable to open " << videoDeviceName << std::endl; return TestFail; } - if (video_->open()) - return TestFail; - /* Configure the format. */ V4L2DeviceFormat format; if (video_->getFormat(&format)) {