Ticket #2647: boost-test-invalid-read.patch

File boost-test-invalid-read.patch, 1.0 KB (added by smr@…, 13 years ago)

Debian's fix

  • boost/test/impl/framework.ipp

    Fix for #538946
    Reported upstream as https://svn.boost.org/trac/boost/ticket/2647
    Patch taken from http://www.nabble.com/-Boost.Test--valgrind-complains-about-invalid-reads-td20500154.html
    
    
    old new  
    125125    {
    126126        while( !m_test_units.empty() ) {
    127127            test_unit_store::value_type const& tu = *m_test_units.begin();
    128 
    129128            // the delete will erase this element from map
    130             if( test_id_2_unit_type( tu.second->p_id ) == tut_suite )
    131                 delete  (test_suite const*)tu.second;
    132             else
    133                 delete  (test_case const*)tu.second;
     129            delete tu.second;
    134130        }
    135131    }
    136132
  • boost/test/unit_test_suite_impl.hpp

    old new  
    7171
    7272    void                                increase_exp_fail( unsigned num );
    7373
    74 protected:
    75     ~test_unit();
     74    virtual ~test_unit();
    7675
    7776private:
    7877    // Data members