Previous: , Up: Unit testing   [Contents][Index]

6.5 C++ unit testing API

The C++ API is also provided in the dejagnu.h header file. This header provides a self-contained implementation. For convenience, the totals() method outputs summary totals to be used at the end of unit test program. DejaGnu does not depend on this summary and counts the test results independently.

All of the methods that take a msg parameter use a STL string as the message to be displayed. There currently is no support for formatted output in the C++ API; build the desired string before passing it to these functions.

Note that the C API is also available in C++ unit test programs; using both will cause confusion because each TestState object carries its own set of summary counters, while the C API has an independent global set of summary counters.

The TestState class supports the following instance methods:

Previous: C unit testing API, Up: Unit testing   [Contents][Index]