{"id":10053,"url":"https://patchwork.libcamera.org/api/1.1/patches/10053/?format=json","web_url":"https://patchwork.libcamera.org/patch/10053/","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":"<20201013151241.3557005-8-kieran.bingham@ideasonboard.com>","date":"2020-10-13T15:12:38","name":"[libcamera-devel,07/10] test: v4l2_videodevice: Prevent variable aliasing of format","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"2c7de0271f48396814dfb69455c3330d2894d614","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/1.1/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10053/mbox/","series":[{"id":1374,"url":"https://patchwork.libcamera.org/api/1.1/series/1374/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1374","date":"2020-10-13T15:12:31","name":"Shadowed Variables","version":1,"mbox":"https://patchwork.libcamera.org/series/1374/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10053/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10053/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 3CF0BBEEDF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Oct 2020 15:12:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EA04060E93;\n\tTue, 13 Oct 2020 17:12:54 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D514660E13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Oct 2020 17:12:48 +0200 (CEST)","from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7115C18F8;\n\tTue, 13 Oct 2020 17:12:48 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"r22LUIrB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1602601968;\n\tbh=3GOR7MMzan0eYYBTrnO/IS1f+CR4RYMhZGua83FZLpo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=r22LUIrBjisw5ar4bX90AKZJwuIj4pkot7Qym8OsyxvAJZGg8ebJTHCcyYlbIVC6R\n\t+Qe8U1faxNHDqIlsYfTZLPRjOnSBYmMsNF1LhyirnFUOXIhqICzKDDKJeFZCRscRNz\n\tStgkHgywEiMRXZlg3tW1x0L+njJnJcdPiNJVRKvE=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Tue, 13 Oct 2020 16:12:38 +0100","Message-Id":"<20201013151241.3557005-8-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20201013151241.3557005-1-kieran.bingham@ideasonboard.com>","References":"<20201013151241.3557005-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 07/10] test: v4l2_videodevice: Prevent\n\tvariable aliasing of format","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Rename the scoped usage of the variable format while iterating the formats\nas it aliases the outer scoped format which is used for specific testing.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/v4l2_videodevice/formats.cpp | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)","diff":"diff --git a/test/v4l2_videodevice/formats.cpp b/test/v4l2_videodevice/formats.cpp\nindex 043732dcaba1..e3283cf92bff 100644\n--- a/test/v4l2_videodevice/formats.cpp\n+++ b/test/v4l2_videodevice/formats.cpp\n@@ -55,10 +55,10 @@ protected:\n \t\t\t{ V4L2_PIX_FMT_Y16_BE, \"Y16 -BE\" }\n \t\t};\n \n-\t\tfor (const auto &format : formats) {\n-\t\t\tif (V4L2PixelFormat(format.first).toString() != format.second) {\n+\t\tfor (const auto &fmt : formats) {\n+\t\t\tif (V4L2PixelFormat(fmt.first).toString() != fmt.second) {\n \t\t\t\tcerr << \"Failed to convert V4L2PixelFormat\"\n-\t\t\t\t     << utils::hex(format.first) << \"to string\"\n+\t\t\t\t     << utils::hex(fmt.first) << \"to string\"\n \t\t\t\t     << endl;\n \t\t\t\treturn TestFail;\n \t\t\t}\n","prefixes":["libcamera-devel","07/10"]}