Show a patch.

GET /api/1.1/patches/22432/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 22432,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/22432/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22432/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20241220150759.709756-7-pobrn@protonmail.com>",
    "date": "2024-12-20T15:08:29",
    "name": "[RFC,v1,06/12] apps: lc-compliance: Use `std::vector` for argument array",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "77a006980e69b56b61d08dfb0ca822805df3c9d7",
    "submitter": {
        "id": 133,
        "url": "https://patchwork.libcamera.org/api/1.1/people/133/?format=api",
        "name": "Pőcze Barnabás",
        "email": "pobrn@protonmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22432/mbox/",
    "series": [
        {
            "id": 4923,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4923/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4923",
            "date": "2024-12-20T15:08:03",
            "name": "apps: lc-compliance: Multi-stream tests",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4923/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22432/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22432/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 33192C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Dec 2024 15:08:37 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C438B684A8;\n\tFri, 20 Dec 2024 16:08:36 +0100 (CET)",
            "from mail-40134.protonmail.ch (mail-40134.protonmail.ch\n\t[185.70.40.134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 82010684AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Dec 2024 16:08:32 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"dr8pYaGV\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1734707312; x=1734966512;\n\tbh=/eFqrououbZfXmJl7a+duwFZTp8wp2GU8TqinR48qD4=;\n\th=Date:To:From:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;\n\tb=dr8pYaGVwGcYQ3y1IvaEM8OCGRg/EoCzJb1EN4ulTnXpZlfceLURZYJRNSb/YJHR1\n\tcwyH02AXH0CJWxKd7xjyGGDmkAt7IoZ8qrFLa2JoF9rCVeiUW3eReBd6intvNVS2Bi\n\t3uv23UTCyjCThZG4sXe103XWIbfMMT50GqnrK6MOawA9LVPN5gQuQDE9wys+fYV+gk\n\tpH1E54GV3HMYw+AIO7cfvg+iDO2PS/Kxf9xsNjlUAHG+qNmNs2ZTIygJrcj2IrUoSi\n\tsqTCkJu7jY/e6NPG4RxTD/7x4VwOC2h48xK/pVElYfSt3c3k4OremM8LCp99vnOWXs\n\tjY4hhEvk1LcLA==",
        "Date": "Fri, 20 Dec 2024 15:08:29 +0000",
        "To": "libcamera-devel@lists.libcamera.org",
        "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>",
        "Subject": "[RFC PATCH v1 06/12] apps: lc-compliance: Use `std::vector` for\n\targument array",
        "Message-ID": "<20241220150759.709756-7-pobrn@protonmail.com>",
        "In-Reply-To": "<20241220150759.709756-1-pobrn@protonmail.com>",
        "References": "<20241220150759.709756-1-pobrn@protonmail.com>",
        "Feedback-ID": "20568564:user:proton",
        "X-Pm-Message-ID": "b386c62b3e6ab82a481382a3987c76ac62242204",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=utf-8",
        "Content-Transfer-Encoding": "quoted-printable",
        "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": "Just use an `std::vector` to store the arguments passed to\n`InitGoogleTest()`. This removes the need for the map and\nthe separate `argc` variable used for size-keeping.\n\nSigned-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n---\n src/apps/lc-compliance/main.cpp | 36 +++++++++------------------------\n 1 file changed, 9 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/src/apps/lc-compliance/main.cpp b/src/apps/lc-compliance/main.cpp\nindex cdd0bd515..3d9c51fc3 100644\n--- a/src/apps/lc-compliance/main.cpp\n+++ b/src/apps/lc-compliance/main.cpp\n@@ -80,45 +80,27 @@ static int initCamera(CameraManager *cm, OptionsParser::Options options)\n \n static int initGtestParameters(char *arg0, OptionsParser::Options options)\n {\n-\tconst std::map<std::string, std::string> gtestFlags = { { \"list\", \"--gtest_list_tests\" },\n-\t\t\t\t\t\t\t\t{ \"filter\", \"--gtest_filter\" } };\n-\n-\tint argc = 0;\n+\tstd::vector<char *> argv;\n \tstd::string filterParam;\n \n-\t/*\n-\t * +2 to have space for both the 0th argument that is needed but not\n-\t * used and the null at the end.\n-\t */\n-\tchar **argv = new char *[(gtestFlags.size() + 2)];\n-\tif (!argv)\n-\t\treturn -ENOMEM;\n-\n-\targv[0] = arg0;\n-\targc++;\n+\targv.push_back(arg0);\n \n-\tif (options.isSet(OptList)) {\n-\t\targv[argc] = const_cast<char *>(gtestFlags.at(\"list\").c_str());\n-\t\targc++;\n-\t}\n+\tif (options.isSet(OptList))\n+\t\targv.push_back(const_cast<char *>(\"--gtest_list_tests\"));\n \n \tif (options.isSet(OptFilter)) {\n \t\t/*\n \t\t * The filter flag needs to be passed as a single parameter, in\n \t\t * the format --gtest_filter=filterStr\n \t\t */\n-\t\tfilterParam = gtestFlags.at(\"filter\") + \"=\" +\n-\t\t\t      static_cast<const std::string &>(options[OptFilter]);\n-\n-\t\targv[argc] = const_cast<char *>(filterParam.c_str());\n-\t\targc++;\n+\t\tfilterParam = \"--gtest_filter=\" + options[OptFilter].toString();\n+\t\targv.push_back(const_cast<char *>(filterParam.c_str()));\n \t}\n \n-\targv[argc] = nullptr;\n-\n-\t::testing::InitGoogleTest(&argc, argv);\n+\targv.push_back(nullptr);\n \n-\tdelete[] argv;\n+\tint argc = argv.size();\n+\t::testing::InitGoogleTest(&argc, argv.data());\n \n \treturn 0;\n }\n",
    "prefixes": [
        "RFC",
        "v1",
        "06/12"
    ]
}