Patch Detail
Show a patch.
GET /api/1.1/patches/13474/?format=api
{ "id": 13474, "url": "https://patchwork.libcamera.org/api/1.1/patches/13474/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13474/", "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": "<20210824195636.1110845-15-nfraprado@collabora.com>", "date": "2021-08-24T19:56:33", "name": "[libcamera-devel,v8,14/17] lc-compliance: Move role to string conversion to its own function", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "48d75ddf78f5b96529d1ce1b6944d9cec66bd7db", "submitter": { "id": 84, "url": "https://patchwork.libcamera.org/api/1.1/people/84/?format=api", "name": "Nícolas F. R. A. Prado", "email": "nfraprado@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/13474/mbox/", "series": [ { "id": 2389, "url": "https://patchwork.libcamera.org/api/1.1/series/2389/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2389", "date": "2021-08-24T19:56:19", "name": "lc-compliance: Add test to queue more requests than hardware depth", "version": 8, "mbox": "https://patchwork.libcamera.org/series/2389/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13474/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13474/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 7D4A6C324D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Aug 2021 19:58:15 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BB491688C4;\n\tTue, 24 Aug 2021 21:57:45 +0200 (CEST)", "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 167D068895\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Aug 2021 21:57:43 +0200 (CEST)", "from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: nfraprado) with ESMTPSA id B04EE1F43379" ], "From": "=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 24 Aug 2021 16:56:33 -0300", "Message-Id": "<20210824195636.1110845-15-nfraprado@collabora.com>", "X-Mailer": "git-send-email 2.33.0", "In-Reply-To": "<20210824195636.1110845-1-nfraprado@collabora.com>", "References": "<20210824195636.1110845-1-nfraprado@collabora.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v8 14/17] lc-compliance: Move role to\n\tstring conversion to its own function", "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>", "Cc": "kernel@collabora.com, =?utf-8?q?Andr=C3=A9_Almeida?=\n\t<andrealmeid@collabora.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The functions that generate the test name based on the parameters need\nto convert a StreamRole to a string. Move this to a separate function to\navoid redundancy.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\n\nChanges in v8:\n- Made roleToString()'s map const and changed usage from [] operator to at()\n\nChanges in v5:\n- New\n\n src/lc-compliance/capture_test.cpp | 23 ++++++++++++++---------\n 1 file changed, 14 insertions(+), 9 deletions(-)", "diff": "diff --git a/src/lc-compliance/capture_test.cpp b/src/lc-compliance/capture_test.cpp\nindex 49012048729e..40242fbbc0ba 100644\n--- a/src/lc-compliance/capture_test.cpp\n+++ b/src/lc-compliance/capture_test.cpp\n@@ -18,6 +18,18 @@ using namespace libcamera;\n const std::vector<int> NUMREQUESTS = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };\n const std::vector<StreamRole> ROLES = { Raw, StillCapture, VideoRecording, Viewfinder };\n \n+static const std::string &roleToString(const StreamRole &role)\n+{\n+\tstatic const std::map<StreamRole, std::string> rolesMap = {\n+\t\t{ Raw, \"Raw\" },\n+\t\t{ StillCapture, \"StillCapture\" },\n+\t\t{ VideoRecording, \"VideoRecording\" },\n+\t\t{ Viewfinder, \"Viewfinder\" }\n+\t};\n+\n+\treturn rolesMap.at(role);\n+}\n+\n class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>, public CameraHolder\n {\n public:\n@@ -44,15 +56,8 @@ void SingleStream::TearDown()\n \n std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info)\n {\n-\tstd::map<StreamRole, std::string> rolesMap = { { Raw, \"Raw\" },\n-\t\t\t\t\t\t { StillCapture, \"StillCapture\" },\n-\t\t\t\t\t\t { VideoRecording, \"VideoRecording\" },\n-\t\t\t\t\t\t { Viewfinder, \"Viewfinder\" } };\n-\n-\tstd::string roleName = rolesMap[std::get<0>(info.param)];\n-\tstd::string numRequestsName = std::to_string(std::get<1>(info.param));\n-\n-\treturn roleName + \"_\" + numRequestsName;\n+\treturn roleToString(std::get<0>(info.param)) + \"_\" +\n+\t std::to_string(std::get<1>(info.param));\n }\n \n /*\n", "prefixes": [ "libcamera-devel", "v8", "14/17" ] }