From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D398CA057B; Thu, 2 Apr 2020 11:07:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 75BAE1BEB1; Thu, 2 Apr 2020 11:07:24 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id DA1901BEA8 for ; Thu, 2 Apr 2020 11:07:22 +0200 (CEST) IronPort-SDR: dId6siutaePk8en1GoffhEKrihMSgEusdW0Km0oZkTq5PHNrSFPMA6YD7/ubNcfXtshTxRGp0W mdyvE4wg33zg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 02:07:19 -0700 IronPort-SDR: 76vXt0/aVcSupJcv5HcAXrtjq4aqcOoJWq8R0vd9uyl2eAKQTZJ5TL18bLak/ut8XxJaJnuYN4 uACPv/d7W3Mg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,335,1580803200"; d="scan'208";a="295592500" Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.222.52]) by FMSMGA003.fm.intel.com with ESMTP; 02 Apr 2020 02:07:18 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: drc@linux.vnet.ibm.com Date: Thu, 2 Apr 2020 10:02:15 +0100 Message-Id: <182dadd4c7c8acd07d186c37fbf0a35a3d5ab6b0.1585818128.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <793d4b3c1828fc5a6f4f0f2bfc5f93b7fd95556f.1585818128.git.anatoly.burakov@intel.com> References: <793d4b3c1828fc5a6f4f0f2bfc5f93b7fd95556f.1585818128.git.anatoly.burakov@intel.com> In-Reply-To: <156a0627fb472087aad43d9279ab0f684a2367ce.1585746650.git.anatoly.burakov@intel.com> References: <156a0627fb472087aad43d9279ab0f684a2367ce.1585746650.git.anatoly.burakov@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] test/malloc: add bad parameter tests for realloc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Realloc did not have bad parameter autotest. Add them. Signed-off-by: Anatoly Burakov Reviewed-by: David Christensen --- 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