git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@405 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-01-14 16:43:09 +00:00
parent a7728caefb
commit a82a5b275c

View file

@ -82,23 +82,23 @@ namespace detail
#define MOCK_CLASS(T) \ #define MOCK_CLASS(T) \
struct T : mock::object struct T : mock::object
#define MOCK_FUNCTOR(f, S) \ #define MOCK_FUNCTOR(f, S) \
mock::detail::functor< S > f, f##configure mock::detail::functor< S > f, f##_mocker
#define MOCK_MOCKER(t) \ #define MOCK_MOCKER(t) \
t##configure( mock::detail::root, BOOST_PP_STRINGIZE(t) ) t##_mocker( mock::detail::root, BOOST_PP_STRINGIZE(t) )
#define MOCK_ANONYMOUS_MOCKER(t) \ #define MOCK_ANONYMOUS_MOCKER(t) \
t##configure( mock::detail::root, "?." ) t##_mocker( mock::detail::root, "?." )
#define MOCK_METHOD_EXPECTATION(S, t) \ #define MOCK_METHOD_EXPECTATION(S, t) \
mutable mock::function< S > t##expectation; \ mutable mock::function< S > t##_mocker_; \
mock::function< S >& t##configure( const mock::detail::context&, \ mock::function< S >& t##_mocker( const mock::detail::context&, \
boost::unit_test::const_string instance ) const \ boost::unit_test::const_string instance ) const \
{ \ { \
mock::detail::configure( *this, t##expectation, \ mock::detail::configure( *this, t##_mocker_, \
instance.substr( 0, instance.rfind( BOOST_PP_STRINGIZE(t) ) ), \ instance.substr( 0, instance.rfind( BOOST_PP_STRINGIZE(t) ) ), \
mock::detail::type_name( typeid( *this ) ), \ mock::detail::type_name( typeid( *this ) ), \
BOOST_PP_STRINGIZE(t) ); \ BOOST_PP_STRINGIZE(t) ); \
return t##expectation; \ return t##_mocker_; \
} }
#define MOCK_SIGNATURE(M) \ #define MOCK_SIGNATURE(M) \
@ -153,7 +153,7 @@ namespace detail
MOCK_METHOD_EXPECTATION(T(), t) MOCK_METHOD_EXPECTATION(T(), t)
#define MOCK_FUNCTION_STUB(F, n, S, t, s) \ #define MOCK_FUNCTION_STUB(F, n, S, t, s) \
s mock::function< S >& t##configure( mock::detail::context& context, \ s mock::function< S >& t##_mocker( mock::detail::context& context, \
boost::unit_test::const_string instance ) \ boost::unit_test::const_string instance ) \
{ \ { \
static mock::function< S > f; \ static mock::function< S > f; \