[Dune] [Dune-Commit] dune-grid r8200 - trunk/dune/grid/test
jorrit at jorrit.de
Fri Jun 1 11:49:16 CEST 2012
Am Thu, 31. May 2012, 19:53:23 +0200 schrieb Martin Nolte:
> 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.
Good point. That means we want to run many of the tests once with -DNDEBUG
and once with -UNDEBUG. In both cases we want to always enable those misused
asserts in the testing code. We could do that in the following way:
- introduce a macro unittest_assert() which is always enabled and use that in
the relevant testing code. Or use "if(!...) abort();" or similar.
- when compiling with -DENABLE_DEBUG forcibly undefine NDEBUG in the test
- when compiling with -DDISABLE_DEBUG forcibly define NDEBUG in the test
- otherwise, leave NDEBUG untouched.
We can put that stuff in a header. But we should use seperate headers for
unittest_assert() and the NDEBUG-fiddling, since the latter needs a very
specific position in the list of includes.
Are all corner-cases covered by this scheme?
Jorrit (Jö) Fahlke, Interdisciplinary Center for Scientific Computing,
Heidelberg University, Im Neuenheimer Feld 368, D-69120 Heidelberg
Tel: +49 6221 54 8890 Fax: +49 6221 54 8884
Software is like sex; it's better when it's free.
-- Linus Torvalds
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 828 bytes
Desc: Digital signature
More information about the Dune