Test make_shared/allocate_shared in dll_test too

This commit is contained in:
Peter Dimov
2018-09-17 22:04:27 +03:00
parent 4e2f236116
commit a9f39d2b94
2 changed files with 52 additions and 5 deletions

View File

@@ -8,13 +8,38 @@
#include <boost/shared_ptr.hpp>
#include <boost/core/lightweight_test.hpp>
boost::shared_ptr<int> dll_test();
boost::shared_ptr<int> dll_test_41();
boost::shared_ptr<int> dll_test_42();
boost::shared_ptr<int> dll_test_43();
boost::shared_ptr<int[]> dll_test_44();
boost::shared_ptr<int[]> dll_test_45();
int main()
{
boost::shared_ptr<int> p1 = dll_test();
{
boost::shared_ptr<int> p = dll_test_41();
BOOST_TEST_EQ( *p, 41 );
}
BOOST_TEST_EQ( *p1, 42 );
{
boost::shared_ptr<int> p = dll_test_42();
BOOST_TEST_EQ( *p, 42 );
}
{
boost::shared_ptr<int> p = dll_test_43();
BOOST_TEST_EQ( *p, 43 );
}
{
boost::shared_ptr<int[]> p = dll_test_44();
BOOST_TEST_EQ( p[0], 44 );
}
{
boost::shared_ptr<int[]> p = dll_test_45();
BOOST_TEST_EQ( p[0], 45 );
}
return boost::report_errors();
}