Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32def.h
Link against:

__TEST_INVARIANT

__TEST_INVARIANT __DbgTestInvariant()

Support

Supported from 5.0

Description

Calls the function for testing object invariance.

Classes can define a standard member function __DbgTestInvariant(), which checks that the object is in a valid state, and panics if it is not. In debug builds, this macro simply expands to call that function. For details on how to define __DbgTestInvariant(), and an example of its use, see __DECLARE_TEST.

The macro is typically used at the beginning of all the member functions of the class. For non-const functions (those which can change the object’s state), you can ensure that the object has been left in a stable state by also using the macro at the end of the function.

In release builds, no code is generated for the macro.

See also: