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 a snapshot of the master branch, built from commit d31735c464.
PrevUpHomeNext

BOOST_FAIL

BOOST_FAIL(message);

BOOST_FAIL(message) behave the same way as BOOST_TEST_REQUIRE(false, message). This tool is used for an unconditional error counter increasing, message logging and the current test case aborting.

The tool's only parameter is an error message to log.

Example: BOOST_FAIL usage

Code

#define BOOST_TEST_MODULE example
#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_CASE( test )
{
  BOOST_FAIL( "Test is not ready yet" );
}

Output

> example
Running 1 test case...
test.cpp(8): fatal error in "test": Test is not ready yet

*** 1 failures is detected in test suite "example"

See also:


PrevUpHomeNext