
[Please do not mail me a copy of your followup] boost-users@lists.boost.org spake the secret code <BD63511532FE974CBFF3543FD105DDC4437AAE6CDB@ESESSCMS0353.eemea.ericsson.se> thusly:
Imagine this:
BOOST_CHECK_EQUAL(cont.erase(key),1u);
First, I recommend use of BOOST_REQUIRES_xxx instead of BOOST_CHECK_xxx.
If it fails, it tells me this:
basics.cpp(61): error in "test_case": check cont.erase(key) == 1u failed [0 != 1]
If you use BOOST_CHECK_MESSAGE(predicate, message), you can create a custom failure message that contains additional context: #define BOOST_TEST_MODULE example #include <boost/test/included/unit_test.hpp> #include <cmath> BOOST_AUTO_TEST_CASE( test ) { double res = std::sin( 45. ); BOOST_WARN_MESSAGE( res > 1, "sin(45){" << res << "} is <= 1. Hmm.. Strange. " ); } -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/> Legalize Adulthood! <http://legalizeadulthood.wordpress.com>