Boost logo

Boost :

From: Sean Huang (huangsean_at_[hidden])
Date: 2006-06-24 00:17:03


----- 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;
}


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