BOOST_WARN_EQUAL( left, right )
BOOST_CHECK_EQUAL( left, right )
BOOST_REQUIRE_EQUAL( left, right )

Check performed by these tools is the same as the one performed by BOOST_<level>( left == right ). Use these tools if you want to see the mismatched runtime values. Note that it most probably bad idea to use these tools to compare floating point values. Use BOOST_<level>_CLOSE or BOOST_<level>_CLOSE_FRACTION tools instead.

The first parameter is the left compared value. The second parameter is the right compared value. Parameters are not required to be of the same type. But there should exist comparison operator for left and right type (this may involve implicit conversions).

Example: test.cpp

#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE( test ) { int i = 2; int j = 1; BOOST_CHECK_EQUAL( i, j ); }

Output:

Running 1 test case...
test.cpp(8): error in "test": check i == j failed [2 != 1]

*** 1 failure detected in test suite "Master Test Suite"

See Also

BOOST_CHECK, BOOST_CHECK_CLOSE