Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Summary of the API for writing tests

Assertions

Short description

BOOST_TEST, BOOST_TEST_<level>

General purpose assertion macro.

BOOST_<level>

Simple validation of a boolean predicate value.

BOOST_<level>_BITWISE_EQUAL

Bitwise equality test of two elements.

BOOST_<level>_EQUAL

Equality test of two elements.

BOOST_<level>_EQUAL_COLLECTIONS

Element-wise equality test of two collections.

BOOST_<level>_CLOSE

Floating point comparison using a percentage of deviation.

BOOST_<level>_CLOSE_FRACTION

Floating point comparison using the fraction of the compared operands.

BOOST_<level>_EXCEPTION

Exception detection and validation check.

BOOST_<level>_GE

Comparison of two values (with convenient reporting).

BOOST_<level>_GT

Comparison of two values (with convenient reporting).

BOOST_<level>_LE

Comparison of two values (with convenient reporting).

BOOST_<level>_LT

Comparison of two values (with convenient reporting).

BOOST_<level>_MESSAGE

Same as BOOST_<level> with a custom message in case of failure.

BOOST_<level>_NE

Comparison of two values (with convenient reporting).

BOOST_<level>_NO_THROW

Checks an expression does not throw any exception.

BOOST_<level>_PREDICATE

Checks a list of arguments against a predicate functor.

BOOST_<level>_SMALL

Checks a value is small according to a tolerance.

BOOST_<level>_THROW

Checks an expression throws a specific type of expression.

BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES

Indicates the number of expected failures for a test case

BOOST_ERROR

Logs an error message, fails but does not abort the current test.

BOOST_FAIL

Logs an error message, fails and aborts the current test.

BOOST_IS_DEFINED

Checks at runtime whether or not the supplied preprocessor symbol is defined.

Decorators

Short description

expected_failures

Indicates the expected failures of a test unit.

timeout

Sets the maximum amount of time a test unit should take.

tolerance

Sets the floating point comparison tolerance for a test unit.

Control macros

Short description

BOOST_TEST_TOOLS_UNDER_DEBUGGER

When defined, test assertions are compiled in debugger-friendly mode.

BOOST_TEST_TOOLS_DEBUGGABLE

When defined, test assertions are compiled in two modes (debugger-friendly and full-featured), and the version is selected at run-time.


PrevUpHomeNext