forked from boostorg/smart_ptr
Add more tests
This commit is contained in:
@@ -71,6 +71,12 @@ int main()
|
||||
BOOST_TEST( *pi == 0 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::local_shared_ptr< int > pi = boost::make_local_shared_noinit< int >();
|
||||
|
||||
BOOST_TEST( pi.get() != 0 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::local_shared_ptr< int > pi = boost::make_local_shared< int >( 5 );
|
||||
|
||||
@@ -93,6 +99,19 @@ int main()
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::local_shared_ptr< X > pi = boost::make_local_shared_noinit< X >();
|
||||
boost::weak_ptr<X> wp( pi );
|
||||
|
||||
BOOST_TEST( X::instances == 1 );
|
||||
BOOST_TEST( pi.get() != 0 );
|
||||
BOOST_TEST( pi->v == 0 );
|
||||
|
||||
pi.reset();
|
||||
|
||||
BOOST_TEST( X::instances == 0 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::local_shared_ptr< X > pi = boost::make_local_shared< X >( 1 );
|
||||
boost::weak_ptr<X> wp( pi );
|
||||
|
||||
Reference in New Issue
Block a user