mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Merge pull request #28 from mat007/fix-mocking-a-returned-reference
Fix mocking a function returning a reference
This commit is contained in:
commit
238fff3fe2
3 changed files with 8 additions and 2 deletions
|
|
@ -7,6 +7,13 @@
|
||||||
|
|
||||||
[section Changelog]
|
[section Changelog]
|
||||||
|
|
||||||
|
[section unreleased]
|
||||||
|
Not yet released
|
||||||
|
|
||||||
|
* Fixed mocking of a function returning a reference for gcc 4.1
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
[section 1.3.0]
|
[section 1.3.0]
|
||||||
Released 17 July 2016
|
Released 17 July 2016
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ namespace detail
|
||||||
return static_cast< value_imp< T >& >( *v_ ).t_;
|
return static_cast< value_imp< T >& >( *v_ ).t_;
|
||||||
}
|
}
|
||||||
template< typename T >
|
template< typename T >
|
||||||
Result& store( T* t )
|
typename boost::remove_reference< Result >::type& store( T* t )
|
||||||
{
|
{
|
||||||
v_.reset( new value_imp< Result >( t ) );
|
v_.reset( new value_imp< Result >( t ) );
|
||||||
return static_cast< value_imp< Result >& >( *v_ ).t_;
|
return static_cast< value_imp< Result >& >( *v_ ).t_;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
#include "mock_error.hpp"
|
#include "mock_error.hpp"
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
#include <boost/test/auto_unit_test.hpp>
|
#include <boost/test/auto_unit_test.hpp>
|
||||||
#include <boost/mpl/assert.hpp>
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue