From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0089.outbound.protection.outlook.com [104.47.38.89]) by dpdk.org (Postfix) with ESMTP id 3AB201B1CE for ; Thu, 11 Jan 2018 08:11:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YEKw8spApRDFiyi0gGqCYqxsBcFIPg+AxI1/M+qh1P4=; b=G67El7+C9vG94ozRbKPm/vPzRuhNYjuaB7yWNbVbcIcPNKlxv/c/kAKNGY07qCRxzdZ2EdGLGqOTneAqJIlL/JEfXHLlHtYJfsd2SJe1a1si07PADZeYgF2co+tuXSQNIo8szHJeS70NnEwzBMsxjIEkSOT/2mtSiSwEvtNnlGQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Thu, 11 Jan 2018 07:11:52 +0000 Date: Thu, 11 Jan 2018 12:41:14 +0530 From: Pavan Nikhilesh To: Thomas Monjalon , jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, gage.eads@intel.com, liang.j.ma@intel.com Cc: dev@dpdk.org Message-ID: <20180111071113.vi6mqdfcgifdd5zm@Pavan-LT> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20180108134742.30857-1-pbhagavatula@caviumnetworks.com> <2190857.p1lhncMtO2@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2190857.p1lhncMtO2@xps> User-Agent: NeoMutt/20170609 (1.8.3) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR1301CA0030.namprd13.prod.outlook.com (10.174.164.171) To DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f9d9fd0-06d3-497e-e98c-08d558c29844 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:2/Fakz/VAnuUOdXvt3wWHsOy8ZiuPqVRKM99b3q8iDeHD6sJIBT64roLi6l4oBoiPaqgpz73BkxTpITuVQgiubODtJTjL40xMTnCIOOoWRYliGbX0XwoVVFfg013A9zBczRd5yCm4vlyuEooqjCNqx7kstx6eRwvlvcS1zzAJaiHPw63+zLe/xXj6RnRgwbseZbkKq0Ry7wQfMzwLCGN6LePHJVtZsik9GH1Nvq5PzZYy+bbGAS/InI8ev+7Yf9m; 25:hMIM3cKETxxRAKcnG394R5Isl/RNglyvuMQ3CHdlLibWFjKvuw7NCJWi5L4zL7A7dkkQ//YSwrcSWuZU1hog7QT3o92Ga2MTAO0Cz02JRxN1Gl3aYi6OdpxtPDBIFRtpxIRoVEkGfhhTnB8iQJzNKEZy96HRw0dTe/xcYPXLchA552ohxk4QQRCbfFqXnEZDQLLmx5H43lLv5J3zJxSju2yn6RGEgaJaH9AMfW9p3dddDlrc3z1QX9OwEXsQaDpt66j7eOyqH5trhGD2jaVnhXoJpoTh3I3svTUKEmPijzsd/ZjBt+l6Z2GIPb3noLFNYAx2PHeLu44qd6ZxqugZEg==; 31:MLoeeSH3rFn1+d5/d5EzXnIJ7XD8xWCdlqs180BRfmTpD2edXx3pdB1p59wb0pjQaJYVdTc83hDU/mzZQk30vePe2YbYpNadRvpY+r936K+mvYYkBrU7KeWWce//J0nDtbpK9SQzlMETFtub/fGkPd3+1yTCmqP0mI7+MCIxDr9/F3Gb7NUoZDjVZT0RWJWz14ZI/7Qhus/YiPGZaFcmWwyMRGaScJ1RN9bb/vGPe2Y= X-MS-TrafficTypeDiagnostic: DM5PR07MB3466: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 20:An4OXc3PD9tVI7Jn3zdPdMct9ERYPth6+QExm5fWMtEgAfFPV6cmeN186V4Tb79BuUYuTM6rmmZRg8rfXluYyIHlaSm1qb8D35zVRilT1+B8zi7xSxP3Ps9ifmwkwddbpFEaKU8LNQgGO3R4+jX7ZoHgrrg3FUAiBc+tZveHpl/18kKhXUm+WuO3kDKlSY3Rga+VxmSNHMNUizzU2DNEzC80+polOVaOOvZ/4yXuTktUIGtvN0AjPVQwMFcI9JCwZiituRWwZrxI9W1jh1CEoMla/n3QH6J0xwattxjQwaAbdofAi5tzA+wmHRCLJYnaM3jQQPlez/VCiWUHJTLTL5WzNlB+0UDq/hmiVVGDNAm6caB0eUvduAJ+lr19GVlEZeTYkH4CPjLTsRcNGV74SSojGvB2Rf7iEAdxhQ271hC1j37D0dDzUpGjHaPV5oT9Cy1xSFdLF5rQLId3cQy0x1vL/vBCFlwjimD2dgaI9rPrFZyZ9ARSzDgL6ygrB+nEmtOWthcgcm07t2oWEqn4CHGNFiz+J6Sfjnp8UYiNSXnpyrimlzwokkAOP20HwtKw5E6fXNxXwxoqAhjioVfoAobdrWCao2GNqK32pGggeIE=; 4:V4IHLC5kfMfmjNawsxeh5O3/WTZeJFZSvh2lqv/mUKGbIRghfWBEjvLRE+T/6dBtsyREzXnm/KTFG+CIUWTzqHNmZznxsriWtEG2sk0hKnNy/rcT1T9zd79ywzoX/QckXj434+bq/vAFH+q+1O/vMC6jSwG28dCVrySyG3kBiLDUwGTlGPkZ5ntr5aPL1NURxs01D0D2Mb4zsQD5X2povhxN72XTX52UtlG/MSagXvlHrVx5qjCCyQ/P584mrLYhn7ktvVJ6wqW+31t5HratVQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(3002001)(10201501046)(3231023)(944501075)(6041268)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3466; X-Forefront-PRVS: 0549E6FD50 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39380400002)(366004)(39860400002)(376002)(24454002)(199004)(189003)(3846002)(33896004)(16586007)(2906002)(72206003)(316002)(7736002)(478600001)(33716001)(229853002)(16526018)(81166006)(23726003)(1076002)(5660300001)(81156014)(97736004)(58126008)(6116002)(83506002)(8936002)(66066001)(106356001)(6496006)(2950100002)(53936002)(105586002)(42882006)(386003)(76176011)(25786009)(4326008)(6666003)(59450400001)(8676002)(68736007)(55016002)(52116002)(50466002)(6246003)(9686003)(5009440100003)(47776003)(305945005)(107986001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; H:Pavan-LT; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3466; 23:EjwsUTNzqHSQmZci/oVsej1hIhRoZtUsZWzj39e2t?= =?us-ascii?Q?h05oWuFJ7Qv5zN3eXodSgAlLIKbkqqUtFzfyUtShB3MhsPNRkRGuBqBDqR92?= =?us-ascii?Q?4KuHUN/k6oanlYATs2+13sMJ5CSNwDNJiQOo2PBMfPNpYMWW211rjswK3QU+?= =?us-ascii?Q?X3OrnkV/c27xCNnOyri4xBOJZU+okYt2h8+qrcinzRA209CANnY+sXcDmoA/?= =?us-ascii?Q?R+++vILIN0jRhsCGoILo/s/QboEykMSak3d29e0lqlhRNpkBVmTzXQwpJ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pkbIF63LfKyU004qgeo+yF/w1xqMEMNRM5+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2018 07:11:52.1533 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f9d9fd0-06d3-497e-e98c-08d558c29844 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 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: Thu, 11 Jan 2018 07:11:56 -0000 On Wed, Jan 10, 2018 at 09:20:06PM +0100, Thomas Monjalon wrote: > 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? The original file still contains macros and structs related to unit test suite, I think everything should be gradually ported to rte_test.h > Can we always use rte_test.h from EAL? I will link the test assert macros rte test assert macros and not remove them for now as it would break other tests. > > > +#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? Agreed, that would reduce code duplication will send a v5 with the changes.