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

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext
unit_test::suite::expect (4 of 4 overloads)

Evaluate a test condition.

Synopsis
template<
    class Condition,
    class String>
bool
expect(
    Condition const& shouldBeTrue,
    String const& reason,
    char const* file,
    int line);
Description

This function provides improved logging by incorporating the file name and line number into the reported output on failure, as well as additional text specified by the caller.

Parameters

Name

Description

shouldBeTrue

The condition to test. The condition is evaluated in a boolean context.

reason

Optional added text to output on a failure.

file

The source code file where the test failed.

line

The source code line number where the test failed.

Return Value

true if the test condition indicates success.


PrevUpHomeNext