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 to view this page for the latest version.
PrevUpHomeNext

test::fail_count

A countdown to simulated failure.

Synopsis

Defined in header <boost/beast/experimental/test/fail_count.hpp>

class fail_count
Member Functions

Name

Description

fail

Throw an exception on the Nth failure.

Set an error code on the Nth failure.

fail_count

Construct a counter.

Description

On the Nth operation, the class will fail with the specified error code, or the default error code of test::test_failure.

Instances of this class may be used to build objects which are specifically designed to aid in writing unit tests, for interfaces which can throw exceptions or return error_code values representing failure.


PrevUpHomeNext