These tools are used to validate the predicate value. The only parameter for these tools is a boolean predicate value that gets validated. It could be any expression that could be evaluated and converted to boolean value. The expression gets evaluated only once, so it's safe to pass complex expression for validation.
int test_main( int, char* [] ) { int i=2; BOOST_WARN( sizeof(int) == sizeof(short) ); BOOST_CHECK( i == 1 ); BOOST_REQUIRE( i > 5 ); BOOST_CHECK( i == 6 ); // will never reach this check return 0; }
test.cpp(3) : warning in test_main: condition sizeof(int)
== sizeof(short) is not satisfied
test.cpp(4) : error in test_main: test i==1 failed
test.cpp(5) : fatal error
in test_main: test i>5 failed