Changed BOOST_TEST(p) to BOOST_TEST(p? true: false) to make sure the right thing is being tested.

[SVN r14834]
This commit is contained in:
Peter Dimov
2002-08-14 11:59:13 +00:00
parent c06b4206f2
commit e650c7ff16

View File

@ -190,7 +190,10 @@ template<class T> void test_is_zero(boost::shared_ptr<T> const & p)
template<class T> void test_is_nonzero(boost::shared_ptr<T> const & p)
{
BOOST_TEST(p);
// p? true: false is used to test p in a boolean context.
// BOOST_TEST(p) is not guaranteed to test the conversion,
// as the macro might test !!p instead.
BOOST_TEST(p? true: false);
BOOST_TEST(p.get() != 0);
}