Differences between revisions 6 and 7
Revision 6 as of 2007-08-21 21:30:41
Size: 528
Editor: gtang
Comment:
Revision 7 as of 2008-11-26 04:42:29
Size: 529
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
If you need kind of assertion behavior in production code. We suggest you consider [:eman2Exception:exception] instead. If you need kind of assertion behavior in production code. We suggest you consider [[eman2Exception|exception]] instead.

How to use assertion in EMAN2?

EMAN2 has wrapped standard assert call as Assert. The header file is "emassert.h" instead of standard <cassert> or <assert.h>. The assert call will only be available when you enable "DEBUG" in the cmake compilation configurations. it will not be compiled into the release mode (default mode). For example:

#include "emassert.h"
...
Assert (x==1)
...

If you need kind of assertion behavior in production code. We suggest you consider exception instead.

eman2Assertion (last edited 2008-11-26 04:42:29 by localhost)