get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64053,
    "url": "http://patches.dpdk.org/api/patches/64053/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191220044524.32910-8-honnappa.nagarahalli@arm.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": "<20191220044524.32910-8-honnappa.nagarahalli@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191220044524.32910-8-honnappa.nagarahalli@arm.com",
    "date": "2019-12-20T04:45:14",
    "name": "[v7,07/17] test/ring: negative test cases for rte_ring_xxx_elem APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7d6eb76bb1e6e468d9260b30bd3346a77b391cf4",
    "submitter": {
        "id": 1045,
        "url": "http://patches.dpdk.org/api/people/1045/?format=api",
        "name": "Honnappa Nagarahalli",
        "email": "honnappa.nagarahalli@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191220044524.32910-8-honnappa.nagarahalli@arm.com/mbox/",
    "series": [
        {
            "id": 7903,
            "url": "http://patches.dpdk.org/api/series/7903/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7903",
            "date": "2019-12-20T04:45:07",
            "name": "lib/ring: APIs to support custom element size",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/7903/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64053/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/64053/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2CEBAA04F3;\n\tFri, 20 Dec 2019 05:46:46 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id AC3741BF91;\n\tFri, 20 Dec 2019 05:46:11 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id A14561BE8E\n for <dev@dpdk.org>; Fri, 20 Dec 2019 05:45:58 +0100 (CET)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4D5AC12FC;\n Thu, 19 Dec 2019 20:45:57 -0800 (PST)",
            "from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com\n [10.118.14.48])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 37F363F86C;\n Thu, 19 Dec 2019 20:45:57 -0800 (PST)"
        ],
        "From": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>",
        "To": "olivier.matz@6wind.com, sthemmin@microsoft.com, jerinj@marvell.com,\n bruce.richardson@intel.com, david.marchand@redhat.com,\n pbhagavatula@marvell.com, konstantin.ananyev@intel.com,\n honnappa.nagarahalli@arm.com",
        "Cc": "dev@dpdk.org, dharmik.thakkar@arm.com, ruifeng.wang@arm.com,\n gavin.hu@arm.com, nd@arm.com",
        "Date": "Thu, 19 Dec 2019 22:45:14 -0600",
        "Message-Id": "<20191220044524.32910-8-honnappa.nagarahalli@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191220044524.32910-1-honnappa.nagarahalli@arm.com>",
        "References": "<20190906190510.11146-1-honnappa.nagarahalli@arm.com>\n <20191220044524.32910-1-honnappa.nagarahalli@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v7 07/17] test/ring: negative test cases for\n\trte_ring_xxx_elem APIs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "All the negative test cases are consolidated into a single\nfunction. This provides the ability to add test cases for\nrte_ring_xxx_elem APIs easily.\n\nSigned-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nReviewed-by: Gavin Hu <gavin.hu@arm.com>\n---\n app/test/test_ring.c | 176 ++++++++++++++++++++++---------------------\n 1 file changed, 91 insertions(+), 85 deletions(-)",
    "diff": "diff --git a/app/test/test_ring.c b/app/test/test_ring.c\nindex 294e3ee10..552e8b53a 100644\n--- a/app/test/test_ring.c\n+++ b/app/test/test_ring.c\n@@ -113,6 +113,93 @@ test_ring_print_test_string(const char *istr, unsigned int api_type, int esize)\n \t\tprintf(\"burst\\n\");\n }\n \n+/*\n+ * Various negative test cases.\n+ */\n+static int\n+test_ring_negative_tests(void)\n+{\n+\tstruct rte_ring *rp = NULL;\n+\tstruct rte_ring *rt = NULL;\n+\tunsigned int i;\n+\n+\t/* Test with esize not a multiple of 4 */\n+\tTEST_RING_CREATE(\"test_bad_element_size\", 23,\n+\t\t\t\tRING_SIZE + 1, SOCKET_ID_ANY, 0, rp);\n+\tif (rp != NULL) {\n+\t\tprintf(\"Test failed to detect invalid element size\\n\");\n+\t\tgoto test_fail;\n+\t}\n+\n+\n+\tfor (i = 0; i < RTE_DIM(esize); i++) {\n+\t\t/* Test if ring size is not power of 2 */\n+\t\tTEST_RING_CREATE(\"test_bad_ring_size\", esize[i],\n+\t\t\t\t\tRING_SIZE + 1, SOCKET_ID_ANY, 0, rp);\n+\t\tif (rp != NULL) {\n+\t\t\tprintf(\"Test failed to detect odd count\\n\");\n+\t\t\tgoto test_fail;\n+\t\t}\n+\n+\t\t/* Test if ring size is exceeding the limit */\n+\t\tTEST_RING_CREATE(\"test_bad_ring_size\", esize[i],\n+\t\t\t\t\tRTE_RING_SZ_MASK + 1, SOCKET_ID_ANY,\n+\t\t\t\t\t0, rp);\n+\t\tif (rp != NULL) {\n+\t\t\tprintf(\"Test failed to detect limits\\n\");\n+\t\t\tgoto test_fail;\n+\t\t}\n+\n+\t\t/* Tests if lookup returns NULL on non-existing ring */\n+\t\trp = rte_ring_lookup(\"ring_not_found\");\n+\t\tif (rp != NULL && rte_errno != ENOENT) {\n+\t\t\tprintf(\"Test failed to detect NULL ring lookup\\n\");\n+\t\t\tgoto test_fail;\n+\t\t}\n+\n+\t\t/* Test to if a non-power of 2 count causes the create\n+\t\t * function to fail correctly\n+\t\t */\n+\t\tTEST_RING_CREATE(\"test_ring_count\", esize[i], 4097,\n+\t\t\t\t\tSOCKET_ID_ANY, 0, rp);\n+\t\tif (rp != NULL)\n+\t\t\tgoto test_fail;\n+\n+\t\tTEST_RING_CREATE(\"test_ring_negative\", esize[i], RING_SIZE,\n+\t\t\t\t\tSOCKET_ID_ANY,\n+\t\t\t\t\tRING_F_SP_ENQ | RING_F_SC_DEQ, rp);\n+\t\tif (rp == NULL) {\n+\t\t\tprintf(\"test_ring_negative fail to create ring\\n\");\n+\t\t\tgoto test_fail;\n+\t\t}\n+\n+\t\tif (rte_ring_lookup(\"test_ring_negative\") != rp)\n+\t\t\tgoto test_fail;\n+\n+\t\tif (rte_ring_empty(rp) != 1) {\n+\t\t\tprintf(\"test_ring_nagative ring is not empty but it should be\\n\");\n+\t\t\tgoto test_fail;\n+\t\t}\n+\n+\t\t/* Tests if it would always fail to create ring with an used\n+\t\t * ring name.\n+\t\t */\n+\t\tTEST_RING_CREATE(\"test_ring_negative\", esize[i], RING_SIZE,\n+\t\t\t\t\tSOCKET_ID_ANY, 0, rt);\n+\t\tif (rt != NULL)\n+\t\t\tgoto test_fail;\n+\n+\t\trte_ring_free(rp);\n+\t}\n+\n+\treturn 0;\n+\n+test_fail:\n+\n+\trte_ring_free(rp);\n+\treturn -1;\n+}\n+\n static int\n test_ring_basic(struct rte_ring *r)\n {\n@@ -555,70 +642,6 @@ test_ring_burst_bulk_tests(unsigned int api_type)\n \treturn -1;\n }\n \n-/*\n- * it will always fail to create ring with a wrong ring size number in this function\n- */\n-static int\n-test_ring_creation_with_wrong_size(void)\n-{\n-\tstruct rte_ring * rp = NULL;\n-\n-\t/* Test if ring size is not power of 2 */\n-\trp = rte_ring_create(\"test_bad_ring_size\", RING_SIZE + 1, SOCKET_ID_ANY, 0);\n-\tif (NULL != rp) {\n-\t\treturn -1;\n-\t}\n-\n-\t/* Test if ring size is exceeding the limit */\n-\trp = rte_ring_create(\"test_bad_ring_size\", (RTE_RING_SZ_MASK + 1), SOCKET_ID_ANY, 0);\n-\tif (NULL != rp) {\n-\t\treturn -1;\n-\t}\n-\treturn 0;\n-}\n-\n-/*\n- * it tests if it would always fail to create ring with an used ring name\n- */\n-static int\n-test_ring_creation_with_an_used_name(void)\n-{\n-\tstruct rte_ring * rp;\n-\n-\trp = rte_ring_create(\"test\", RING_SIZE, SOCKET_ID_ANY, 0);\n-\tif (NULL != rp)\n-\t\treturn -1;\n-\n-\treturn 0;\n-}\n-\n-/*\n- * Test to if a non-power of 2 count causes the create\n- * function to fail correctly\n- */\n-static int\n-test_create_count_odd(void)\n-{\n-\tstruct rte_ring *r = rte_ring_create(\"test_ring_count\",\n-\t\t\t4097, SOCKET_ID_ANY, 0 );\n-\tif(r != NULL){\n-\t\treturn -1;\n-\t}\n-\treturn 0;\n-}\n-\n-static int\n-test_lookup_null(void)\n-{\n-\tstruct rte_ring *rlp = rte_ring_lookup(\"ring_not_found\");\n-\tif (rlp ==NULL)\n-\tif (rte_errno != ENOENT){\n-\t\tprintf( \"test failed to returnn error on null pointer\\n\");\n-\t\treturn -1;\n-\t}\n-\treturn 0;\n-}\n-\n /*\n  * Test default, single element, bulk and burst APIs\n  */\n@@ -835,6 +858,10 @@ test_ring(void)\n \tunsigned int i, j;\n \tstruct rte_ring *r = NULL;\n \n+\t/* Negative test cases */\n+\tif (test_ring_negative_tests() < 0)\n+\t\tgoto test_fail;\n+\n \t/* some more basic operations */\n \tif (test_ring_basic_ex() < 0)\n \t\tgoto test_fail;\n@@ -861,27 +888,6 @@ test_ring(void)\n \tif (test_ring_basic(r) < 0)\n \t\tgoto test_fail;\n \n-\t/* basic operations */\n-\tif ( test_create_count_odd() < 0){\n-\t\tprintf(\"Test failed to detect odd count\\n\");\n-\t\tgoto test_fail;\n-\t} else\n-\t\tprintf(\"Test detected odd count\\n\");\n-\n-\tif ( test_lookup_null() < 0){\n-\t\tprintf(\"Test failed to detect NULL ring lookup\\n\");\n-\t\tgoto test_fail;\n-\t} else\n-\t\tprintf(\"Test detected NULL ring lookup\\n\");\n-\n-\t/* test of creating ring with wrong size */\n-\tif (test_ring_creation_with_wrong_size() < 0)\n-\t\tgoto test_fail;\n-\n-\t/* test of creation ring with an used name */\n-\tif (test_ring_creation_with_an_used_name() < 0)\n-\t\tgoto test_fail;\n-\n \tif (test_ring_with_exact_size() < 0)\n \t\tgoto test_fail;\n \n",
    "prefixes": [
        "v7",
        "07/17"
    ]
}