Fix smart_ptr tests to not require RTTI.

[SVN r58123]
This commit is contained in:
Peter Dimov
2009-12-03 18:10:37 +00:00
parent 3824a6b156
commit e78efdbb96
4 changed files with 32 additions and 0 deletions

View File

@@ -2462,6 +2462,8 @@ void test()
} // namespace n_const_cast
#if !defined( BOOST_NO_RTTI )
namespace n_dynamic_cast
{
@@ -2527,6 +2529,8 @@ void test()
} // namespace n_dynamic_cast
#endif
namespace n_map
{
@@ -3200,10 +3204,12 @@ void test()
BOOST_TEST(px.get() != 0);
BOOST_TEST(py.use_count() == 2);
#if !defined( BOOST_NO_RTTI )
boost::shared_ptr<Y> py2 = boost::dynamic_pointer_cast<Y>(px);
BOOST_TEST(py.get() == py2.get());
BOOST_TEST(!(py < py2 || py2 < py));
BOOST_TEST(py.use_count() == 3);
#endif
}
} // namespace n_spt_shared_from_this
@@ -3229,7 +3235,9 @@ int main()
n_comparison::test();
n_static_cast::test();
n_const_cast::test();
#if !defined( BOOST_NO_RTTI )
n_dynamic_cast::test();
#endif
n_map::test();