{"id":13286,"url":"https://patchwork.libcamera.org/api/1.1/patches/13286/?format=json","web_url":"https://patchwork.libcamera.org/patch/13286/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210810151211.56702-3-jacopo@jmondi.org>","date":"2021-08-10T15:12:08","name":"[libcamera-devel,v4,2/5] test: control serialization: Test lookup by ControlId","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a7d4fb2bfb27d3aa718f800a6a41c15275bbaae6","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13286/mbox/","series":[{"id":2334,"url":"https://patchwork.libcamera.org/api/1.1/series/2334/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2334","date":"2021-08-10T15:12:06","name":"libcamera: Initialize controls in the IPA","version":4,"mbox":"https://patchwork.libcamera.org/series/2334/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13286/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13286/checks/","tags":{},"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 AB3B5BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 Aug 2021 15:11:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 93BC16888E;\n\tTue, 10 Aug 2021 17:11:29 +0200 (CEST)","from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AF0DC6882A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 Aug 2021 17:11:27 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id 13E9B200005;\n\tTue, 10 Aug 2021 15:11:26 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 2/5] test: control serialization: Test\n\tlookup by ControlId","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>"},"content":"Test that lookup by ControlId reference works in the control\nserialization test making sure that the control limits are not changed by\nde-serialization.\n\nThe test currently fails and demonstates that lookup by ControlId is\ncurrently not supported until the introduction of the next patch.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/serialization/control_serialization.cpp | 9 +++++++++\n 1 file changed, 9 insertions(+)","diff":"diff --git a/test/serialization/control_serialization.cpp b/test/serialization/control_serialization.cpp\nindex e23383d13bd6..5ac9c4ede5f9 100644\n--- a/test/serialization/control_serialization.cpp\n+++ b/test/serialization/control_serialization.cpp\n@@ -140,6 +140,15 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\t/* Make sure control limits looked up by id are not changed. */\n+\t\tconst ControlInfo &newLimits = newInfoMap.at(&controls::Brightness);\n+\t\tconst ControlInfo &initialLimits = infoMap.at(&controls::Brightness);\n+\t\tif (newLimits.min() != initialLimits.min() ||\n+\t\t    newLimits.max() != initialLimits.max()) {\n+\t\t\tcerr << \"The brightness control limits have changed\" << endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n \t\t/* Deserialize the control list and verify the contents. */\n \t\tbuffer = ByteStreamBuffer(const_cast<const uint8_t *>(listData.data()),\n \t\t\t\t\t  listData.size());\n","prefixes":["libcamera-devel","v4","2/5"]}