blytkerchan/cppunit — Issue #1: CPPUNIT_ASSERT_PREDICATE
Author: blytkerchan
Created: 2012-02-09 15:01:02+00:00
State: open

: I’ve added a featurette to our local fork of CPPUnit that allows you to assert on a predicate (CPPUNIT_ASSERT_PREDICATE) and gives the user a useful message if the predicate fails.
This allows you to implement things like this:
typedef std::less< long > Less;
CPPUNIT_ASSERT_PREDICATE("Update should happen within 10 µs", 10, delay, Less());
(the typedef is necessary because templates and macros don’t mix well.)
I’ve followed the existing code as a style guide and included Doxygen comments where appropriate.