get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133829,
    "url": "http://patches.dpdk.org/api/patches/133829/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231103095325.47843-7-fengchengwen@huawei.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20231103095325.47843-7-fengchengwen@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231103095325.47843-7-fengchengwen@huawei.com",
    "date": "2023-11-03T09:53:24",
    "name": "[6/7] app/test: extract parse empty elements testcase for kvargs",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a38345981cbbb721b2f2c8e94ae834d2216d6c48",
    "submitter": {
        "id": 2146,
        "url": "http://patches.dpdk.org/api/people/2146/?format=api",
        "name": "fengchengwen",
        "email": "fengchengwen@huawei.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20231103095325.47843-7-fengchengwen@huawei.com/mbox/",
    "series": [
        {
            "id": 30133,
            "url": "http://patches.dpdk.org/api/series/30133/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30133",
            "date": "2023-11-03T09:53:18",
            "name": "refactor kvargs test",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/30133/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/133829/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/133829/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 614EC43279;\n\tFri,  3 Nov 2023 10:56:46 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7158D42DC0;\n\tFri,  3 Nov 2023 10:56:15 +0100 (CET)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 69EA44067B\n for <dev@dpdk.org>; Fri,  3 Nov 2023 10:56:09 +0100 (CET)",
            "from dggpeml100024.china.huawei.com (unknown [172.30.72.54])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SMGN33jdlzvQcN;\n Fri,  3 Nov 2023 17:56:03 +0800 (CST)",
            "from localhost.localdomain (10.50.165.33) by\n dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.31; Fri, 3 Nov 2023 17:56:05 +0800"
        ],
        "From": "Chengwen Feng <fengchengwen@huawei.com>",
        "To": "<thomas@monjalon.net>, <ferruh.yigit@amd.com>",
        "CC": "<dev@dpdk.org>",
        "Subject": "[PATCH 6/7] app/test: extract parse empty elements testcase for\n kvargs",
        "Date": "Fri, 3 Nov 2023 09:53:24 +0000",
        "Message-ID": "<20231103095325.47843-7-fengchengwen@huawei.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20231103095325.47843-1-fengchengwen@huawei.com>",
        "References": "<20231103095325.47843-1-fengchengwen@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.50.165.33]",
        "X-ClientProxiedBy": "dggems704-chm.china.huawei.com (10.3.19.181) To\n dggpeml100024.china.huawei.com (7.185.36.115)",
        "X-CFilter-Loop": "Reflected",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Extract parse empty elements test as one stand-alone testcase. And\nalso fix the kvlist was not released when the branch fails.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n app/test/test_kvargs.c | 68 ++++++++++++++++++------------------------\n 1 file changed, 29 insertions(+), 39 deletions(-)",
    "diff": "diff --git a/app/test/test_kvargs.c b/app/test/test_kvargs.c\nindex f4257c176f..8cd84fcec0 100644\n--- a/app/test/test_kvargs.c\n+++ b/app/test/test_kvargs.c\n@@ -36,44 +36,6 @@ static int check_handler(const char *key, const char *value,\n \treturn 0;\n }\n \n-/* test a valid case */\n-static int test_valid_kvargs(void)\n-{\n-\tstruct rte_kvargs *kvlist;\n-\tconst char *args;\n-\tconst char **valid_keys = NULL;\n-\n-\t/* test using empty elements (it is valid) */\n-\targs = \"foo=1,,check=value2,,\";\n-\tkvlist = rte_kvargs_parse(args, NULL);\n-\tif (kvlist == NULL) {\n-\t\tprintf(\"rte_kvargs_parse() error\\n\");\n-\t\tgoto fail;\n-\t}\n-\tif (rte_kvargs_count(kvlist, \"foo\") != 1) {\n-\t\tprintf(\"invalid count value for 'foo'\\n\");\n-\t\tgoto fail;\n-\t}\n-\tif (rte_kvargs_count(kvlist, \"check\") != 1) {\n-\t\tprintf(\"invalid count value for 'check'\\n\");\n-\t\tgoto fail;\n-\t}\n-\trte_kvargs_free(kvlist);\n-\n-\treturn 0;\n-\n- fail:\n-\tprintf(\"while processing <%s>\", args);\n-\tif (valid_keys != NULL && *valid_keys != NULL) {\n-\t\tprintf(\" using valid_keys=<%s\", *valid_keys);\n-\t\twhile (*(++valid_keys) != NULL)\n-\t\t\tprintf(\",%s\", *valid_keys);\n-\t\tprintf(\">\");\n-\t}\n-\tprintf(\"\\n\");\n-\treturn -1;\n-}\n-\n static int\n test_basic_token_count(void)\n {\n@@ -244,6 +206,34 @@ test_parse_list_value(void)\n \treturn 0;\n }\n \n+static int\n+test_parse_empty_elements(void)\n+{\n+\tconst char *args = \"foo=1,,check=value2,,\";\n+\tstruct rte_kvargs *kvlist;\n+\n+\tkvlist = rte_kvargs_parse(args, NULL);\n+\tif (kvlist == NULL) {\n+\t\tprintf(\"rte_kvargs_parse() error\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\tif (rte_kvargs_count(kvlist, \"foo\") != 1) {\n+\t\tprintf(\"invalid count value for 'foo'\\n\");\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn -1;\n+\t}\n+\n+\tif (rte_kvargs_count(kvlist, \"check\") != 1) {\n+\t\tprintf(\"invalid count value for 'check'\\n\");\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn -1;\n+\t}\n+\n+\trte_kvargs_free(kvlist);\n+\treturn 0;\n+}\n+\n /* test several error cases */\n static int test_invalid_kvargs(void)\n {\n@@ -284,11 +274,11 @@ static struct unit_test_suite kvargs_test_suite  = {\n \t.setup = NULL,\n \t.teardown = NULL,\n \t.unit_test_cases = {\n-\t\tTEST_CASE(test_valid_kvargs),\n \t\tTEST_CASE(test_basic_token_count),\n \t\tTEST_CASE(test_parse_without_valid_keys),\n \t\tTEST_CASE(test_parse_with_valid_keys),\n \t\tTEST_CASE(test_parse_list_value),\n+\t\tTEST_CASE(test_parse_empty_elements),\n \t\tTEST_CASE(test_invalid_kvargs),\n \t\tTEST_CASES_END() /**< NULL terminate unit test array */\n \t}\n",
    "prefixes": [
        "6/7"
    ]
}