diff -NBwru boost_1_39_src_orig/boost/test/detail/static_constant.hpp boost_1_39_src/boost/test/detail/static_constant.hpp --- boost_1_39_src_orig/boost/test/detail/static_constant.hpp 1969-12-31 19:00:00.000000000 -0500 +++ boost_1_39_src/boost/test/detail/static_constant.hpp 2009-07-04 21:26:56.000000000 -0400 @@ -0,0 +1,17 @@ +#ifndef BOOST_TEST_STATIC_CONSTANT_HPP +#define BOOST_TEST_STATIC_CONSTANT_HPP + +namespace boost { namespace unit_test { namespace detail { + +// helper templates to prevent ODR violations +template +struct static_constant { + static T value; +}; + +template +T static_constant::value; + +}}} + +#endif /* BOOST_TEST_STATIC_CONSTANT_HPP */ diff -NBwru boost_1_39_src_orig/boost/test/floating_point_comparison.hpp boost_1_39_src/boost/test/floating_point_comparison.hpp --- boost_1_39_src_orig/boost/test/floating_point_comparison.hpp 2009-07-04 21:12:43.000000000 -0400 +++ boost_1_39_src/boost/test/floating_point_comparison.hpp 2009-07-04 21:33:15.000000000 -0400 @@ -17,6 +17,8 @@ #include // for std::numeric_limits +#include + #include #include @@ -221,7 +223,7 @@ }; namespace { -check_is_close_t check_is_close; +check_is_close_t const& check_is_close = unit_test::detail::static_constant::value; } //____________________________________________________________________________// @@ -243,7 +245,7 @@ }; namespace { -check_is_small_t check_is_small; +check_is_small_t const& check_is_small = unit_test::detail::static_constant::value; } //____________________________________________________________________________// diff -NBwru boost_1_39_src_orig/boost/test/impl/framework.ipp boost_1_39_src/boost/test/impl/framework.ipp --- boost_1_39_src_orig/boost/test/impl/framework.ipp 2009-07-04 21:12:43.000000000 -0400 +++ boost_1_39_src/boost/test/impl/framework.ipp 2009-07-04 21:47:10.000000000 -0400 @@ -125,12 +125,7 @@ { while( !m_test_units.empty() ) { test_unit_store::value_type const& tu = *m_test_units.begin(); - - // the delete will erase this element from map - if( test_id_2_unit_type( tu.second->p_id ) == tut_suite ) - delete (test_suite const*)tu.second; - else - delete (test_case const*)tu.second; + delete tu.second; } } diff -NBwru boost_1_39_src_orig/boost/test/impl/unit_test_suite.ipp boost_1_39_src/boost/test/impl/unit_test_suite.ipp --- boost_1_39_src_orig/boost/test/impl/unit_test_suite.ipp 2009-07-04 21:12:43.000000000 -0400 +++ boost_1_39_src/boost/test/impl/unit_test_suite.ipp 2009-07-04 21:42:32.000000000 -0400 @@ -60,7 +60,7 @@ //____________________________________________________________________________// -test_unit::~test_unit() +/* virtual */ test_unit::~test_unit() { framework::deregister_test_unit( this ); } diff -NBwru boost_1_39_src_orig/boost/test/unit_test_suite_impl.hpp boost_1_39_src/boost/test/unit_test_suite_impl.hpp --- boost_1_39_src_orig/boost/test/unit_test_suite_impl.hpp 2009-07-04 21:12:43.000000000 -0400 +++ boost_1_39_src/boost/test/unit_test_suite_impl.hpp 2009-07-04 21:46:09.000000000 -0400 @@ -72,7 +72,8 @@ void increase_exp_fail( unsigned num ); protected: - ~test_unit(); + friend class framework_impl; + virtual ~test_unit(); private: // Data members @@ -107,7 +108,7 @@ private: friend class framework_impl; - ~test_case() {} + /* virtual */ ~test_case() {} // BOOST_MSVC <= 1200 have problems with callback as property // Data members @@ -138,7 +139,7 @@ friend BOOST_TEST_DECL void traverse_test_tree( test_suite const&, test_tree_visitor& ); friend class framework_impl; - virtual ~test_suite() {} + /* virtual */ ~test_suite() {} // Data members std::vector m_members;