|
Boost : |
From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-06-24 01:32:57
"Sean Huang" <huangsean_at_[hidden]> wrote in message
news:BAY102-DAV1766E6447086FCFD5171BCA37B0_at_phx.gbl...
>
> ----- Original Message -----
> From: "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]>
> Newsgroups: gmane.comp.lib.boost.devel
> Sent: Thursday, June 22, 2006 5:12 PM
> Subject: Re: [Test] unit test framework - Problemswithstaticobjectcreation
during test case destruction
>
>
>
> > I still do not see Boost.Test references. Could you please give an
example
> > that shows the Boost Test involvement.
> >
>
> class T
> {
> public:
> T()
> {
> std::cout << "In T's constructor" << std::endl;
> }
> ~T()
> {
> std::cout << "In T's destructor" << std::endl;
> }
>
> };
>
> class Test
> {
> public:
> void Func( void )
> {
> static T staticObj;
> }
> void Run( void )
> {
> }
> ~Test()
> {
> Func();
> }
>
> };
>
> boost::unit_test::test_suite* init_unit_test_suite( int argc, char*
argv[] )
> {
>
> test_suite* master = BOOST_TEST_SUITE( "Test" );
> boost::shared_ptr< Test > test( new Test );
>
> test_case * testCase = BOOST_CLASS_TEST_CASE( &Test::Run, test );
> return master;
> }
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).
Gennadiy
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk