diff --git a/shared_ptr_test.cpp b/shared_ptr_test.cpp index 262a9b5..883d870 100644 --- a/shared_ptr_test.cpp +++ b/shared_ptr_test.cpp @@ -190,7 +190,10 @@ template void test_is_zero(boost::shared_ptr const & p) template void test_is_nonzero(boost::shared_ptr 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); }