[{"id":26377,"web_url":"https://patchwork.libcamera.org/comment/26377/","msgid":"<167508661410.1881490.2319076418789866012@Monstersaurus>","date":"2023-01-30T13:50:14","subject":"Re: [libcamera-devel] [PATCH v6 12/15] libcamera: apps: lcc: Make\n\trolesMap global","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck via libcamera-devel (2023-01-27 15:43:19)\n> Move rolesMap out of the nameParameters() function to allow use with\n> other functions in the file. Additionally enclose all global variables\n> in an unnamed namespace.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/apps/lc-compliance/capture_test.cpp | 18 +++++++++++-------\n>  1 file changed, 11 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/apps/lc-compliance/capture_test.cpp b/src/apps/lc-compliance/capture_test.cpp\n> index 1dcfcf92fc8c..37138dfb3d2e 100644\n> --- a/src/apps/lc-compliance/capture_test.cpp\n> +++ b/src/apps/lc-compliance/capture_test.cpp\n> @@ -15,6 +15,15 @@\n>  \n>  using namespace libcamera;\n>  \n> +namespace {\n> +\n> +std::map<StreamRole, std::string> rolesMap = {\n> +       { StreamRole::Raw, \"Raw\" },\n> +       { StreamRole::StillCapture, \"StillCapture\" },\n> +       { StreamRole::VideoRecording, \"VideoRecording\" },\n> +       { StreamRole::Viewfinder, \"Viewfinder\" }\n> +};\n> +\n>  const std::vector<int> NUMREQUESTS = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };\n>  const std::vector<StreamRole> ROLES = {\n>         StreamRole::Raw,\n> @@ -23,6 +32,8 @@ const std::vector<StreamRole> ROLES = {\n>         StreamRole::Viewfinder\n>  };\n>  \n> +} /* namespace */\n> +\n>  class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>\n>  {\n>  public:\n> @@ -59,13 +70,6 @@ void SingleStream::TearDown()\n>  \n>  std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info)\n>  {\n> -       std::map<StreamRole, std::string> rolesMap = {\n> -               { StreamRole::Raw, \"Raw\" },\n> -               { StreamRole::StillCapture, \"StillCapture\" },\n> -               { StreamRole::VideoRecording, \"VideoRecording\" },\n> -               { StreamRole::Viewfinder, \"Viewfinder\" }\n> -       };\n> -\n>         std::string roleName = rolesMap[std::get<0>(info.param)];\n>         std::string numRequestsName = std::to_string(std::get<1>(info.param));\n>  \n> -- \n> 2.25.1\n>","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 F2D2CBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 30 Jan 2023 13:50:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 66DFC625E4;\n\tMon, 30 Jan 2023 14:50:18 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DD8CD60482\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Jan 2023 14:50:16 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 635848B8;\n\tMon, 30 Jan 2023 14:50:16 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1675086618;\n\tbh=bEE/1QZCVDCcja1P1AjNE90Rqlb0JDTEFbsXoUvk3fw=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=3WDXHhXwXqHqInA7WW71+kGj8klPkRqXPXMiePni/OB+fUKG1hBZqjS0ba1lgSM2v\n\tEzzBjkzmMOV08hj5oyQ9ra3XvJrlI5tBRicP0l/uXE3gHs+AuEk8VSTT2iSCgxDEIN\n\toZHblHHKSLv+ufwr80cPfvZBq3kDD8CLo5HjwjLYOqeUvBTI4u0t8duIRbsKsjsFj5\n\tvp6Eaz9hYVnrPoUB9nrfreztXOY6qOC7QlcdEoODNYclq8QlFpP2oiWwbbokvi9uc9\n\tBxtGcB0a/CIx4lNtKtFuo+bbnoRwsVGayPqJOvtHfz8lQ2VrcNwSxBHBIThnsiD92l\n\tYGr3+2uazGnrQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1675086616;\n\tbh=bEE/1QZCVDCcja1P1AjNE90Rqlb0JDTEFbsXoUvk3fw=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=ZD14WL+bC/ReMGY5TJx/dxM0yIdghBo/zhUPlg98W8f8g0tdNKKs0KUsJ6TdRr05t\n\tATocsDjkCxkDFO9hkqyd43vUyZtT+vbxiiud5s67QF4EsH0/L9lOmnbGM+f5mcMzl9\n\tWYtKSTerr3WzEkRXGk5iuXbeliBCscM7AL8zHB2Q="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ZD14WL+b\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230127154322.29019-13-naush@raspberrypi.com>","References":"<20230127154322.29019-1-naush@raspberrypi.com>\n\t<20230127154322.29019-13-naush@raspberrypi.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 30 Jan 2023 13:50:14 +0000","Message-ID":"<167508661410.1881490.2319076418789866012@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v6 12/15] libcamera: apps: lcc: Make\n\trolesMap global","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]