Fixed a crash with Boost.Test when failed static mock objects are destroyed

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@338 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2011-05-19 20:35:34 +00:00
parent 90cd7f7bd8
commit 9025ff2f0d

View file

@ -9,6 +9,7 @@
#ifndef MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED #ifndef MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED
#define MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED #define MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED
#include "root.hpp"
#include <boost/test/framework.hpp> #include <boost/test/framework.hpp>
#include <boost/test/test_tools.hpp> #include <boost/test/test_tools.hpp>
#include <boost/test/unit_test_suite.hpp> #include <boost/test/unit_test_suite.hpp>
@ -86,6 +87,16 @@ namespace mock
fail( "untriggered expectation", context, file, line ); fail( "untriggered expectation", context, file, line );
} }
}; };
struct cleanup
{
~cleanup()
{
//mock::verify(); // $$$$ MAT : because of a bug in Boost.Test this will crash anything needs to be logged
mock::reset();
}
};
BOOST_GLOBAL_FIXTURE( cleanup );
} }
#endif // MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED #endif // MOCK_BOOST_TEST_ERROR_POLICY_HPP_INCLUDED