From patchwork Tue Aug 10 15:12:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13286 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 AB3B5BD87D for ; Tue, 10 Aug 2021 15:11:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 93BC16888E; Tue, 10 Aug 2021 17:11:29 +0200 (CEST) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AF0DC6882A for ; Tue, 10 Aug 2021 17:11:27 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 13E9B200005; Tue, 10 Aug 2021 15:11:26 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 10 Aug 2021 17:12:08 +0200 Message-Id: <20210810151211.56702-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810151211.56702-1-jacopo@jmondi.org> References: <20210810151211.56702-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 2/5] test: control serialization: Test lookup by ControlId 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" Test that lookup by ControlId reference works in the control serialization test making sure that the control limits are not changed by de-serialization. The test currently fails and demonstates that lookup by ControlId is currently not supported until the introduction of the next patch. Signed-off-by: Jacopo Mondi Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- test/serialization/control_serialization.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/serialization/control_serialization.cpp b/test/serialization/control_serialization.cpp index e23383d13bd6..5ac9c4ede5f9 100644 --- a/test/serialization/control_serialization.cpp +++ b/test/serialization/control_serialization.cpp @@ -140,6 +140,15 @@ protected: return TestFail; } + /* Make sure control limits looked up by id are not changed. */ + const ControlInfo &newLimits = newInfoMap.at(&controls::Brightness); + const ControlInfo &initialLimits = infoMap.at(&controls::Brightness); + if (newLimits.min() != initialLimits.min() || + newLimits.max() != initialLimits.max()) { + cerr << "The brightness control limits have changed" << endl; + return TestFail; + } + /* Deserialize the control list and verify the contents. */ buffer = ByteStreamBuffer(const_cast(listData.data()), listData.size());