get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50466,
    "url": "http://patches.dpdk.org/api/patches/50466/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.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": "<def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.com",
    "date": "2019-02-22T16:14:01",
    "name": "[1/3] fbarray: add API to find biggest used or free chunks",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6e6b8eef853f404570b6f7d1768edc11dde4031c",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.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/def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 3521,
            "url": "http://patches.dpdk.org/api/series/3521/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3521",
            "date": "2019-02-22T16:14:01",
            "name": "[1/3] fbarray: add API to find biggest used or free chunks",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3521/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50466/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/50466/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id F32452C2B;\n\tFri, 22 Feb 2019 17:14:07 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id F21932BE5\n\tfor <dev@dpdk.org>; Fri, 22 Feb 2019 17:14:05 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Feb 2019 08:14:05 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 22 Feb 2019 08:14:04 -0800",
            "from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com\n\t[10.243.17.64])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tx1MGE3MM000665; Fri, 22 Feb 2019 16:14:03 GMT",
            "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id x1MGE3io010503;\n\tFri, 22 Feb 2019 16:14:03 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id x1MGE3WB010307;\n\tFri, 22 Feb 2019 16:14:03 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,400,1544515200\"; d=\"scan'208\";a=\"128564739\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.leroy@6wind.com",
        "Date": "Fri, 22 Feb 2019 16:14:01 +0000",
        "Message-Id": "<def930b90366501f8e301a693b08d27967479633.1550851998.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH 1/3] fbarray: add API to find biggest used or\n\tfree chunks",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Currently, while there is a way to find total amount of used/free\nspace in an fbarray, there is no way to find biggest contiguous\nchunk. Add such API, as well as unit tests to test this API.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_fbarray.c  | 109 ++++++++++++++\n lib/librte_eal/common/include/rte_fbarray.h |  70 +++++++++\n lib/librte_eal/rte_eal_version.map          |   4 +\n test/test/test_fbarray.c                    | 159 ++++++++++++++++++++\n 4 files changed, 342 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c\nindex ea0735cb8..5665282cd 100644\n--- a/lib/librte_eal/common/eal_common_fbarray.c\n+++ b/lib/librte_eal/common/eal_common_fbarray.c\n@@ -1162,6 +1162,115 @@ fbarray_find_contig(struct rte_fbarray *arr, unsigned int start, bool next,\n \treturn ret;\n }\n \n+static int\n+fbarray_find_biggest(struct rte_fbarray *arr, unsigned int start, bool used,\n+\t\tbool rev)\n+{\n+\tint cur_idx, next_idx, cur_len, biggest_idx, biggest_len;\n+\t/* don't stack if conditions, use function pointers instead */\n+\tint (*find_func)(struct rte_fbarray *, unsigned int);\n+\tint (*find_contig_func)(struct rte_fbarray *, unsigned int);\n+\n+\tif (arr == NULL || start >= arr->len) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\t/* the other API calls already do their fair share of cheap checks, so\n+\t * no need to do them here.\n+\t */\n+\n+\t/* the API's called are thread-safe, but something may still happen\n+\t * inbetween the API calls, so lock the fbarray. all other API's are\n+\t * read-locking the fbarray, so read lock here is OK.\n+\t */\n+\trte_rwlock_read_lock(&arr->rwlock);\n+\n+\t/* pick out appropriate functions */\n+\tif (used) {\n+\t\tif (rev) {\n+\t\t\tfind_func = rte_fbarray_find_prev_used;\n+\t\t\tfind_contig_func = rte_fbarray_find_rev_contig_used;\n+\t\t} else {\n+\t\t\tfind_func = rte_fbarray_find_next_used;\n+\t\t\tfind_contig_func = rte_fbarray_find_contig_used;\n+\t\t}\n+\t} else {\n+\t\tif (rev) {\n+\t\t\tfind_func = rte_fbarray_find_prev_free;\n+\t\t\tfind_contig_func = rte_fbarray_find_rev_contig_free;\n+\t\t} else {\n+\t\t\tfind_func = rte_fbarray_find_next_free;\n+\t\t\tfind_contig_func = rte_fbarray_find_contig_free;\n+\t\t}\n+\t}\n+\n+\tcur_idx = start;\n+\tbiggest_idx = -1; /* default is error */\n+\tbiggest_len = 0;\n+\tfor (;;) {\n+\t\tcur_idx = find_func(arr, cur_idx);\n+\n+\t\t/* block found, check its length */\n+\t\tif (cur_idx >= 0) {\n+\t\t\tcur_len = find_contig_func(arr, cur_idx);\n+\t\t\t/* decide where we go next */\n+\t\t\tnext_idx = rev ? cur_idx - cur_len : cur_idx + cur_len;\n+\t\t\t/* move current index to start of chunk */\n+\t\t\tcur_idx = rev ? next_idx + 1 : cur_idx;\n+\n+\t\t\tif (cur_len > biggest_len) {\n+\t\t\t\tbiggest_idx = cur_idx;\n+\t\t\t\tbiggest_len = cur_len;\n+\t\t\t}\n+\t\t\tcur_idx = next_idx;\n+\t\t\t/* in reverse mode, next_idx may be -1 if chunk started\n+\t\t\t * at array beginning. this means there's no more work\n+\t\t\t * to do.\n+\t\t\t */\n+\t\t\tif (cur_idx < 0)\n+\t\t\t\tbreak;\n+\t\t} else {\n+\t\t\t/* nothing more to find, stop. however, a failed API\n+\t\t\t * call has set rte_errno, which we want to ignore, as\n+\t\t\t * reaching the end of fbarray is not an error.\n+\t\t\t */\n+\t\t\trte_errno = 0;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\t/* if we didn't find anything at all, set rte_errno */\n+\tif (biggest_idx < 0)\n+\t\trte_errno = used ? ENOENT : ENOSPC;\n+\n+\trte_rwlock_read_unlock(&arr->rwlock);\n+\treturn biggest_idx;\n+}\n+\n+int __rte_experimental\n+rte_fbarray_find_biggest_free(struct rte_fbarray *arr, unsigned int start)\n+{\n+\treturn fbarray_find_biggest(arr, start, false, false);\n+}\n+\n+int __rte_experimental\n+rte_fbarray_find_biggest_used(struct rte_fbarray *arr, unsigned int start)\n+{\n+\treturn fbarray_find_biggest(arr, start, true, false);\n+}\n+\n+int __rte_experimental\n+rte_fbarray_find_rev_biggest_free(struct rte_fbarray *arr, unsigned int start)\n+{\n+\treturn fbarray_find_biggest(arr, start, false, true);\n+}\n+\n+int __rte_experimental\n+rte_fbarray_find_rev_biggest_used(struct rte_fbarray *arr, unsigned int start)\n+{\n+\treturn fbarray_find_biggest(arr, start, true, true);\n+}\n+\n+\n int __rte_experimental\n rte_fbarray_find_contig_free(struct rte_fbarray *arr, unsigned int start)\n {\ndiff --git a/lib/librte_eal/common/include/rte_fbarray.h b/lib/librte_eal/common/include/rte_fbarray.h\nindex 5d8805515..33841ca9a 100644\n--- a/lib/librte_eal/common/include/rte_fbarray.h\n+++ b/lib/librte_eal/common/include/rte_fbarray.h\n@@ -451,6 +451,76 @@ int __rte_experimental\n rte_fbarray_find_rev_contig_used(struct rte_fbarray *arr, unsigned int start);\n \n \n+/**\n+ * Find index of biggest chunk of free elements, starting at specified index.\n+ *\n+ * @param arr\n+ *   Valid pointer to allocated and correctly set up ``rte_fbarray`` structure.\n+ *\n+ * @param start\n+ *   Element index to start search from.\n+ *\n+ * @return\n+ *  - non-negative integer on success.\n+ *  - -1 on failure, with ``rte_errno`` indicating reason for failure.\n+ */\n+int __rte_experimental\n+rte_fbarray_find_biggest_free(struct rte_fbarray *arr, unsigned int start);\n+\n+\n+/**\n+ * Find index of biggest chunk of used elements, starting at specified index.\n+ *\n+ * @param arr\n+ *   Valid pointer to allocated and correctly set up ``rte_fbarray`` structure.\n+ *\n+ * @param start\n+ *   Element index to start search from.\n+ *\n+ * @return\n+ *  - non-negative integer on success.\n+ *  - -1 on failure, with ``rte_errno`` indicating reason for failure.\n+ */\n+int __rte_experimental\n+rte_fbarray_find_biggest_used(struct rte_fbarray *arr, unsigned int start);\n+\n+\n+/**\n+ * Find index of biggest chunk of free elements before a specified index (like\n+ * ``rte_fbarray_find_biggest_free``, but going in reverse).\n+ *\n+ * @param arr\n+ *   Valid pointer to allocated and correctly set up ``rte_fbarray`` structure.\n+ *\n+ * @param start\n+ *   Element index to start search from.\n+ *\n+ * @return\n+ *  - non-negative integer on success.\n+ *  - -1 on failure, with ``rte_errno`` indicating reason for failure.\n+ */\n+int __rte_experimental\n+rte_fbarray_find_rev_biggest_free(struct rte_fbarray *arr, unsigned int start);\n+\n+\n+/**\n+ * Find index of biggest chunk of used elements before a specified index (like\n+ * ``rte_fbarray_find_biggest_used``, but going in reverse).\n+ *\n+ * @param arr\n+ *   Valid pointer to allocated and correctly set up ``rte_fbarray`` structure.\n+ *\n+ * @param start\n+ *   Element index to start search from.\n+ *\n+ * @return\n+ *  - non-negative integer on success.\n+ *  - -1 on failure, with ``rte_errno`` indicating reason for failure.\n+ */\n+int __rte_experimental\n+rte_fbarray_find_rev_biggest_used(struct rte_fbarray *arr, unsigned int start);\n+\n+\n /**\n  * Dump ``rte_fbarray`` metadata.\n  *\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex eb5f7b9cb..d78deaa8a 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -305,6 +305,8 @@ EXPERIMENTAL {\n \trte_fbarray_detach;\n \trte_fbarray_dump_metadata;\n \trte_fbarray_find_idx;\n+\trte_fbarray_find_biggest_free;\n+\trte_fbarray_find_biggest_used;\n \trte_fbarray_find_next_free;\n \trte_fbarray_find_next_used;\n \trte_fbarray_find_next_n_free;\n@@ -315,6 +317,8 @@ EXPERIMENTAL {\n \trte_fbarray_find_prev_n_used;\n \trte_fbarray_find_contig_free;\n \trte_fbarray_find_contig_used;\n+\trte_fbarray_find_rev_biggest_free;\n+\trte_fbarray_find_rev_biggest_used;\n \trte_fbarray_find_rev_contig_free;\n \trte_fbarray_find_rev_contig_used;\n \trte_fbarray_get;\ndiff --git a/test/test/test_fbarray.c b/test/test/test_fbarray.c\nindex 8c44e2c7e..d2b041887 100644\n--- a/test/test/test_fbarray.c\n+++ b/test/test/test_fbarray.c\n@@ -97,6 +97,8 @@ static int empty_msk_test_setup(void)\n {\n \t/* do not fill anything in */\n \treset_array();\n+\tparam.start = -1;\n+\tparam.end = -1;\n \treturn 0;\n }\n \n@@ -456,6 +458,157 @@ static int test_basic(void)\n \treturn TEST_SUCCESS;\n }\n \n+static int test_biggest(struct rte_fbarray *arr, int first, int last)\n+{\n+\tint lo_free_space_first, lo_free_space_last, lo_free_space_len;\n+\tint hi_free_space_first, hi_free_space_last, hi_free_space_len;\n+\tint max_free_space_first, max_free_space_last, max_free_space_len;\n+\tint len = last - first + 1;\n+\n+\t/* first and last must either be both -1, or both not -1 */\n+\tTEST_ASSERT((first == -1) == (last == -1),\n+\t\t\t\"Invalid arguments provided\\n\");\n+\n+\t/* figure out what we expect from the low chunk of free space */\n+\tif (first == -1) {\n+\t\t/* special case: if there are no occupied elements at all,\n+\t\t * consider both free spaces to consume the entire array.\n+\t\t */\n+\t\tlo_free_space_first = 0;\n+\t\tlo_free_space_last = arr->len - 1;\n+\t\tlo_free_space_len = arr->len;\n+\t\t/* if there's no used space, length should be invalid */\n+\t\tlen = -1;\n+\t} else if (first == 0) {\n+\t\t/* if occupied items start at 0, there's no free space */\n+\t\tlo_free_space_first = -1;\n+\t\tlo_free_space_last = -1;\n+\t\tlo_free_space_len = 0;\n+\t} else {\n+\t\tlo_free_space_first = 0;\n+\t\tlo_free_space_last = first - 1;\n+\t\tlo_free_space_len = lo_free_space_last -\n+\t\t\t\tlo_free_space_first + 1;\n+\t}\n+\n+\t/* figure out what we expect from the high chunk of free space */\n+\tif (last == -1) {\n+\t\t/* special case: if there are no occupied elements at all,\n+\t\t * consider both free spaces to consume the entire array.\n+\t\t */\n+\t\thi_free_space_first = 0;\n+\t\thi_free_space_last = arr->len - 1;\n+\t\thi_free_space_len = arr->len;\n+\t\t/* if there's no used space, length should be invalid */\n+\t\tlen = -1;\n+\t} else if (last == ((int)arr->len - 1)) {\n+\t\t/* if occupied items end at array len, there's no free space */\n+\t\thi_free_space_first = -1;\n+\t\thi_free_space_last = -1;\n+\t\thi_free_space_len = 0;\n+\t} else {\n+\t\thi_free_space_first = last + 1;\n+\t\thi_free_space_last = arr->len - 1;\n+\t\thi_free_space_len = hi_free_space_last -\n+\t\t\t\thi_free_space_first + 1;\n+\t}\n+\n+\t/* find which one will be biggest */\n+\tif (lo_free_space_len > hi_free_space_len) {\n+\t\tmax_free_space_first = lo_free_space_first;\n+\t\tmax_free_space_last = lo_free_space_last;\n+\t\tmax_free_space_len = lo_free_space_len;\n+\t} else {\n+\t\t/* if they are equal, we'll just use the high chunk */\n+\t\tmax_free_space_first = hi_free_space_first;\n+\t\tmax_free_space_last = hi_free_space_last;\n+\t\tmax_free_space_len = hi_free_space_len;\n+\t}\n+\n+\t/* check used regions - these should produce identical results */\n+\tTEST_ASSERT_EQUAL(rte_fbarray_find_biggest_used(arr, 0), first,\n+\t\t\t\"Used space index is wrong\\n\");\n+\tTEST_ASSERT_EQUAL(rte_fbarray_find_rev_biggest_used(arr, arr->len - 1),\n+\t\t\tfirst,\n+\t\t\t\"Used space index is wrong\\n\");\n+\t/* len may be -1, but function will return error anyway */\n+\tTEST_ASSERT_EQUAL(rte_fbarray_find_contig_used(arr, first), len,\n+\t\t\t\"Used space length is wrong\\n\");\n+\n+\t/* check if biggest free region is the one we expect to find. It can be\n+\t * -1 if there's no free space - we've made sure we use one or the\n+\t * other, even if both are invalid.\n+\t */\n+\tTEST_ASSERT_EQUAL(rte_fbarray_find_biggest_free(arr, 0),\n+\t\t\tmax_free_space_first,\n+\t\t\t\"Biggest free space index is wrong\\n\");\n+\tTEST_ASSERT_EQUAL(rte_fbarray_find_rev_biggest_free(arr, arr->len - 1),\n+\t\t\tmax_free_space_first,\n+\t\t\t\"Biggest free space index is wrong\\n\");\n+\n+\t/* if biggest region exists, check its length */\n+\tif (max_free_space_first != -1) {\n+\t\tTEST_ASSERT_EQUAL(rte_fbarray_find_contig_free(arr,\n+\t\t\t\t\tmax_free_space_first),\n+\t\t\t\tmax_free_space_len,\n+\t\t\t\t\"Biggest free space length is wrong\\n\");\n+\t\tTEST_ASSERT_EQUAL(rte_fbarray_find_rev_contig_free(arr,\n+\t\t\t\t\tmax_free_space_last),\n+\t\t\t\tmax_free_space_len,\n+\t\t\t\t\"Biggest free space length is wrong\\n\");\n+\t}\n+\n+\t/* find if we see what we expect to see in the low region. if there is\n+\t * no free space, the function should still match expected value, as\n+\t * we've set it to -1. we're scanning backwards to avoid accidentally\n+\t * hitting the high free space region. if there is no occupied space,\n+\t * there's nothing to do.\n+\t */\n+\tif (last != -1) {\n+\t\tTEST_ASSERT_EQUAL(rte_fbarray_find_rev_biggest_free(arr, last),\n+\t\t\t\tlo_free_space_first,\n+\t\t\t\t\"Low free space index is wrong\\n\");\n+\t}\n+\n+\tif (lo_free_space_first != -1) {\n+\t\t/* if low free region exists, check its length */\n+\t\tTEST_ASSERT_EQUAL(rte_fbarray_find_contig_free(arr,\n+\t\t\t\t\tlo_free_space_first),\n+\t\t\t\tlo_free_space_len,\n+\t\t\t\t\"Low free space length is wrong\\n\");\n+\t\tTEST_ASSERT_EQUAL(rte_fbarray_find_rev_contig_free(arr,\n+\t\t\t\t\tlo_free_space_last),\n+\t\t\t\tlo_free_space_len,\n+\t\t\t\t\"Low free space length is wrong\\n\");\n+\t}\n+\n+\t/* find if we see what we expect to see in the high region. if there is\n+\t * no free space, the function should still match expected value, as\n+\t * we've set it to -1. we're scanning forwards to avoid accidentally\n+\t * hitting the low free space region. if there is no occupied space,\n+\t * there's nothing to do.\n+\t */\n+\tif (first != -1) {\n+\t\tTEST_ASSERT_EQUAL(rte_fbarray_find_biggest_free(arr, first),\n+\t\t\t\thi_free_space_first,\n+\t\t\t\t\"High free space index is wrong\\n\");\n+\t}\n+\n+\t/* if high free region exists, check its length */\n+\tif (hi_free_space_first != -1) {\n+\t\tTEST_ASSERT_EQUAL(rte_fbarray_find_contig_free(arr,\n+\t\t\t\t\thi_free_space_first),\n+\t\t\t\thi_free_space_len,\n+\t\t\t\t\"High free space length is wrong\\n\");\n+\t\tTEST_ASSERT_EQUAL(rte_fbarray_find_rev_contig_free(arr,\n+\t\t\t\t\thi_free_space_last),\n+\t\t\t\thi_free_space_len,\n+\t\t\t\t\"High free space length is wrong\\n\");\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int ensure_correct(struct rte_fbarray *arr, int first, int last,\n \t\tbool used)\n {\n@@ -537,6 +690,9 @@ static int test_find(void)\n \tif (ensure_correct(&param.arr, param.end + 1, FBARRAY_TEST_LEN - 1,\n \t\t\tfalse))\n \t\treturn TEST_FAILED;\n+\t/* test if find_biggest API's work correctly */\n+\tif (test_biggest(&param.arr, param.start, param.end))\n+\t\treturn TEST_FAILED;\n \treturn TEST_SUCCESS;\n }\n \n@@ -546,6 +702,9 @@ static int test_empty(void)\n \t/* ensure space is free */\n \tif (ensure_correct(&param.arr, 0, FBARRAY_TEST_LEN - 1, false))\n \t\treturn TEST_FAILED;\n+\t/* test if find_biggest API's work correctly */\n+\tif (test_biggest(&param.arr, param.start, param.end))\n+\t\treturn TEST_FAILED;\n \treturn TEST_SUCCESS;\n }\n \n",
    "prefixes": [
        "1/3"
    ]
}