Patch Detail
Show a patch.
GET /api/patches/16668/?format=api
{ "id": 16668, "url": "https://patchwork.libcamera.org/api/patches/16668/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16668/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20220718081602.32535-2-naush@raspberrypi.com>", "date": "2022-07-18T08:15:55", "name": "[libcamera-devel,v6,1/8] test: yaml-parser: Test dictionary items ordering", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d89c593b2871d55f929b50b449389f1e48112f49", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/16668/mbox/", "series": [ { "id": 3293, "url": "https://patchwork.libcamera.org/api/series/3293/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3293", "date": "2022-07-18T08:15:54", "name": "Replace boost JSON parser with libyaml in Raspberry Pi IPA", "version": 6, "mbox": "https://patchwork.libcamera.org/series/3293/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16668/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16668/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 DC199BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Jul 2022 08:16:09 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 486BA63314;\n\tMon, 18 Jul 2022 10:16:09 +0200 (CEST)", "from mail-wm1-x336.google.com (mail-wm1-x336.google.com\n\t[IPv6:2a00:1450:4864:20::336])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CDDE56048A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Jul 2022 10:16:06 +0200 (CEST)", "by mail-wm1-x336.google.com with SMTP id\n\tay11-20020a05600c1e0b00b003a3013da120so7292022wmb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Jul 2022 01:16:06 -0700 (PDT)", "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ta15-20020adffb8f000000b0021dbac444a7sm10206795wrr.59.2022.07.18.01.16.05\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 18 Jul 2022 01:16:05 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658132169;\n\tbh=Za0RSyh7GJx6ULQnAyPxXi/CJuO19WzhW3cRUhju2wQ=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Kma5P3pu5OIYsuIaZXy6wF1mwD3Ulg+/dWkj9sH4KPGnn6H+SwMPQkQfwnK9T4ygq\n\t/Ook9Uk3Sb0pNxCsHQ12VhQFJVidQK7ud6HAcNvHYyziE+u2CfoR/PFhWF69+eoBJa\n\tm5rMvLvb5pRs4aFJiTy5LRptTozg0FirrB8AOwCLIrJig+2WvnbVokFSKw2sz1EqRE\n\tGMNTRBa14ptg/TQCL/J0smyP2nyY82Pn431izIF4/q6G1rx9M4fviOe3xHm6rZose0\n\tYYpiO8zuD+zrh5vXYHYwswZdeyEPCkuEJ70qR9mJYtBJqk0ug9OE3p7yyGBUMR/bDO\n\tIYu0Wn6abrtXQ==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=eGWCuZvF3p1ex2VhNai6PufjKuo7/6apKJWnuPxNTQQ=;\n\tb=nSjZbQ4E6W/29SA2JTUCvfzNsYneexE1X3IADFUT88iZDwhUXOlRaJ5m68QbwhSCk0\n\tvL7lW+Hnj1qT/A2uafqbLxfXPCRKPyL1KSMFSZQfx2xTIvEOWqOkbla08Vqhgpbr6/iG\n\tluCFcj8z4ijXUvjhVRiTigQPsIyR3KmdNrX/6pvaN07nI2TOVOlhFnb9oeedLcdVTc9l\n\tXrUcAtrYn6GVYELMfiYT8qnez1YjmX1/hdxqJGNkkeHfWqWH/KrMVodckT97CNOTeS+m\n\tVDgffXmUeifuQFkWsJPb43b6pfmlrbD0PBgz5rqJaO5ngZSo2EoM6Nd13uKKhkGzmYQ4\n\t/5kw==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"nSjZbQ4E\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=eGWCuZvF3p1ex2VhNai6PufjKuo7/6apKJWnuPxNTQQ=;\n\tb=yqtE31SUpkUYJQJuwcRERsTJ+AHjonKhzNO8NyHdusmMwrnqjPdkYmk+JQ23sIFSYX\n\t7vu0X9RubMeRrdCuQzFxzrmekkeQ18HW2eW9ECWnAYmUV+x1UZOhN5M6fuSBdQq3KWRL\n\tyzN8DW12m7o+IkJ+I7oUAGqQwgUZjPVobsfem4PpA8nrBao2qERyMihcsuaNcafliP8S\n\t7F+VnRfie18OUg6pmk/1VvQDYkyr1bMe/vyAzVnz1uG3GnZt4d5mgoBq8cKsdCaY9wbD\n\trp7T0b7PQaibj1zHd8e7ETUsYN4H/2gZyFiF7uvmBBX75lPsJiYFklozVuDbynyZgMIG\n\tJRmQ==", "X-Gm-Message-State": "AJIora955EkcYeKTQB3EBaeLbhW+/JU+08CQgrPPtOxrnqNXrkGeSgmH\n\t5k06vNbgiXgQ6m+hR4VRuaRB/P9n4AbCKA==", "X-Google-Smtp-Source": "AGRyM1uYkpOmLDb+tf2d+QAvcAs3R01zc/WaYAgKSNcowLNMpTC8KJg2gmVT7CnIHS92FWr4Vld3vw==", "X-Received": "by 2002:a7b:c3cc:0:b0:3a3:8ec:d69 with SMTP id\n\tt12-20020a7bc3cc000000b003a308ec0d69mr16208848wmj.78.1658132166277; \n\tMon, 18 Jul 2022 01:16:06 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 18 Jul 2022 09:15:55 +0100", "Message-Id": "<20220718081602.32535-2-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220718081602.32535-1-naush@raspberrypi.com>", "References": "<20220718081602.32535-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v6 1/8] test: yaml-parser: Test dictionary\n\titems ordering", "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": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Naushir Patuck <naush@raspberrypi.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nWhile YAML specifies that mappings are unordered, the Raspberry Pi IPA\nrelies on elements being ordered as in the YAML data. To replace the\ndependency on boost with the YamlParser class, we thus need to guarantee\nthat the order is preserved. Update the corresponding unit test to\nensure this. The test currently fails at the YamlParser doesn't\ncorrectly preserve the order, this will be fixed by the next commit.\n\nThis commit should be reverted when the Raspberry Pi IPA updates to a\nnew tuning data format and drops support for the old format.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\nTested-by: Naushir Patuck <naush@raspberrypi.com>\n---\n test/yaml-parser.cpp | 17 ++++++-----------\n 1 file changed, 6 insertions(+), 11 deletions(-)", "diff": "diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp\nindex 38f848232fa6..157ecea256cd 100644\n--- a/test/yaml-parser.cpp\n+++ b/test/yaml-parser.cpp\n@@ -32,8 +32,8 @@ static const string testYaml =\n \t\" - Mary\\n\"\n \t\"dictionary:\\n\"\n \t\" a: 1\\n\"\n-\t\" b: 2\\n\"\n \t\" c: 3\\n\"\n+\t\" b: 2\\n\"\n \t\"level1:\\n\"\n \t\" level2:\\n\"\n \t\" - [1, 2]\\n\"\n@@ -449,10 +449,10 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tstd::map<std::string, int> dictValues{ {\n+\t\tstatic constexpr std::array<std::pair<const char *, int>, 3> dictValues{ {\n \t\t\t{ \"a\", 1 },\n-\t\t\t{ \"b\", 2 },\n \t\t\t{ \"c\", 3 },\n+\t\t\t{ \"b\", 2 },\n \t\t} };\n \n \t\tsize_t dictSize = dictValues.size();\n@@ -470,8 +470,8 @@ protected:\n \t\t\t\treturn TestFail;\n \t\t\t}\n \n-\t\t\tconst auto item = dictValues.find(key);\n-\t\t\tif (item == dictValues.end()) {\n+\t\t\tconst auto &item = dictValues[i];\n+\t\t\tif (item.first != key) {\n \t\t\t\tstd::cerr << \"Dictionary key \" << i << \" has wrong value\"\n \t\t\t\t\t << std::endl;\n \t\t\t\treturn TestFail;\n@@ -483,17 +483,12 @@ protected:\n \t\t\t\treturn TestFail;\n \t\t\t}\n \n-\t\t\tif (elem.get<int32_t>(0) != item->second) {\n+\t\t\tif (elem.get<int32_t>(0) != item.second) {\n \t\t\t\tstd::cerr << \"Dictionary element \" << i << \" has wrong value\"\n \t\t\t\t\t << std::endl;\n \t\t\t\treturn TestFail;\n \t\t\t}\n \n-\t\t\t/*\n-\t\t\t * Erase the item to make sure that each iteration\n-\t\t\t * produces a different value.\n-\t\t\t */\n-\t\t\tdictValues.erase(item);\n \t\t\ti++;\n \t\t}\n \n", "prefixes": [ "libcamera-devel", "v6", "1/8" ] }