From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 198AE1B22B for ; Wed, 10 Jan 2018 21:20:32 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A87B120A79; Wed, 10 Jan 2018 15:20:32 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 10 Jan 2018 15:20:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=ggZ2s604zd+X/KPRdHNAnVuyCw KIRrcPdWf1Eym9yp0=; b=IyzYFdxuRS7umdv8BPUzgCBryJ6akBP6BxCljFyLIX BOa6ml7lY5dn92h5lVDi7EQjjrL5XCLo6rKv2ytU8LYVkOA5AikkhHxWqb9UkULM zA+ZQQv8fR8KkOTE3SK9WBYNzCOkPCiQrqJ6gRpjGRipnxgHDGPk+EA7Kg9SgxZa k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ggZ2s6 04zd+X/KPRdHNAnVuyCwKIRrcPdWf1Eym9yp0=; b=ACcjAOucOGMnPze2cjnJNx fMFk0I1NAWITR/CDrvgWHCmrvumIc7aeBIx+IF2T+81CxVVFvZsvM4OApYOF/ZQV FeWNFPWB73owD4pJcRqK/mJJRMBJU56bYW2gbTbbStRf0zLainrdum4jaCciDVu3 FbaDR/cFLLUZFyNGuqujy4y5e3LL5N0uHGES2t/lZUtUWV4i4p83gi+ETDNF4SHE tA286WrJzYBfcZq12OJ4K6erU95Lhwfts51VTQ0rEab5IyrPuzmbHHDSapQowLPk em7klAhgrJT9AHE/SW7HxNO7I/UJFkhPVVqrrSmdeUtQ6JfR2s+/ar0xx0PBDUVA == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 55FAD7E12A; Wed, 10 Jan 2018 15:20:32 -0500 (EST) From: Thomas Monjalon To: Pavan Nikhilesh Cc: dev@dpdk.org, jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, gage.eads@intel.com, liang.j.ma@intel.com Date: Wed, 10 Jan 2018 21:20:06 +0100 Message-ID: <2190857.p1lhncMtO2@xps> In-Reply-To: <20180108134742.30857-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20180108134742.30857-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 01/11] eal: add common test assert macros 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: , X-List-Received-Date: Wed, 10 Jan 2018 20:20:33 -0000 08/01/2018 14:47, Pavan Nikhilesh: > Adding common test assertion macros for unit testing. > Taken from test/test.h. > > Signed-off-by: Pavan Nikhilesh > Acked-by: Jerin Jacob > --- > lib/librte_eal/common/Makefile | 2 +- > lib/librte_eal/common/include/rte_test.h | 69 ++++++++++++++++++++++++++++++++ > 2 files changed, 70 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_eal/common/include/rte_test.h Is the original file still needed? Can we always use rte_test.h from EAL? > +#define RTE_TEST_ASSERT(cond, msg, ...) do { \ > + if (!(cond)) { \ > + RTE_LOG(DEBUG, EAL, "Test assert %s line %d failed: " \ > + msg "\n", __func__, __LINE__, ##__VA_ARGS__); \ > + return -1; \ > + } \ > +} while (0) > + > +#define RTE_TEST_ASSERT_EQUAL(a, b, msg, ...) do { \ > + if (!(a == b)) { \ > + RTE_LOG(DEBUG, EAL, "Test assert %s line %d failed: " \ > + msg "\n", __func__, __LINE__, ##__VA_ARGS__); \ > + return -1; \ > + } \ > +} while (0) Why not call RTE_TEST_ASSERT in all derived macros?