From patchwork Mon Feb 24 19:35:58 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: 2875 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C21D360438 for ; Mon, 24 Feb 2020 20:36:24 +0100 (CET) X-Halon-ID: ee190fbf-573c-11ea-9f40-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id ee190fbf-573c-11ea-9f40-0050569116f7; Mon, 24 Feb 2020 20:36:19 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Feb 2020 20:35:58 +0100 Message-Id: <20200224193601.1040770-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200224193601.1040770-1-niklas.soderlund@ragnatech.se> References: <20200224193601.1040770-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/4] 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: Mon, 24 Feb 2020 19:36:25 -0000 The error message for when a device name can't be resolved to an video device is wrong and applies to the next operation bellow it. Move it to it's 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)) {