
"Sean Huang" <huangsean@hotmail.com> wrote in message news:BAY102-DAV1766E6447086FCFD5171BCA37B0@phx.gbl...
----- Original Message ----- From: "Gennadiy Rozental" <gennadiy.rozental@thomson.com> 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