On Fri, Aug 8, 2014 at 9:53 AM, Peter Dimov
Beman Dawes wrote:
Certain library function errors are difficult to regression test because
it is not obvious how to observe their behavior in a test framework. Examples include:
...
2) Verification that BOOST_ASSERT fires when a precondition is violated.
You can do this by enabling a custom assert handler and then test that it has been invoked.
Yes, but the question in my mind is how to "test that it has been invoked"? That involves some mutually agreed upon way for the handler to inform the test framework that it has been invoked, and possibly the other information available. Is there a packaged way to handle that communication, or at least a pattern for such back channel communication? Or do I have to figure it out from scratch every time the need arises? Even if the other examples have to be treated individually, perhaps we could come up with an optional BOOST_ASSERT handler and package it in boost/assert.hpp so anyone could easily use it. Thanks, --Beman