[{"id":33135,"web_url":"https://patchwork.libcamera.org/comment/33135/","msgid":"<mes57kxlnoozxox2ui5hbu5wcu7wdkezkjo4rwcmlh57xb2lj3@li5kwwh7uf4d>","date":"2025-01-22T09:26:41","subject":"Re: [RFC PATCH v2 12/16] apps: lc-compliance: Add message to\n\t`GTEST_SKIP()`","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\n\nOn Tue, Jan 14, 2025 at 06:22:47PM +0000, Barnabás Pőcze wrote:\n> Just like other gtest macros, `GTEST_SKIP()` returns an object\n> to which a formatted message can be added using the usual `<<`\n> stream operator. So use it instead of printing to `std::cout`.\n>\n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  src/apps/lc-compliance/helpers/capture.cpp | 12 ++++--------\n>  1 file changed, 4 insertions(+), 8 deletions(-)\n>\n> diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp\n> index 91c4d4400..43db15d2d 100644\n> --- a/src/apps/lc-compliance/helpers/capture.cpp\n> +++ b/src/apps/lc-compliance/helpers/capture.cpp\n> @@ -26,10 +26,8 @@ void Capture::configure(StreamRole role)\n>  {\n>  \tconfig_ = camera_->generateConfiguration({ role });\n>\n> -\tif (!config_) {\n> -\t\tstd::cout << \"Role not supported by camera\" << std::endl;\n> -\t\tGTEST_SKIP();\n> -\t}\n> +\tif (!config_)\n> +\t\tGTEST_SKIP() << \"Role not supported by camera\";\n>\n>  \tif (config_->validate() != CameraConfiguration::Valid) {\n>  \t\tconfig_.reset();\n> @@ -85,10 +83,8 @@ void CaptureBalanced::capture(unsigned int numRequests)\n>\n>  \t/* No point in testing less requests then the camera depth. */\n>  \tif (buffers.size() > numRequests) {\n> -\t\tstd::cout << \"Camera needs \" + std::to_string(buffers.size())\n> -\t\t\t+ \" requests, can't test only \"\n> -\t\t\t+ std::to_string(numRequests) << std::endl;\n> -\t\tGTEST_SKIP();\n> +\t\tGTEST_SKIP() << \"Camera needs \" << buffers.size()\n> +\t\t\t     << \" requests, can't test only \" << numRequests;\n>  \t}\n>\n>  \tqueueCount_ = 0;\n> --\n> 2.48.0\n>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E2DB7BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 Jan 2025 09:26:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D720A68558;\n\tWed, 22 Jan 2025 10:26:45 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9DB2F6187C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jan 2025 10:26:44 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C5749520;\n\tWed, 22 Jan 2025 10:25:41 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"X3D6OJgV\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1737537941;\n\tbh=A9QPNGWcTFA9F3eYg9LdnQwiKgpirvztNcyvz/6B/EE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=X3D6OJgVkMvXGvuTjq3LUotAMAq/wp7QVCqiFjJA6fBd2QAHmjkqrHi+sV1mQA2SS\n\tp8lRkRLQIcofvLlTBSGsom1D5l56wTzvrg2Z+G2p73xV6c4v1d7CbTQeDvnrjCa1ht\n\t9/ZWx7DeJf8SD4sERJ38GxtYf+VbWaVp2UQ/E1+4=","Date":"Wed, 22 Jan 2025 10:26:41 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v2 12/16] apps: lc-compliance: Add message to\n\t`GTEST_SKIP()`","Message-ID":"<mes57kxlnoozxox2ui5hbu5wcu7wdkezkjo4rwcmlh57xb2lj3@li5kwwh7uf4d>","References":"<20250114182143.1773762-1-pobrn@protonmail.com>\n\t<20250114182143.1773762-13-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250114182143.1773762-13-pobrn@protonmail.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]