Boost logo

Boost :

Subject: Re: [boost] Regression testing unobservable behavior?
From: Beman Dawes (bdawes_at_[hidden])
Date: 2014-08-08 10:39:10


On Fri, Aug 8, 2014 at 9:53 AM, Peter Dimov <lists_at_[hidden]> wrote:

> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk