← Back to team overview

dolfin team mailing list archive

Re: Implementing our own assert

 

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!

Johan

> --
> Anders
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp


Follow ups

References