From e650c7ff1607c033cb38850d9cad350fabc9f90e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 14 Aug 2002 11:59:13 +0000 Subject: [PATCH] Changed BOOST_TEST(p) to BOOST_TEST(p? true: false) to make sure the right thing is being tested. [SVN r14834] --- shared_ptr_test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); }