Home | Libraries | People | FAQ | More |
BOOST_
level
_PREDICATE(
predicate
,
args
)
asserts that the supplied
predicate
applied to args
evaluates to true. The supplied predicate
must
have a return type of bool
and argument types that are
compatible with the argument list args
. Because
BOOST_
level
_PREDICATE
is a macro, the args
must be supplied as a sequence
of parenthesized values, with no comma separating the values.
static bool custom_string_compare(char const* const expected, char const* const actual) { return std::strcmp(expected, actual) == 0; } BOOST_AUTO_TEST_CASE(example_predicate) { char const* const s = "scooby"; BOOST_REQUIRE_PREDICATE(custom_string_compare, ("scooby")(s)); }