Home | Libraries | People | FAQ | More |
BOOST_TEST_DONT_PRINT_LOG_VALUE(
type
)
instructs the test framework to ignore values of type type
when constructing diagnostic messages. It does this by defining an empty
implementation of a print function specialized for type
.
Because the specialization is inside an implementation namespace for Boost.Test,
the macro must be invoked at the global namespace scope. Therefore, it
cannot be used inside a test suite or any other namespace.
struct custom { int value; }; BOOST_TEST_DONT_PRINT_LOG_VALUE(custom); static bool operator==(custom const& expected, custom const& actual) { return expected.value == actual.value; } BOOST_AUTO_TEST_CASE(example_test_dont_print_log_value) { custom const v1 = { 1 }; custom const v2 = { 1 }; BOOST_REQUIRE_EQUAL(v1, v2); }