mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Refactoring
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@153 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
348c60a757
commit
a5e961c805
2 changed files with 14 additions and 9 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||||
#include <boost/function_types/parameter_types.hpp>
|
#include <boost/function_types/parameter_types.hpp>
|
||||||
|
#include <boost/function_types/result_type.hpp>
|
||||||
#include <boost/mpl/at.hpp>
|
#include <boost/mpl/at.hpp>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
@ -105,7 +106,7 @@ namespace detail
|
||||||
int line_;
|
int line_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template< typename Result, typename Signature, int >
|
template< typename Signature, int >
|
||||||
class expectation
|
class expectation
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
@ -147,9 +148,11 @@ namespace detail
|
||||||
return *this; \
|
return *this; \
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename Result, typename Signature >
|
template< typename Signature >
|
||||||
class expectation< Result, Signature, 0 >
|
class expectation< Signature, 0 >
|
||||||
: public expectation_base, public action< Result, Signature >
|
: public expectation_base
|
||||||
|
, public action< BOOST_DEDUCED_TYPENAME
|
||||||
|
boost::function_types::result_type< Signature >::type, Signature >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool is_valid() const
|
bool is_valid() const
|
||||||
|
|
@ -180,9 +183,11 @@ namespace detail
|
||||||
#define MOCK_EXPECTATION_IS_VALID(z, n, d) && c##n##_( a##n )
|
#define MOCK_EXPECTATION_IS_VALID(z, n, d) && c##n##_( a##n )
|
||||||
#define MOCK_EXPECTATION_SERIALIZE(z, n, d) BOOST_PP_IF(n, << ", " <<,) m.c##n##_
|
#define MOCK_EXPECTATION_SERIALIZE(z, n, d) BOOST_PP_IF(n, << ", " <<,) m.c##n##_
|
||||||
#define MOCK_EXPECTATION(z, n, d) \
|
#define MOCK_EXPECTATION(z, n, d) \
|
||||||
template< typename Result, typename Signature > \
|
template< typename Signature > \
|
||||||
class expectation< Result, Signature, n > \
|
class expectation< Signature, n > \
|
||||||
: public expectation_base, public action< Result, Signature > \
|
: public expectation_base \
|
||||||
|
, public action< BOOST_DEDUCED_TYPENAME \
|
||||||
|
boost::function_types::result_type< Signature >::type, Signature > \
|
||||||
{ \
|
{ \
|
||||||
BOOST_PP_REPEAT_FROM_TO(0, n, MOCK_EXPECTATION_TYPEDEF, BOOST_PP_EMPTY) \
|
BOOST_PP_REPEAT_FROM_TO(0, n, MOCK_EXPECTATION_TYPEDEF, BOOST_PP_EMPTY) \
|
||||||
public: \
|
public: \
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ namespace mock
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef detail::expectation< result_type, Signature, arity::value >
|
typedef BOOST_DEDUCED_TYPENAME
|
||||||
expectation_type;
|
detail::expectation< Signature, arity::value > expectation_type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct function_tag
|
struct function_tag
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue