mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Tweaks
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@391 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
ee338d40bb
commit
c0bc085943
2 changed files with 6 additions and 3 deletions
|
|
@ -36,6 +36,9 @@ namespace detail
|
||||||
template< typename Value >
|
template< typename Value >
|
||||||
void returns( Value v )
|
void returns( Value v )
|
||||||
{
|
{
|
||||||
|
// if an error is generated by the line below it means a value
|
||||||
|
// passed to 'returns' was of the wrong type as it cannot be
|
||||||
|
// used to copy construct a Result
|
||||||
r_.reset( new result_type( v ) );
|
r_.reset( new result_type( v ) );
|
||||||
f_ = lambda_type::make_val( boost::ref( *r_ ) );
|
f_ = lambda_type::make_val( boost::ref( *r_ ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ namespace detail
|
||||||
n \
|
n \
|
||||||
>::type arg##n##_type;
|
>::type arg##n##_type;
|
||||||
#define MOCK_EXPECTATION_CONSTRUCTOR(z, n, d) BOOST_PP_COMMA_IF(n) c##n##_( new detail::check< arg##n##_type, constraint< detail::any > >( mock::any ) )
|
#define MOCK_EXPECTATION_CONSTRUCTOR(z, n, d) BOOST_PP_COMMA_IF(n) c##n##_( new detail::check< arg##n##_type, constraint< detail::any > >( mock::any ) )
|
||||||
#define MOCK_EXPECTATION_WITH(z, n, d) c##n##_.reset( new detail::check< arg##n##_type, Constraint##n >( c##n ) );
|
#define MOCK_EXPECTATION_WITH(z, n, d) c##n##_.reset( new detail::check< arg##n##_type, Constraint_##n >( c##n ) );
|
||||||
#define MOCK_EXPECTATION_MEMBER(z, n, d) boost::shared_ptr< detail::check_base< arg##n##_type > > c##n##_;
|
#define MOCK_EXPECTATION_MEMBER(z, n, d) boost::shared_ptr< detail::check_base< arg##n##_type > > c##n##_;
|
||||||
#define MOCK_EXPECTATION_ARGS(z, n, d) BOOST_PP_COMMA_IF(n) arg##n##_type a##n
|
#define MOCK_EXPECTATION_ARGS(z, n, d) BOOST_PP_COMMA_IF(n) arg##n##_type a##n
|
||||||
#define MOCK_EXPECTATION_IS_VALID(z, n, d) && (*c##n##_)( a##n )
|
#define MOCK_EXPECTATION_IS_VALID(z, n, d) && (*c##n##_)( a##n )
|
||||||
|
|
@ -191,8 +191,8 @@ namespace detail
|
||||||
expectation() \
|
expectation() \
|
||||||
: BOOST_PP_REPEAT(n, MOCK_EXPECTATION_CONSTRUCTOR, BOOST_PP_EMPTY) \
|
: BOOST_PP_REPEAT(n, MOCK_EXPECTATION_CONSTRUCTOR, BOOST_PP_EMPTY) \
|
||||||
{} \
|
{} \
|
||||||
template< BOOST_PP_ENUM_PARAMS(n, typename Constraint) > \
|
template< BOOST_PP_ENUM_PARAMS(n, typename Constraint_) > \
|
||||||
expectation& with( BOOST_PP_ENUM_BINARY_PARAMS(n, Constraint, c) ) \
|
expectation& with( BOOST_PP_ENUM_BINARY_PARAMS(n, Constraint_, c) ) \
|
||||||
{ \
|
{ \
|
||||||
BOOST_PP_REPEAT(n, MOCK_EXPECTATION_WITH, BOOST_PP_EMPTY) \
|
BOOST_PP_REPEAT(n, MOCK_EXPECTATION_WITH, BOOST_PP_EMPTY) \
|
||||||
return *this; \
|
return *this; \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue