Add more tests

This commit is contained in:
Peter Dimov
2017-06-20 02:00:19 +03:00
parent 685b40cc1b
commit 1f86907a3d
4 changed files with 532 additions and 0 deletions
+19
View File
@@ -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 );