mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Adress review comments
This commit is contained in:
parent
279bb2c767
commit
c7873cde4b
13 changed files with 36 additions and 48 deletions
|
|
@ -24,7 +24,7 @@
|
|||
<< ')' \
|
||||
<< lazy_expectations( this )
|
||||
|
||||
#define MOCK_MOVE(z, n, d) \
|
||||
#define MOCK_FORWARD(z, n, d) \
|
||||
std::forward< T##n >( t##n )
|
||||
|
||||
namespace mock
|
||||
|
|
@ -229,7 +229,7 @@ namespace detail
|
|||
for( const auto& expectation: expectations_ )
|
||||
{
|
||||
if( expectation.is_valid(
|
||||
BOOST_PP_ENUM(MOCK_NUM_ARGS, MOCK_MOVE, _) ) )
|
||||
BOOST_PP_ENUM(MOCK_NUM_ARGS, MOCK_FORWARD, _) ) )
|
||||
{
|
||||
if( ! expectation.invoke() )
|
||||
{
|
||||
|
|
@ -247,7 +247,7 @@ namespace detail
|
|||
error_type::call( MOCK_FUNCTION_CONTEXT, expectation.file(), expectation.line() );
|
||||
if( expectation.functor() )
|
||||
return expectation.functor()(
|
||||
BOOST_PP_ENUM(MOCK_NUM_ARGS, MOCK_MOVE, _) );
|
||||
BOOST_PP_ENUM(MOCK_NUM_ARGS, MOCK_FORWARD, _) );
|
||||
return expectation.trigger();
|
||||
}
|
||||
}
|
||||
|
|
@ -314,4 +314,4 @@ namespace detail
|
|||
|
||||
#undef MOCK_FUNCTION_FORMAT
|
||||
#undef MOCK_FUNCTION_CONTEXT
|
||||
#undef MOCK_MOVE
|
||||
#undef MOCK_FORWARD
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "function_impl_template.hpp"
|
||||
|
||||
#define MOCK_MOVE(z, n, d) \
|
||||
#define MOCK_FORWARD(z, n, d) \
|
||||
std::forward< T##n >( t##n )
|
||||
|
||||
namespace mock
|
||||
|
|
@ -65,7 +65,7 @@ namespace detail
|
|||
R operator()(
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(MOCK_NUM_ARGS, T, t) ) const
|
||||
{
|
||||
return (*impl_)( BOOST_PP_ENUM(MOCK_NUM_ARGS, MOCK_MOVE, _) );
|
||||
return (*impl_)( BOOST_PP_ENUM(MOCK_NUM_ARGS, MOCK_FORWARD, _) );
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<( std::ostream& s, const function& f )
|
||||
|
|
@ -94,4 +94,4 @@ namespace detail
|
|||
}
|
||||
} // mock
|
||||
|
||||
#undef MOCK_MOVE
|
||||
#undef MOCK_FORWARD
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@
|
|||
#define MOCK_FUNCTOR(f, ...) \
|
||||
mock::detail::functor< MOCK_FUNCTION_TYPE(__VA_ARGS__) > f, f##_mock
|
||||
/// MOCK_FUNCTOR_TPL( name, signature )
|
||||
/// Deprecated. Same as MOCK_FUNCTOR
|
||||
#define MOCK_FUNCTOR_TPL(f, ...) MOCK_FUNCTOR(f, __VA_ARGS__)
|
||||
#define MOCK_FUNCTOR_TPL(f, ...) static_assert(false, "MOCK_FUNCTOR_TPL has been replaced by MOCK_FUNCTOR")
|
||||
|
||||
#define MOCK_HELPER(t) \
|
||||
t##_mock( mock::detail::root, BOOST_PP_STRINGIZE(t) )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue