From patchwork Tue Jan 14 18:22:47 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: 22573 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 4981DC3304 for ; Tue, 14 Jan 2025 18:22:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 073F968545; Tue, 14 Jan 2025 19:22:53 +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="whD6m168"; 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 BFD1E68521 for ; Tue, 14 Jan 2025 19:22:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1736878970; x=1737138170; bh=tmCTVUWVvSTdiqZyWSIPZBhQc6EskgTjxCnrRw+re4Q=; h=Date:To:From: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=whD6m168pxvavQD0DFP6VqvjzkxPRcpxlwpzTRQFYLFq0JDPLcB/qS+WvkaB74oR1 cF6c2K+jlr0QV+EBFXwO3u9oDHtu0m/UPz2fi4fJBjap/+/EER8DU5S0wXg06Qetp0 r+7YOITDH+/CaSrqZzaNe//JCPVISxWVAwVEhteOk04qxpNPSFp13A9IId8GghWD5a 74niS4iTWjVVS76oHZrfcmUMcgL2cxqQy8s8ZNXo2M95SBme4O7PKtAKBo1kF5TBI9 p2zig8gvhBdlsQZg7mdet4+DdwXdWaUC+vuljva6xvy7Cq0nuVA7qn0o7bMv2Hq1C0 nnGnA7BOKv7EA== Date: Tue, 14 Jan 2025 18:22:47 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [RFC PATCH v2 12/16] apps: lc-compliance: Add message to `GTEST_SKIP()` Message-ID: <20250114182143.1773762-13-pobrn@protonmail.com> In-Reply-To: <20250114182143.1773762-1-pobrn@protonmail.com> References: <20250114182143.1773762-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: 8c5bb2fa7ee2c35ca8236f68d94a9139c71bdcf4 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 --- 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;