#define COR_ASSERT (ASSERT,EXPLANATION) $Id: cor_assert
$Id: cor_assert.h,v 1.8 1997/07/11 08:34:23 mwiedmer Exp $SYNOPSIS
#include <cor_assert.h> COR_ASSERT(expression, explanation);Where
'expression' is of type int (or better still, CorBool)
'explanation' is printed out whenever 'expression' is FALSEDESCRIPTION
A number of specific assertion categories are provided via other macros of form COR_ASSERT_<category>, some of which do not require 'expression' because they assume it is already known to be FALSE. These should be used wherever possible since they provide more information to programmers and testers.The application can request that its own function handle an assertion failure - see cor_assert_handler.h
Compile with option -DDEBUG if assertion checking is required
CAUTIONS
Warning! By default a message is printed to standard error. This is done using 'printf' instead of the 'stream' stuff in case 'main' is not written in C++ (in which case 'cerr' will not be initialized). As a consequence, the IO may not be synchronized with stream IO.EXAMPLES
#include <cor_assert.h> #include <CorBase.h> CorClass MyClass : public CorBase { public: MyClass() : state(0) {} ~MyClass(){} void foo() { COR_ASSERT(state == 0, "Invalid state."); } protected: int state; };SEE ALSO
CorAssertHandler
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de