get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 956568,
    "url": "http://patchwork.ozlabs.org/api/patches/956568/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20180811152820.26817-16-xypron.glpk@gmx.de/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20180811152820.26817-16-xypron.glpk@gmx.de>",
    "list_archive_url": null,
    "date": "2018-08-11T15:28:20",
    "name": "[U-Boot,15/15] efi_selftest: EFI_UNICODE_COLLATION_PROTOCOL",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3ac863a880abeacdbc2d77af6930ba1cfea11e14",
    "submitter": {
        "id": 61270,
        "url": "http://patchwork.ozlabs.org/api/people/61270/?format=api",
        "name": "Heinrich Schuchardt",
        "email": "xypron.glpk@gmx.de"
    },
    "delegate": {
        "id": 3400,
        "url": "http://patchwork.ozlabs.org/api/users/3400/?format=api",
        "username": "agraf",
        "first_name": "Alexander",
        "last_name": "Graf",
        "email": "agraf@suse.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20180811152820.26817-16-xypron.glpk@gmx.de/mbox/",
    "series": [
        {
            "id": 60397,
            "url": "http://patchwork.ozlabs.org/api/series/60397/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=60397",
            "date": "2018-08-11T15:28:06",
            "name": "efi_loader: EFI_UNICODE_COLLATION_PROTOCOL",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/60397/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/956568/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/956568/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=gmx.de"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 41nmMr1Qs3z9s89\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 12 Aug 2018 01:37:44 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid D05CFC21DB6; Sat, 11 Aug 2018 15:34:15 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 82179C21E50;\n\tSat, 11 Aug 2018 15:29:06 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 17612C21D56; Sat, 11 Aug 2018 15:28:57 +0000 (UTC)",
            "from mout.gmx.net (mout.gmx.net [212.227.17.22])\n\tby lists.denx.de (Postfix) with ESMTPS id 9BE67C21DFA\n\tfor <u-boot@lists.denx.de>; Sat, 11 Aug 2018 15:28:48 +0000 (UTC)",
            "from LT02.fritz.box ([88.152.14.153]) by mail.gmx.com (mrgmx102\n\t[212.227.17.174]) with ESMTPSA (Nemesis) id 0LsOsW-1fvMPu3xbU-011xQt;\n\tSat, 11 Aug 2018 17:28:47 +0200"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=0.0 required=5.0 tests=FREEMAIL_FROM\n\tautolearn=unavailable autolearn_force=no version=3.4.0",
        "From": "Heinrich Schuchardt <xypron.glpk@gmx.de>",
        "To": "Alexander Graf <agraf@suse.de>",
        "Date": "Sat, 11 Aug 2018 17:28:20 +0200",
        "Message-Id": "<20180811152820.26817-16-xypron.glpk@gmx.de>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<20180811152820.26817-1-xypron.glpk@gmx.de>",
        "References": "<20180811152820.26817-1-xypron.glpk@gmx.de>",
        "X-Provags-ID": "V03:K1:+RxqkErYdXZd9NUhbB0bSpwuN907MyTNika2HtxN7IBpMSBM4Ja\n\tddcnU3xIbthqCDz9WJIcSiuSw1pHRBsQ8H+04YjNxhNj8QYX+RYTvtvcPe2qSrm0RBhZy5E\n\tD+S7IIICeWpf/W21c4KZum9pATnIL2m05YwsXg/G0obA+HavIBqiIxrwd+T5ZR0sXzNVncW\n\tpy1EuiDw9I1jf66OXf8eQ==",
        "X-UI-Out-Filterresults": "notjunk:1; V01:K0:vV9T5PmZniA=:DWFo0Mj/6iahBE3tyFLp/5\n\tltBoMfjqw4/M/oCrCygC66IUeWEv5gyTvs8dYk35pEX/7M0Pj30Oy+buZvuGhr5yr54tTKM6E\n\tCYVc103K7Y5eSw9VlOnL3w6fZ2fUImSE7vZrSZrBGTagsy0OZsp0vsR0xgnV9hjsv5gqG4YmL\n\tIASgH6AYw4F0B8C1RQoIEh1kTm2FQ1G248WJzrxeW0QnC8ej7/SWhtqxN4e0SU1i5qWYKVqKo\n\tQsOuWEmxIf0b667hVj6XHmPd4itYkSsz/hMuEq5dB4oG6sNSy/bHGIeU4r0QU5krMQbwQlJCI\n\tP3ogEgILVj6yJZUtyAjWsmec0ZeQeTAzDSCbqB4HLRiURHu6sqb3ZgEi2CZhnJ8a632fObShs\n\t7kpLkeZW/Jz8XdqZDZhAqYGgelJLBzYckrYCZkzyrKwzOkZu1KcTl6E0AtSDXijD7/8n0F+pC\n\tyaaKKhsA4cmBejHH3TwSwWImkWFsjKdLvoPhDA0SqXxGP6B3UbGYR3qML5SBX1RbXwgY6F112\n\t/D5rFUt6m2RhBXmA+APyfDrQrvwS+60PEG0wD+bLGm++6eyuFliNbBRAkVVHhiPown63KHGxe\n\tFg5J2WaCwhDMDL0uLi1Oyv8rW3sPxAVvv2L9Io0j12xS2w95FpTXSJLoLt8ZVoMnwz5TsrIQr\n\tdxKrevwhod/Y0wkbdFYU1Kd3qk8t81Trti6pBQth76Av9RBijVvXQolDN9DDXhU2RO0nBFCoB\n\tQxztw4jkS8Ac3JWGL5UAN0ccEolw7hULct051jwNKiF5AgkXV/jk5THOgWI=",
        "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>, u-boot@lists.denx.de",
        "Subject": "[U-Boot] [PATCH 15/15] efi_selftest: EFI_UNICODE_COLLATION_PROTOCOL",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "Provide a unit test for the EFI_UNICODE_COLLATION_PROTOCOL.\n\nSigned-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n lib/efi_selftest/Makefile                     |   1 +\n .../efi_selftest_unicode_collation.c          | 257 ++++++++++++++++++\n 2 files changed, 258 insertions(+)\n create mode 100644 lib/efi_selftest/efi_selftest_unicode_collation.c",
    "diff": "diff --git a/lib/efi_selftest/Makefile b/lib/efi_selftest/Makefile\nindex 590f90b16d..7ff879742f 100644\n--- a/lib/efi_selftest/Makefile\n+++ b/lib/efi_selftest/Makefile\n@@ -30,6 +30,7 @@ efi_selftest_snp.o \\\n efi_selftest_textinput.o \\\n efi_selftest_textoutput.o \\\n efi_selftest_tpl.o \\\n+efi_selftest_unicode_collation.o \\\n efi_selftest_util.o \\\n efi_selftest_variables.o \\\n efi_selftest_watchdog.o\ndiff --git a/lib/efi_selftest/efi_selftest_unicode_collation.c b/lib/efi_selftest/efi_selftest_unicode_collation.c\nnew file mode 100644\nindex 0000000000..ed35b76e86\n--- /dev/null\n+++ b/lib/efi_selftest/efi_selftest_unicode_collation.c\n@@ -0,0 +1,257 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * efi_selftest_unicode_collation\n+ *\n+ * Copyright (c) 2018 Heinrich Schuchardt <xypron.glpk@gmx.de>\n+ *\n+ * Test unicode collation protocol.\n+ */\n+\n+#include <efi_selftest.h>\n+\n+static const efi_guid_t unicode_collation_protocol_guid =\n+\tEFI_UNICODE_COLLATION_PROTOCOL2_GUID;\n+\n+static struct efi_boot_services *boottime;\n+\n+static struct efi_unicode_collation_protocol *unicode_collation_protocol;\n+\n+/**\n+ * setup() - setup unit test.\n+ *\n+ * @handle:\thandle of the loaded image\n+ * @systable:\tsystem table\n+ * ReturnValue:\tEFI_ST_SUCCESS for success\n+ */\n+static int setup(const efi_handle_t handle,\n+\t\t const struct efi_system_table *systable)\n+{\n+\tefi_status_t ret;\n+\n+\tboottime = systable->boottime;\n+\n+\tret = boottime->locate_protocol(&unicode_collation_protocol_guid, NULL,\n+\t\t\t\t\t(void **)&unicode_collation_protocol);\n+\tif (ret != EFI_SUCCESS) {\n+\t\tunicode_collation_protocol = NULL;\n+\t\tefi_st_error(\"Unicode collation protocol is not available.\\n\");\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\treturn EFI_ST_SUCCESS;\n+}\n+\n+static int test_stri_coll(void)\n+{\n+\tefi_intn_t ret;\n+\tu16 c1[] = L\"first\";\n+\tu16 c2[] = L\"FIRST\";\n+\tu16 c3[] = L\"second\";\n+\n+\tret = unicode_collation_protocol->stri_coll(unicode_collation_protocol,\n+\t\t\t\t\t\t    c1, c2);\n+\tif (ret) {\n+\t\tefi_st_error(\"stri_coll(\\\"%ps\\\", \\\"%ps\\\") = %zu\\n\", c1, c2, ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->stri_coll(unicode_collation_protocol,\n+\t\t\t\t\t\t    c1, c3);\n+\tif (ret >= 0) {\n+\t\tefi_st_error(\"stri_coll(\\\"%ps\\\", \\\"%ps\\\") = %zu\\n\", c1, c3, ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->stri_coll(unicode_collation_protocol,\n+\t\t\t\t\t\t    c3, c1);\n+\tif (ret <= 0) {\n+\t\tefi_st_error(\"stri_coll(\\\"%ps\\\", \\\"%ps\\\") = %zu\\n\", c3, c1, ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\treturn EFI_ST_SUCCESS;\n+}\n+\n+static int test_metai_match(void)\n+{\n+\tbool ret;\n+\tconst u16 c[] = L\"Das U-Boot\";\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"*\");\n+\tif (!ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"Da[rstu] U-Boot\");\n+\tif (!ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"Da[q-v] U-Boot\");\n+\tif (!ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"Da? U-Boot\");\n+\tif (!ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"D*Bo*t\");\n+\tif (!ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"Da[xyz] U-Boot\");\n+\tif (ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"Da[a-d] U-Boot\");\n+\tif (ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"Da?? U-Boot\");\n+\tif (ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = unicode_collation_protocol->metai_match(\n+\t\tunicode_collation_protocol, c, L\"D*Bo*tt\");\n+\tif (ret) {\n+\t\tefi_st_error(\"metai_match returned %u\\n\", ret);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\treturn EFI_ST_SUCCESS;\n+}\n+\n+static int test_str_lwr(void)\n+{\n+\tu16 c[] = L\"U-Boot\";\n+\n+\tunicode_collation_protocol->str_lwr(unicode_collation_protocol, c);\n+\tif (efi_st_strcmp_16_8(c, \"u-boot\")) {\n+\t\tefi_st_error(\"str_lwr returned \\\"%ps\\\"\\n\", c);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\treturn EFI_ST_SUCCESS;\n+}\n+\n+static int test_str_upr(void)\n+{\n+\tu16 c[] = L\"U-Boot\";\n+\n+\tunicode_collation_protocol->str_upr(unicode_collation_protocol, c);\n+\tif (efi_st_strcmp_16_8(c, \"U-BOOT\")) {\n+\t\tefi_st_error(\"str_lwr returned \\\"%ps\\\"\\n\", c);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\treturn EFI_ST_SUCCESS;\n+}\n+\n+static int test_fat_to_str(void)\n+{\n+\tu16 str[16];\n+\n+\tboottime->set_mem(str, sizeof(str), 0);\n+\tunicode_collation_protocol->fat_to_str(unicode_collation_protocol, 6,\n+\t\t\t\t\t       \"U-BOOT\", str);\n+\tif (efi_st_strcmp_16_8(str, \"U-BOOT\")) {\n+\t\tefi_st_error(\"fat_to_str returned \\\"%ps\\\"\\n\", str);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\treturn EFI_ST_SUCCESS;\n+}\n+\n+static int test_str_to_fat(void)\n+{\n+\tchar fat[16];\n+\tbool ret;\n+\n+\tboottime->set_mem(fat, sizeof(fat), 0);\n+\tret = unicode_collation_protocol->str_to_fat(unicode_collation_protocol,\n+\t\t\t\t\t\t     L\"U -Boo.t\", 6, fat);\n+\tif (ret || efi_st_strcmp_16_8(L\"U-BOOT\", fat)) {\n+\t\tefi_st_error(\"str_to_fat returned %u, \\\"%s\\\"\\n\", ret, fat);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tboottime->set_mem(fat, 16, 0);\n+\tret = unicode_collation_protocol->str_to_fat(unicode_collation_protocol,\n+\t\t\t\t\t\t     L\"U\\\\Boot\", 6, fat);\n+\tif (!ret || efi_st_strcmp_16_8(L\"U_BOOT\", fat)) {\n+\t\tefi_st_error(\"str_to_fat returned %u, \\\"%s\\\"\\n\", ret, fat);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\treturn EFI_ST_SUCCESS;\n+}\n+\n+/**\n+ * execute() - Execute unit test.\n+ *\n+ * ReturnValue:\tEFI_ST_SUCCESS for success\n+ */\n+static int execute(void)\n+{\n+\tint ret;\n+\n+\tif (!unicode_collation_protocol) {\n+\t\tefi_st_printf(\"Unicode collation protocol missing\\n\");\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n+\n+\tret = test_stri_coll();\n+\tif (ret != EFI_ST_SUCCESS)\n+\t\treturn ret;\n+\n+\tret = test_metai_match();\n+\tif (ret != EFI_ST_SUCCESS)\n+\t\treturn ret;\n+\n+\tret = test_str_lwr();\n+\tif (ret != EFI_ST_SUCCESS)\n+\t\treturn ret;\n+\n+\tret = test_str_upr();\n+\tif (ret != EFI_ST_SUCCESS)\n+\t\treturn ret;\n+\n+\tret = test_fat_to_str();\n+\tif (ret != EFI_ST_SUCCESS)\n+\t\treturn ret;\n+\n+\tret = test_str_to_fat();\n+\tif (ret != EFI_ST_SUCCESS)\n+\t\treturn ret;\n+\n+\treturn EFI_ST_SUCCESS;\n+}\n+\n+EFI_UNIT_TEST(unicoll) = {\n+\t.name = \"unicode collation\",\n+\t.phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT,\n+\t.execute = execute,\n+\t.setup = setup,\n+};\n",
    "prefixes": [
        "U-Boot",
        "15/15"
    ]
}