Show a patch.

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

{
    "id": 88,
    "url": "https://patchwork.libcamera.org/api/patches/88/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/88/",
    "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": "<20181222230041.29999-13-niklas.soderlund@ragnatech.se>",
    "date": "2018-12-22T23:00:41",
    "name": "[libcamera-devel,12/12] tests: add test to list all cameras in the system",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "6fcd05514fdcc4c8ac8351e60681a12bf041e1b3",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/88/mbox/",
    "series": [
        {
            "id": 38,
            "url": "https://patchwork.libcamera.org/api/series/38/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=38",
            "date": "2018-12-22T23:00:29",
            "name": "Add basic camera enumeration",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/38/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/88/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/88/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F94060B0C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 23 Dec 2018 00:02:39 +0100 (CET)",
            "from wyvern.dyn.berto.se (unknown [217.31.177.236])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 9d335f09-063d-11e9-9adf-005056917a89;\n\tSun, 23 Dec 2018 00:02:12 +0100 (CET)"
        ],
        "X-Halon-ID": "9d335f09-063d-11e9-9adf-005056917a89",
        "Authorized-sender": "niklas@soderlund.pp.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sun, 23 Dec 2018 00:00:41 +0100",
        "Message-Id": "<20181222230041.29999-13-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20181222230041.29999-1-niklas.soderlund@ragnatech.se>",
        "References": "<20181222230041.29999-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 12/12] tests: add test to list all cameras\n\tin the system",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Sat, 22 Dec 2018 23:02:39 -0000"
    },
    "content": "Add simple test which lists all cameras detected in the system. The test\nfails if no camera can be found.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n test/list.cpp    | 54 ++++++++++++++++++++++++++++++++++++++++++++++++\n test/meson.build |  5 +++++\n 2 files changed, 59 insertions(+)\n create mode 100644 test/list.cpp",
    "diff": "diff --git a/test/list.cpp b/test/list.cpp\nnew file mode 100644\nindex 0000000000000000..6483ffb4f13a8cb6\n--- /dev/null\n+++ b/test/list.cpp\n@@ -0,0 +1,54 @@\n+/* SPDX-License-Identifier: GPL-2.0-or-later */\n+/*\n+ * Copyright (C) 2018, Google Inc.\n+ *\n+ * list.cpp - camera list tests\n+ */\n+\n+#include <iostream>\n+\n+#include <libcamera/cameramanager.h>\n+\n+#include \"test.h\"\n+\n+using namespace std;\n+using namespace libcamera;\n+\n+class ListTest : public Test\n+{\n+protected:\n+\tint init()\n+\t{\n+\t\tcm = new CameraManager();\n+\t\tif (!cm)\n+\t\t\treturn -ENOMEM;\n+\n+\t\tcm->start();\n+\n+\t\treturn 0;\n+\t}\n+\n+\tint run()\n+\t{\n+\t\tunsigned int count = 0;\n+\n+\t\tfor (auto name : cm->list()) {\n+\t\t\tcout << \"- \" << name << endl;\n+\t\t\tcount++;\n+\t\t}\n+\n+\t\treturn count ? 0 : -ENODEV;\n+\t}\n+\n+\tvoid cleanup()\n+\t{\n+\t\tcm->stop();\n+\n+\t\tdelete cm;\n+\t}\n+\n+private:\n+\tCameraManager *cm;\n+};\n+\n+TEST_REGISTER(ListTest)\ndiff --git a/test/meson.build b/test/meson.build\nindex da0aea9678d127ce..a74629f89197ecea 100644\n--- a/test/meson.build\n+++ b/test/meson.build\n@@ -8,4 +8,9 @@ test_init = executable('test_init', 'init.cpp',\n                        link_with : libcamera,\n                        include_directories : libcamera_includes)\n \n+list = executable('list', 'list.cpp',\n+                    link_with : [libcamera, libtest],\n+                    include_directories : libcamera_includes)\n+\n test('Initialisation test', test_init)\n+test('List Camera API tests', list)\n",
    "prefixes": [
        "libcamera-devel",
        "12/12"
    ]
}