Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-06-27 10:37:20


"Sean Huang" <huangsean_at_[hidden]> wrote in message
news:e7jnce$sh7$1_at_sea.gmane.org...
>
> "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> wrote in message
> news:e7iipp$6mu$1_at_sea.gmane.org...
>>
>>
>> I see. I guess I could release test class instance once test case is
>> done.
>> But that would prevent anyone from running several different tests with
>> the
>> same test tree (once I support interactive based testing it will be
>> possible).
>>
> My workaround is to force the deletion and reconstruction of s_frk_impl()
> before main returns. The following is what I added:
>
> s_frk_impl().~framework_impl();
>
> // reconstruct object so it can be deleted
>
> new ( & ( s_frk_impl() ) ) framework_impl();
>
> Do you see any problems with this approach? Ideally, a destructible
> singleton can be used to avoid such hacks.

IMO It's not a framework responsibility. If you need to workaround some
compiler deficiencies use global fixture and do all necessary work in it's
destructor.

Gennadiy


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