
On 24/02/14 15:33, Peter Dimov wrote:
Klaim - Joël Lamotte wrote:
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3877.pdf
Assertion macros taking a level (BOOST_ASSERTL, BOOST_ASSERTL_MSG) controlled by, f.ex. BOOST_ASSERT_LEVEL (0 - opt, 1 - debug, 2 - safe) would be a relatively straightforward addition. The rest is not really in the spirit of the current Boost.Assert. It could be added though.
I'm not entirely sure about the purpose of the test macros.
The main difference with Boost.Assert is that the interface allows to change the handler at runtime. By changing it at runtime, it is possible to temporarily make the handler throw exceptions, which is how the TEST_ macros are implemented. They're useful if you want to write unit tests that checks that your functions do indeed emit an assert in a situation that is invalid.