From patchwork Thu Jan 30 11:51:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22672 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AF96ABDB1C for ; Thu, 30 Jan 2025 11:51:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 67B4B6856B; Thu, 30 Jan 2025 12:51:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="CfDHkSCP"; dkim-atps=neutral Received: from mail-10631.protonmail.ch (mail-10631.protonmail.ch [79.135.106.31]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4CC9F68567 for ; Thu, 30 Jan 2025 12:51:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1738237881; x=1738497081; bh=DEbUidfSCnUI+HkVH6T6+a3fD4zi5Dum9YJRCtNXAks=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=CfDHkSCPLBVfiXgZISlu8egxBSblV9gDSv0OhVZnt1J1RQo+Sy8H9QWPOAuX15bLh flHOL2qx4MsjZyVvlwgXbqo6BEntH/zcJJeiQKbWw7psB9u9PhQZ7m3Rx53ibx5W/l eQWLc+t539PX8FVmG1M2qf6n78pac+eqZDd7IKZMqbuuHx368qQXtEDsMneaRs++Io TSZFkFVdDa0YZkyAuV0OklLNwiIlXE0fap3dIg7+8jfWLBU6g0hehLLW5bRRcJFw7V xSsaI8TafhYD30aKD8BWJQOIMNWiNHw6YuiS0sFl6clDyuhepdj9qPSOQA22vbqNL2 n9zyfDge3ZiQw== Date: Thu, 30 Jan 2025 11:51:16 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Cc: Jacopo Mondi , Paul Elder Subject: [RFC PATCH v3 15/21] apps: lc-compliance: Add message to `GTEST_SKIP()` Message-ID: <20250130115001.1129305-16-pobrn@protonmail.com> In-Reply-To: <20250130115001.1129305-1-pobrn@protonmail.com> References: <20250130115001.1129305-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: 238472c94445cd4844c5afd5464d7f1f0ec9bb7c MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Just like other gtest macros, `GTEST_SKIP()` returns an object to which a formatted message can be added using the usual `<<` stream operator. So use it instead of printing to `std::cout`. Signed-off-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi Reviewed-by: Paul Elder --- src/apps/lc-compliance/helpers/capture.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp index 91c4d4400..43db15d2d 100644 --- a/src/apps/lc-compliance/helpers/capture.cpp +++ b/src/apps/lc-compliance/helpers/capture.cpp @@ -26,10 +26,8 @@ void Capture::configure(StreamRole role) { config_ = camera_->generateConfiguration({ role }); - if (!config_) { - std::cout << "Role not supported by camera" << std::endl; - GTEST_SKIP(); - } + if (!config_) + GTEST_SKIP() << "Role not supported by camera"; if (config_->validate() != CameraConfiguration::Valid) { config_.reset(); @@ -85,10 +83,8 @@ void CaptureBalanced::capture(unsigned int numRequests) /* No point in testing less requests then the camera depth. */ if (buffers.size() > numRequests) { - std::cout << "Camera needs " + std::to_string(buffers.size()) - + " requests, can't test only " - + std::to_string(numRequests) << std::endl; - GTEST_SKIP(); + GTEST_SKIP() << "Camera needs " << buffers.size() + << " requests, can't test only " << numRequests; } queueCount_ = 0;