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 v2 2/2] test/malloc: add bad parameter tests for realloc
Date: Thu,  2 Apr 2020 10:02:15 +0100	[thread overview]
Message-ID: <182dadd4c7c8acd07d186c37fbf0a35a3d5ab6b0.1585818128.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <793d4b3c1828fc5a6f4f0f2bfc5f93b7fd95556f.1585818128.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>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.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 eed0b20d5a..04608a97e5 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:
-- 
2.17.1

      parent reply	other threads:[~2020-04-02  9:07 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 ` [dpdk-dev] [PATCH 2/2] test/malloc: add bad parameter tests for realloc Anatoly Burakov
2020-04-02  2:43   ` 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 ` Anatoly Burakov [this message]

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=182dadd4c7c8acd07d186c37fbf0a35a3d5ab6b0.1585818128.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).