4.14.1 EIFFEL_CHECK: enabling and disabling checking.
Assertion checking is controlled by the EIFFEL_CHECK
macro which can take on any of the following values:
CHECK_NO
- Disable all checking.
CHECK_REQUIRE
- Check the preconditions for each method.
CHECK_ENSURE
- And also check the postconditions.
CHECK_INVARIANT
- And also check the class invariant before and after each method is
called. The programmer should provide a class method called
‘invariant’ which returns ‘true’ if the object is consistent,
‘false’ otherwise.
CHECK_LOOP
- And also check the loop invariants.
CHECK_ALL
- And also check any assertions using the ‘CHECK’ instruction.
Note that the default value for EIFFEL_CHECK
is
CHECK_REQUIRE
, i.e. check preconditions only.
A typical compile flag to the compile might be:
% g++ -c -DEIFFEL_CHECK=CHECK_ALL play.cc