BOOST_WARN_LT(left, right); BOOST_CHECK_LT(left, right); BOOST_REQUIRE_LT(left, right);
这些工具执行的检查与
执行的检查相同。 区别在于参数值也会被报告。BOOST_<level>
( left < right )
代码 |
---|
#define BOOST_TEST_MODULE example #include <boost/test/included/unit_test.hpp> BOOST_AUTO_TEST_CASE( test ) { int i = 7; int j = 7; BOOST_CHECK_LT( i, j ); } |
输出 |
---|
>example Running 1 test case... test.cpp(10): error in "test": check i < j failed [7 >= 7] *** 1 failures is detected in test suite "example" |
参见