From 86319a23d5ad1b0fdbf2ea8ee227dceb0dc4791b Mon Sep 17 00:00:00 2001 From: mat007 Date: Sat, 31 Aug 2013 08:11:06 +0000 Subject: [PATCH] Removed call notifications upon mock object destruction git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@690 860be788-9bd5-4423-9f1e-828f051e677b --- test/detail/test_function.cpp | 2 -- turtle/detail/expectation_base.hpp | 5 ----- turtle/detail/function_impl_template.hpp | 6 ------ turtle/detail/invocation.hpp | 6 ------ 4 files changed, 19 deletions(-) diff --git a/test/detail/test_function.cpp b/test/detail/test_function.cpp index 6db910d..15fd5be 100644 --- a/test/detail/test_function.cpp +++ b/test/detail/test_function.cpp @@ -167,14 +167,12 @@ BOOST_FIXTURE_TEST_CASE( verifying_an_unlimited_expectation_succeeds, error_fixt BOOST_CHECK( f.verify() ); CHECK_CALLS( 0 ); } - CHECK_CALLS( 1 ); { mock::detail::function< int( int, const std::string& ) > f; f.expect(); BOOST_CHECK( f.verify() ); CHECK_CALLS( 0 ); } - CHECK_CALLS( 1 ); } BOOST_FIXTURE_TEST_CASE( verifying_a_once_expectation_after_one_call_succeeds, error_fixture ) diff --git a/turtle/detail/expectation_base.hpp b/turtle/detail/expectation_base.hpp index ba5d5db..c5912bf 100644 --- a/turtle/detail/expectation_base.hpp +++ b/turtle/detail/expectation_base.hpp @@ -46,11 +46,6 @@ namespace detail return result; } - bool invoked() const - { - return i_->invoked(); - } - const char* file() const { return file_; diff --git a/turtle/detail/function_impl_template.hpp b/turtle/detail/function_impl_template.hpp index db5c403..848706e 100644 --- a/turtle/detail/function_impl_template.hpp +++ b/turtle/detail/function_impl_template.hpp @@ -53,16 +53,10 @@ namespace detail if( valid_ && ! std::uncaught_exception() ) for( expectations_cit it = expectations_.begin(); it != expectations_.end(); ++it ) - { if( ! it->verify() ) error_type::fail( "untriggered expectation", boost::unit_test::lazy_ostream::instance() << *this, it->file(), it->line() ); - else if( ! it->invoked() ) - error_type::call( - boost::unit_test::lazy_ostream::instance() - << *this, it->file(), it->line() ); - } if( context_ ) context_->remove( *this ); } diff --git a/turtle/detail/invocation.hpp b/turtle/detail/invocation.hpp index b451cba..bf13310 100644 --- a/turtle/detail/invocation.hpp +++ b/turtle/detail/invocation.hpp @@ -28,7 +28,6 @@ namespace detail virtual bool invoke() = 0; virtual bool verify() const = 0; - virtual bool invoked() const = 0; virtual bool exhausted() const = 0; friend std::ostream& operator<<( std::ostream& s, const invocation& i ) @@ -60,11 +59,6 @@ namespace detail return true; } - virtual bool invoked() const - { - return count_ > 0; - } - virtual bool exhausted() const { return count_ >= max_;