mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added variadic macro support for MOCK_BASE_CLASS and MOCK_FUNCTOR
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@599 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
a1436f26e6
commit
68ae1ada45
2 changed files with 19 additions and 2 deletions
|
|
@ -23,13 +23,25 @@
|
|||
#include <boost/preprocessor/stringize.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
|
||||
#define MOCK_BASE_CLASS(T, I) \
|
||||
struct T : I, mock::object, mock::detail::base< I >
|
||||
#define MOCK_CLASS(T) \
|
||||
struct T : mock::object
|
||||
|
||||
#ifdef BOOST_NO_VARIADIC_MACROS
|
||||
|
||||
#define MOCK_BASE_CLASS(T, I) \
|
||||
struct T : I, mock::object, mock::detail::base< I >
|
||||
#define MOCK_FUNCTOR(f, S) \
|
||||
mock::detail::functor< S > f, f##_mock
|
||||
|
||||
#else // BOOST_NO_VARIADIC_MACROS
|
||||
|
||||
#define MOCK_BASE_CLASS(T, ...) \
|
||||
struct T : __VA_ARGS__, mock::object, mock::detail::base< __VA_ARGS__ >
|
||||
#define MOCK_FUNCTOR(f, ...) \
|
||||
mock::detail::functor< __VA_ARGS__ > f, f##_mock
|
||||
|
||||
#endif // BOOST_NO_VARIADIC_MACROS
|
||||
|
||||
#define MOCK_HELPER(t) \
|
||||
t##_mock( mock::detail::root, BOOST_PP_STRINGIZE(t) )
|
||||
#define MOCK_ANONYMOUS_HELPER(t) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue