8 Aug
2014
8 Aug
'14
3:10 p.m.
I wrote:
I just do the obvious: increment an "assertion_failed_" global variable in the handler, then BOOST_TEST that it has been incremented the correct number of times.
Of course this only works when the code can continue after a failed assertion without crashing. :-) So another option is to throw from the handler. This, in turn, only works if stack unwinding after a failed assertion doesn't crash. But that's pretty rare. And I'm not sure that we can do any better.