Fixed regression

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@665 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-05-21 09:21:52 +00:00
parent 24530c4e3c
commit c697b48802
7 changed files with 76 additions and 24 deletions

View file

@ -8,6 +8,7 @@
#define BOOST_AUTO_TEST_MAIN
#include "../mock_error.hpp"
#include "../undefined.hpp"
#include <turtle/detail/function.hpp>
#include <turtle/constraints.hpp>
#include <boost/test/auto_unit_test.hpp>
@ -533,6 +534,20 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_returns_the_set_auto_ptr_valu
BOOST_CHECK_NO_THROW( f() );
CHECK_CALLS( 1 );
}
}
BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_returns_the_set_shared_ptr_value, error_fixture )
{
{
mock::detail::function< boost::shared_ptr< A >() > f;
f.expect().returns( new B );
BOOST_CHECK_NO_THROW( f() );
CHECK_CALLS( 1 );
}
}
BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_returns_by_reference, error_fixture )
{
{
mock::detail::function< A&() > f;
B b;
@ -547,6 +562,11 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_returns_the_set_auto_ptr_valu
BOOST_CHECK_NO_THROW( f() );
CHECK_CALLS( 1 );
}
{
mock::detail::function< undefined&() > f;
f.expect().returns( boost::ref( get_undefined() ) );
f.reset();
}
}
namespace