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

Jö Fahlke jorrit at jorrit.de
Thu May 31 18:55:30 CEST 2012


Am Thu, 31. May 2012, 16:24:07 +0200 schrieb Christian Engwer:
> I disagree. The tests aren't production code and usually not run by
> the users. I think it is reasonable to use assert in different places
> of the code, but the tests should make use of these assertions.
> 
> I'm not sure how easy it is to undefine NDEBUG via the Makefiles.

I'm quiet certain that it isn't possible in any clean way.

>                                                                   The
> solution with #undef NDEBUG in the header is also not really nice,
> although perhaps the better option. In this case I would create an
> other header which does exactly this, or we might even add the
> appropricate code to config.h.

If you really want to undef NDEBUG, it's probably best to do it from the .cc
file of the test itself, because then at least you have a hint in the same
file of what is going on.

But I really don't see the disadvantage of defining a macro unittest_assert()
or similar and using that.  That at least would make it clear there is
something unusual going on for anyone reading the code.

Bye,
Jö.

-- 
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

Spaß mit I18N.  Hier StumpWM/clisp:
WARNUNG: DEFUN/DEFMACRO(GET-WM-CLASS): #<PACKAGE XLIB> ist abgeschlossen.
         Das Schloss umgehen und weitermachen.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20120531/bc1e509b/attachment.sig>


More information about the Dune mailing list