Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/133828/?format=api
http://patchwork.dpdk.org/api/patches/133828/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231103095325.47843-5-fengchengwen@huawei.com/", "project": { "id": 1, "url": "http://patchwork.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-5-fengchengwen@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20231103095325.47843-5-fengchengwen@huawei.com", "date": "2023-11-03T09:53:22", "name": "[4/7] app/test: extract with keys testcase for kvargs", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f0a8b0739aa72231dc2c9539befd15111d6478f0", "submitter": { "id": 2146, "url": "http://patchwork.dpdk.org/api/people/2146/?format=api", "name": "fengchengwen", "email": "fengchengwen@huawei.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20231103095325.47843-5-fengchengwen@huawei.com/mbox/", "series": [ { "id": 30133, "url": "http://patchwork.dpdk.org/api/series/30133/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=30133", "date": "2023-11-03T09:53:18", "name": "refactor kvargs test", "version": 1, "mbox": "http://patchwork.dpdk.org/series/30133/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/133828/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/133828/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 220D143279;\n\tFri, 3 Nov 2023 10:56:40 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 533B842D9F;\n\tFri, 3 Nov 2023 10:56:14 +0100 (CET)", "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 84B1240A73\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 4SMGN32q1jzvQbr;\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 4/7] app/test: extract with keys testcase for kvargs", "Date": "Fri, 3 Nov 2023 09:53:22 +0000", "Message-ID": "<20231103095325.47843-5-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": "The test_valid_kvargs() function is too long to understand, extract\nthe with keys tests as one stand-alone testcase.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n app/test/test_kvargs.c | 59 +++++++++++++++++++++++++-----------------\n 1 file changed, 35 insertions(+), 24 deletions(-)", "diff": "diff --git a/app/test/test_kvargs.c b/app/test/test_kvargs.c\nindex 7ab4becc0b..28b93680f0 100644\n--- a/app/test/test_kvargs.c\n+++ b/app/test/test_kvargs.c\n@@ -44,30 +44,6 @@ static int test_valid_kvargs(void)\n \tconst char *valid_keys_list[] = { \"foo\", \"check\", NULL };\n \tconst char **valid_keys;\n \n-\t/* second test using valid_keys */\n-\targs = \"foo=droids,check=value0,check=value1,check=wrong_value\";\n-\tvalid_keys = valid_keys_list;\n-\tkvlist = rte_kvargs_parse(args, valid_keys);\n-\tif (kvlist == NULL) {\n-\t\tprintf(\"rte_kvargs_parse() error\");\n-\t\tgoto fail;\n-\t}\n-\t/* call check_handler() on all entries with key=\"check\", it\n-\t * should fail as the value is not recognized by the handler */\n-\tif (rte_kvargs_process(kvlist, \"check\", check_handler, NULL) == 0) {\n-\t\tprintf(\"rte_kvargs_process() is success but should not\\n\");\n-\t\trte_kvargs_free(kvlist);\n-\t\tgoto fail;\n-\t}\n-\tcount = rte_kvargs_count(kvlist, \"check\");\n-\tif (count != 3) {\n-\t\tprintf(\"invalid count value %d after rte_kvargs_count(check)\\n\",\n-\t\t\tcount);\n-\t\trte_kvargs_free(kvlist);\n-\t\tgoto fail;\n-\t}\n-\trte_kvargs_free(kvlist);\n-\n \t/* third test using list as value */\n \targs = \"foo=[0,1],check=value2\";\n \tvalid_keys = valid_keys_list;\n@@ -225,6 +201,40 @@ test_parse_without_valid_keys(void)\n \treturn 0;\n }\n \n+static int\n+test_parse_with_valid_keys(void)\n+{\n+\tconst char *args = \"foo=droids,check=value0,check=value1,check=wrong_value\";\n+\tconst char *valid_keys[] = { \"foo\", \"check\", NULL };\n+\tstruct rte_kvargs *kvlist;\n+\n+\tkvlist = rte_kvargs_parse(args, valid_keys);\n+\tif (kvlist == NULL) {\n+\t\tprintf(\"rte_kvargs_parse() error\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\t/* call check_handler() on all entries with key=\"check\", it\n+\t * should fail as the value is not recognized by the handler\n+\t */\n+\tif (rte_kvargs_process(kvlist, \"check\", check_handler, NULL) == 0) {\n+\t\tprintf(\"rte_kvargs_process(check) is success but should not\\n\");\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn -1;\n+\t}\n+\n+\tcount = rte_kvargs_count(kvlist, \"check\");\n+\tif (count != 3) {\n+\t\tprintf(\"invalid count value %u after rte_kvargs_count(check)\\n\",\n+\t\t\tcount);\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@@ -268,6 +278,7 @@ static struct unit_test_suite kvargs_test_suite = {\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_invalid_kvargs),\n \t\tTEST_CASES_END() /**< NULL terminate unit test array */\n \t}\n", "prefixes": [ "4/7" ] }{ "id": 133828, "url": "