Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2007-05-17 15:12:48


"Chad Maron" <cmaron_at_[hidden]> wrote in message
news:82DA1BC8E3377840AAC2B22ACFAB1EE437FD4D1F_at_exchange3.corp.logicworks.net...
>I know the error has nothing to do with BOOST_PARAM_TEST_CASE, just like I
>mentioned in the sentence immediately following the error. I mention
>BOOST_PARAM_TEST_CASE because that is the where I found code to use to
>prevent the parameters from being destroyed until the test case is run. I
>also know the reason for the error, my question is what is the new
>technique for 1.34.
>
> "The user should make sure that parameters list will not be destroyed
> until the test case is run. That's why it not recommended to create a
> parameters list as local variable in init_unit_test_suite. A simple way to
> handle a parameters list lifetime is to place it into a user defined test
> suite class." -
> http://www.boost.org/libs/test/doc/components/utf/components/test_case/param_function_tc.html

I am sorry, but docs are not correct any more. In 1.34.0 it's safe to place
parameters on init function scope. The parameter's copy is stored along with
each separate test case. So you don't need a custom test suite for that
purpose. If you do insist on your own test suite, provide the name in a
parent test_suite constructor.

Gennadiy


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