From patchwork Fri Dec 20 15:08:41 2024 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: 22435 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 D3E10C3272 for ; Fri, 20 Dec 2024 15:08:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 90A31684AF; Fri, 20 Dec 2024 16:08:48 +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="QWUDwiFw"; dkim-atps=neutral Received: from mail-10630.protonmail.ch (mail-10630.protonmail.ch [79.135.106.30]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7FF79684AC for ; Fri, 20 Dec 2024 16:08:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1734707326; x=1734966526; bh=+iiPDfrcCv9OFJskYucvmMVv7O2CT3WTy/jBR5SZ7DE=; 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=QWUDwiFwr9d9tgR/pAlVMm+FTPYdKadMTILavWYgXqC/ZxcQ4pVn9HrBjxHGuzOYe n8llUSv4yGr50bW1PIZyfXpedroe0DXNyWE13QjZs2zWuqvH/m24zhZY5v6yhVt0nn MOgEYc9RRnC7zRnWaNyozPOHq5BlmJm7NyzxpczbbQvd2w3qXYP0SM754h3/EpmqSY MmNF38RZKp732jdzNr0U+bMYfCdYAbpopBbyb7k83jSJxdJkvg/S4QyP9lfQXWfByI ypqpZx0Tvsp52XIIy1cnHXT5GxwAvzpoF289gxZ2PV88z8RZAPRMIyeK8ePczeJJE/ hg29YArhi8kOw== Date: Fri, 20 Dec 2024 15:08:41 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [RFC PATCH v1 09/12] apps: lc-compliance: Check number of buffers in allocator Message-ID: <20241220150759.709756-10-pobrn@protonmail.com> In-Reply-To: <20241220150759.709756-1-pobrn@protonmail.com> References: <20241220150759.709756-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: 7d51ce620a41cac21baa4869851f4faf520fd0e6 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" Do a consistency check to ensure that the return value matches the number of buffers actually created. Signed-off-by: Barnabás Pőcze --- src/apps/lc-compliance/helpers/capture.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp index b473e0773..5cc7635f7 100644 --- a/src/apps/lc-compliance/helpers/capture.cpp +++ b/src/apps/lc-compliance/helpers/capture.cpp @@ -49,6 +49,7 @@ void Capture::start() ASSERT_GE(count, 0) << "Failed to allocate buffers"; EXPECT_EQ(count, config_->at(0).bufferCount) << "Allocated less buffers than expected"; + ASSERT_EQ(count, allocator_.buffers(stream).size()) << "Unexpected number of buffers in allocator"; camera_->requestCompleted.connect(this, &Capture::requestComplete);