← Back to team overview

dolfin team mailing list archive

Re: Implementing our own assert

 

On Thu, Nov 17, 2011 at 11:02:30AM -0800, Johan Hake wrote:
> On Thursday November 17 2011 10:55:34 Anders Logg wrote:
> > Would it be a good idea to implement our own assert (dolfin_assert)
> > which would use an #ifdef to stay out of place when not building with
> > the DEBUG flag enabled.
> >
> > The point would be for it to call dolfin_error instead of just
> > segfaulting. That way it's very easy to see where it comes from since
> > it will generate a trace in Python.
> >
> > I'm debugging some unit tests now which give
> >
> > ......python:
> > /home/logg/scratch/src/dolfin/1.0.x-logg/dolfin/la/EpetraVector.cpp:306:
> > virtual void dolfin::EpetraVector::get_local(dolfin::Array<double>&)
> > const: Assertion `x' failed.
> >
> > and I have no idea from which test this comes from.
> >
> > We had our own assert before bug decided to use the standard C++
> > assert.
> >
> > Any objections to me adding a dolfin_assert and replacing all asserts?
>
> That would be great!

In progress... dolfinreplace works great! :-)

--
Anders


Follow ups

References