[dpdk-dev] [PATCH v2 01/11] eal: add common test assert macros

Ananyev, Konstantin konstantin.ananyev at intel.com
Fri Dec 15 11:58:10 CET 2017



> -----Original Message-----
> From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula at caviumnetworks.com]
> Sent: Friday, December 15, 2017 9:05 AM
> To: Ananyev, Konstantin <konstantin.ananyev at intel.com>; jerin.jacob at caviumnetworks.com; santosh.shukla at caviumnetworks.com;
> Richardson, Bruce <bruce.richardson at intel.com>; Van Haaren, Harry <harry.van.haaren at intel.com>; Eads, Gage <gage.eads at intel.com>;
> hemant.agrawal at nxp.com; nipun.gupta at nxp.com; Ma, Liang J <liang.j.ma at intel.com>
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 01/11] eal: add common test assert macros
> 
> On Thu, Dec 14, 2017 at 06:43:24PM +0000, Ananyev, Konstantin wrote:
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pavan Nikhilesh
> > > Sent: Thursday, December 14, 2017 3:01 PM
> > > To: jerin.jacob at caviumnetworks.com; santosh.shukla at caviumnetworks.com; Richardson, Bruce <bruce.richardson at intel.com>; Van
> > > Haaren, Harry <harry.van.haaren at intel.com>; Eads, Gage <gage.eads at intel.com>; hemant.agrawal at nxp.com; nipun.gupta at nxp.com;
> > > Ma, Liang J <liang.j.ma at intel.com>
> > > Cc: dev at dpdk.org; Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> > > Subject: [dpdk-dev] [PATCH v2 01/11] eal: add common test assert macros
> > >
> > > Adding common test assertion macros for unit testing.
> >
> > Wonder what's wrong with existing RTE_ASSERT() and RTE_VERIFY()?
> > Konstantin
> 
> The existing RTE_ASSERT/VERIFY use rte_panic().

Yes, and wouldn't you expect that behavior from assert() call?
Seriously where do you plan to use it outside auto test framework?
Konstantin

> 
> Pavan
> >
> > > Taken from test/test.h.
> > >
> > > Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> > > ---
> > >  lib/librte_eal/common/Makefile           |  2 +-
> > >  lib/librte_eal/common/include/rte_test.h | 97 ++++++++++++++++++++++++++++++++
> > >  2 files changed, 98 insertions(+), 1 deletion(-)
> > >  create mode 100644 lib/librte_eal/common/include/rte_test.h
> > >
> > > diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
> > > index 9effd0d45..eba1059f2 100644
> > > --- a/lib/librte_eal/common/Makefile
> > > +++ b/lib/librte_eal/common/Makefile
> > > @@ -43,7 +43,7 @@ INC += rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h
> > >  INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h
> > >  INC += rte_malloc.h rte_keepalive.h rte_time.h
> > >  INC += rte_service.h rte_service_component.h
> > > -INC += rte_bitmap.h rte_vfio.h
> > > +INC += rte_bitmap.h rte_vfio.h rte_test.h
> > >
> > >  GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h
> > >  GENERIC_INC += rte_spinlock.h rte_memcpy.h rte_cpuflags.h rte_rwlock.h
> > > diff --git a/lib/librte_eal/common/include/rte_test.h b/lib/librte_eal/common/include/rte_test.h
> > > new file mode 100644
> > > index 000000000..256117f79
> > > --- /dev/null
> > > +++ b/lib/librte_eal/common/include/rte_test.h
> > > @@ -0,0 +1,97 @@
> [...]


More information about the dev mailing list