From: Anatoly Burakov Date: Thu, 2 Apr 2020 09:02:15 +0000 (+0100) Subject: test/malloc: add bad parameter tests for realloc X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4a5a867844af0a73848dc3330ff2982601e37190;p=dpdk.git test/malloc: add bad parameter tests for realloc Realloc did not have bad parameter autotest. Add them. Signed-off-by: Anatoly Burakov Reviewed-by: David Christensen --- diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index d6c4c4facf..40a2f500cd 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -828,6 +828,11 @@ test_malloc_bad_params(void) if (bad_ptr != NULL) goto err_return; + /* rte_realloc expected to return null with inappropriate size */ + bad_ptr = rte_realloc(NULL, size, align); + if (bad_ptr != NULL) + goto err_return; + /* rte_malloc expected to return null with inappropriate alignment */ align = 17; size = 1024; @@ -836,6 +841,11 @@ test_malloc_bad_params(void) if (bad_ptr != NULL) goto err_return; + /* rte_realloc expected to return null with inappropriate alignment */ + bad_ptr = rte_realloc(NULL, size, align); + if (bad_ptr != NULL) + goto err_return; + return 0; err_return: