Documented how to manage static objects

This commit is contained in:
Mathieu Champlon 2015-10-09 22:38:37 +02:00
parent e41b75e525
commit 4f0431842f
7 changed files with 98 additions and 14 deletions

View file

@ -9,29 +9,28 @@
#ifndef MOCK_CLEANUP_HPP_INCLUDED
#define MOCK_CLEANUP_HPP_INCLUDED
#include "../config.hpp"
#include "config.hpp"
#include "verify.hpp"
#include "reset.hpp"
#ifdef MOCK_USE_BOOST_TEST
#include "../verify.hpp"
#include "../reset.hpp"
#include <boost/test/unit_test_suite.hpp>
#endif
namespace mock
{
namespace detail
{
struct cleanup
{
~cleanup()
{
// see https://svn.boost.org/trac/boost/ticket/5563
//mock::verify();
mock::reset();
}
};
#ifdef MOCK_USE_BOOST_TEST
BOOST_GLOBAL_FIXTURE( cleanup );
}
#endif
} // mock
#endif // MOCK_USE_BOOST_TEST
#endif // MOCK_CLEANUP_HPP_INCLUDED

View file

@ -13,12 +13,12 @@
#include "object.hpp"
#include "reset.hpp"
#include "verify.hpp"
#include "cleanup.hpp"
#include "detail/functor.hpp"
#include "detail/function.hpp"
#include "detail/type_name.hpp"
#include "detail/signature.hpp"
#include "detail/parameter.hpp"
#include "detail/cleanup.hpp"
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/utility/identity_type.hpp>