Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
unit_test::suite::expect (2 of 4 overloads)

Evaluate a test condition.

Synopsis
template<
    class Condition,
    class String>
bool
expect(
    Condition const& shouldBeTrue,
    String const& reason);
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