git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@380 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2011-07-09 18:41:36 +00:00
parent a7c62e523a
commit f2fe1ad574
3 changed files with 21 additions and 4 deletions

View file

@ -95,7 +95,7 @@ namespace mock
return s << *e.impl_;
}
function& _( detail::context& c, const std::string& instance )
function& _configure( detail::context& c, const std::string& instance )
{
if( ! impl_->context_ )
c.add( *impl_ );

View file

@ -97,14 +97,14 @@ namespace detail
mock::function< S >
#define MOCK_MOCKER(o, t) \
mock::detail::deref( o ).t( mock::detail::root, \
mock::detail::deref( o ).t##configure( mock::detail::root, \
BOOST_PP_STRINGIZE(o) )
#define MOCK_ANONYMOUS_MOCKER(o, t) \
mock::detail::deref( o ).t( mock::detail::root, "?" )
mock::detail::deref( o ).t##configure( mock::detail::root, "?" )
#define MOCK_METHOD_EXPECTATION(S, t) \
mutable mock::function< S > t##expectation; \
mock::function< S >& t( const mock::detail::context&, \
mock::function< S >& t##configure( const mock::detail::context&, \
const std::string& instance ) const \
{ \
mock::detail::configure( *this, t##expectation, instance, \

View file

@ -421,3 +421,20 @@ BOOST_AUTO_TEST_CASE( boost_reference_wrapper_is_supported_in_value_constraint )
s = "string";
f( "string" );
}
namespace
{
template< typename T >
void nothing( T )
{}
struct member_pointer_mock_class
{
MOCK_CONST_METHOD_EXT( my_method, 0, void(), my_method )
};
}
BOOST_AUTO_TEST_CASE( member_pointer_on_mock_method_is_valid )
{
nothing( &member_pointer_mock_class::my_method );
}