DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: drc@linux.vnet.ibm.com
Subject: [dpdk-dev] [PATCH 2/2] test/malloc: add bad parameter tests for realloc
Date: Wed,  1 Apr 2020 14:11:01 +0100	[thread overview]
Message-ID: <4e6d9f131c31f1b9d7fcac58c245225350e87a8b.1585746650.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <156a0627fb472087aad43d9279ab0f684a2367ce.1585746650.git.anatoly.burakov@intel.com>
In-Reply-To: <156a0627fb472087aad43d9279ab0f684a2367ce.1585746650.git.anatoly.burakov@intel.com>

Realloc did not have bad parameter autotest. Add them.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 app/test/test_malloc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index 3a45a00406..788595ead7 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -826,6 +826,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;
@@ -834,6 +839,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:
-- 
2.17.1

  reply	other threads:[~2020-04-01 13:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 13:11 [dpdk-dev] [PATCH 1/2] test/malloc: run realloc tests on external heap Anatoly Burakov
2020-04-01 13:11 ` Anatoly Burakov [this message]
2020-04-02  2:43   ` [dpdk-dev] [PATCH 2/2] test/malloc: add bad parameter tests for realloc David Christensen
2020-04-02  2:40 ` [dpdk-dev] [PATCH 1/2] test/malloc: run realloc tests on external heap David Christensen
2020-04-02  9:02 ` [dpdk-dev] [PATCH v2 " Anatoly Burakov
2020-04-02 19:54   ` David Christensen
2020-04-21 16:16     ` David Marchand
2020-04-10 11:19   ` David Marchand
2020-04-17 12:12     ` Burakov, Anatoly
2020-04-02  9:02 ` [dpdk-dev] [PATCH v2 2/2] test/malloc: add bad parameter tests for realloc Anatoly Burakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e6d9f131c31f1b9d7fcac58c245225350e87a8b.1585746650.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).