From patchwork Mon Aug 9 15:23:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 13263 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 1E68DC3240 for ; Mon, 9 Aug 2021 15:22:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D87856888F; Mon, 9 Aug 2021 17:22:28 +0200 (CEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 260A460269 for ; Mon, 9 Aug 2021 17:22:25 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 57B42FF804; Mon, 9 Aug 2021 15:22:24 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 9 Aug 2021 17:23:05 +0200 Message-Id: <20210809152308.31947-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809152308.31947-1-jacopo@jmondi.org> References: <20210809152308.31947-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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());