mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Remove ASSERT_VERIFY_FAIL macro from static_objects_problem
This commit is contained in:
parent
e43059423e
commit
e26601672e
1 changed files with 9 additions and 3 deletions
|
|
@ -6,8 +6,15 @@
|
||||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
// Used to make this test file pass. Define to empty to see other tests fail
|
#include <boost/test/unit_test.hpp>
|
||||||
#define ASSERT_VERIFY_FAIL() mock::reset()
|
|
||||||
|
// Used to make this test file pass. Define to 0 to see other tests fail
|
||||||
|
#define MOCK_MAKE_TEST_PASS 1
|
||||||
|
|
||||||
|
#if MOCK_MAKE_TEST_PASS
|
||||||
|
#undef BOOST_AUTO_TEST_CASE
|
||||||
|
#define BOOST_AUTO_TEST_CASE(name) BOOST_FIXTURE_TEST_CASE(name, mock::cleanup)
|
||||||
|
#endif
|
||||||
|
|
||||||
//[ static_objects_problem
|
//[ static_objects_problem
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
@ -36,7 +43,6 @@ BOOST_AUTO_TEST_CASE( static_objects_problem )
|
||||||
{
|
{
|
||||||
my_class c( 42 );
|
my_class c( 42 );
|
||||||
MOCK_EXPECT( f ).once().with( &c ); // the set expectation will also outlive the test case and leak into other test cases using 'f'
|
MOCK_EXPECT( f ).once().with( &c ); // the set expectation will also outlive the test case and leak into other test cases using 'f'
|
||||||
ASSERT_VERIFY_FAIL(); // Check that mock::verify fails, but that means other test fail too
|
|
||||||
} // the 'c' instance goes out of scope and the '&c' pointer becomes dangling
|
} // the 'c' instance goes out of scope and the '&c' pointer becomes dangling
|
||||||
//]
|
//]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue