Patch Detail
Show a patch.
GET /api/patches/12951/?format=api
{ "id": 12951, "url": "https://patchwork.libcamera.org/api/patches/12951/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12951/", "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": "<20210714183857.2046425-6-nfraprado@collabora.com>", "date": "2021-07-14T18:38:52", "name": "[libcamera-devel,v6,05/10] lc-compliance: Move camera setup to CameraHolder class", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ca45a406c7a6facc6815e2da85e2d4dad65610e0", "submitter": { "id": 84, "url": "https://patchwork.libcamera.org/api/people/84/?format=api", "name": "Nícolas F. R. A. Prado", "email": "nfraprado@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12951/mbox/", "series": [ { "id": 2232, "url": "https://patchwork.libcamera.org/api/series/2232/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2232", "date": "2021-07-14T18:38:47", "name": "lc-compliance: Add test to queue more requests than hardware depth", "version": 6, "mbox": "https://patchwork.libcamera.org/series/2232/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12951/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12951/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 E3E92C3225\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Jul 2021 18:39:20 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A787468528;\n\tWed, 14 Jul 2021 20:39:20 +0200 (CEST)", "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6221168534\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Jul 2021 20:39:19 +0200 (CEST)", "from localhost.localdomain (unknown\n\t[IPv6:2804:14c:1a9:2434:6553:ad0c:9d2a:24db])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nfraprado)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 1C9581F43215;\n\tWed, 14 Jul 2021 19:39:17 +0100 (BST)" ], "From": "=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 14 Jul 2021 15:38:52 -0300", "Message-Id": "<20210714183857.2046425-6-nfraprado@collabora.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<20210714183857.2046425-1-nfraprado@collabora.com>", "References": "<20210714183857.2046425-1-nfraprado@collabora.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v6 05/10] lc-compliance: Move camera setup\n\tto CameraHolder class", "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": "Different base classes can be used for different setups on tests, but\nall of them will need to setup the camera for the test. To reuse that\ncode, move it to a separate CameraHolder class that is inherited by test\nclasses.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n---\n\nNo changes in v6\n\nAdded in v5\n\n src/lc-compliance/capture_test.cpp | 41 +++++++++++++++++++++---------\n 1 file changed, 29 insertions(+), 12 deletions(-)", "diff": "diff --git a/src/lc-compliance/capture_test.cpp b/src/lc-compliance/capture_test.cpp\nindex 6439cbd88f8e..949407d3191e 100644\n--- a/src/lc-compliance/capture_test.cpp\n+++ b/src/lc-compliance/capture_test.cpp\n@@ -18,23 +18,16 @@ 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-class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>\n+class CameraHolder\n {\n-public:\n-\tstatic std::string nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info);\n-\n protected:\n-\tvoid SetUp() override;\n-\tvoid TearDown() override;\n+\tvoid acquireCamera();\n+\tvoid releaseCamera();\n \n \tstd::shared_ptr<Camera> camera_;\n };\n \n-/*\n- * We use gtest's SetUp() and TearDown() instead of constructor and destructor\n- * in order to be able to assert on them.\n- */\n-void SingleStream::SetUp()\n+void CameraHolder::acquireCamera()\n {\n \tEnvironment *env = Environment::get();\n \n@@ -43,7 +36,7 @@ void SingleStream::SetUp()\n \tASSERT_EQ(camera_->acquire(), 0);\n }\n \n-void SingleStream::TearDown()\n+void CameraHolder::releaseCamera()\n {\n \tif (!camera_)\n \t\treturn;\n@@ -52,6 +45,30 @@ void SingleStream::TearDown()\n \tcamera_.reset();\n }\n \n+class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>, public CameraHolder\n+{\n+public:\n+\tstatic std::string nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info);\n+\n+protected:\n+\tvoid SetUp() override;\n+\tvoid TearDown() override;\n+};\n+\n+/*\n+ * We use gtest's SetUp() and TearDown() instead of constructor and destructor\n+ * in order to be able to assert on them.\n+ */\n+void SingleStream::SetUp()\n+{\n+\tacquireCamera();\n+}\n+\n+void SingleStream::TearDown()\n+{\n+\treleaseCamera();\n+}\n+\n std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info)\n {\n \tstd::map<StreamRole, std::string> rolesMap = { { Raw, \"Raw\" },\n", "prefixes": [ "libcamera-devel", "v6", "05/10" ] }