[Dune] [Dune-Commit] dune-grid r8200 - trunk/dune/grid/test

Martin Nolte nolte at mathematik.uni-freiburg.de
Thu May 31 19:53:23 CEST 2012


Hi Jö, hi Christian,

in my opinion, it should be possible to run the tests with -DNDEBUG. Some code 
fragments change their behavior on this flag and I would really like to check 
them with our test, too.

Just a stupid mistake you could make when implementing an intersection:

bool unitNormalComputed () const
{
   if( !unitNormalComputed_ )
     unitNormal_ = computeUnitNormal();
   return true;
}

FieldVector< ctype, dimworld > centerUnitOuterNormal () const
{
   assert( unitNormalComputed() );
   return unitNormal_;
}

If you never use -DNDEBUG, you will not find the bug. Of course, this one is 
easy to trigger in actual user code.

In my opionion, there are parts in the grid interface that are not used on a 
regular basis by all grid implementors. For example, I rarely use level 
intersections. I would really like to be able to test such features (using our 
test suite) instead of waiting for someone to report a bug.

Best,

Martin


On 05/31/2012 07:10 PM, Jö Fahlke wrote:
> Am Thu, 31. May 2012, 19:01:46 +0200 schrieb Christian Engwer:
>> Either way, I don't think it is useful to change all assertions to
>> some _always on_ checks and I don't think it is useful to run tests
>> without these checks.
>
> I think I get it now.  This isn't just about fixing the misuse of assertions
> in the test anymore, but about enabling all the assertions in production
> headers as well.  That makes sense, and I withdraw my objection against
> fiddling with NDEBUG, as long as the fiddling happens in an obvious way.
>
> Regards,
> Jö.
>
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list