- 3.0.1 core module.
gmock-function-mocker.h File Reference

Go to the source code of this file.

Macros

#define THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_
 
#define MOCK_METHOD(...)   GMOCK_PP_VARIADIC_CALL(GMOCK_INTERNAL_MOCK_METHOD_ARG_, __VA_ARGS__)
 
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_1(...)   GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
 
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_2(...)   GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
 
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_3(_Ret, _MethodName, _Args)   GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, ())
 
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, _Spec)
 
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_5(...)   GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
 
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_6(...)   GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
 
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_7(...)   GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
 
#define GMOCK_INTERNAL_WRONG_ARITY(...)
 
#define GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Tuple)
 
#define GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE(_N, ...)
 
#define GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec)   GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT, ~, _Spec)
 
#define GMOCK_INTERNAL_MOCK_METHOD_IMPL(_N, _MethodName, _Constness, _Override, _Final, _Noexcept, _CallType, _Signature)
 
#define GMOCK_INTERNAL_EXPAND(...)   __VA_ARGS__
 
#define GMOCK_INTERNAL_HAS_CONST(_Tuple)   GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_CONST, ~, _Tuple))
 
#define GMOCK_INTERNAL_HAS_OVERRIDE(_Tuple)
 
#define GMOCK_INTERNAL_HAS_FINAL(_Tuple)   GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_FINAL, ~, _Tuple))
 
#define GMOCK_INTERNAL_HAS_NOEXCEPT(_Tuple)
 
#define GMOCK_INTERNAL_GET_CALLTYPE(_Tuple)   GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_GET_CALLTYPE_IMPL, ~, _Tuple)
 
#define GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem)
 
#define GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem)   GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_CONST_I_, _elem)
 
#define GMOCK_INTERNAL_DETECT_CONST_I_const   ,
 
#define GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem)   GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_OVERRIDE_I_, _elem)
 
#define GMOCK_INTERNAL_DETECT_OVERRIDE_I_override   ,
 
#define GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem)   GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_FINAL_I_, _elem)
 
#define GMOCK_INTERNAL_DETECT_FINAL_I_final   ,
 
#define GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)   GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_NOEXCEPT_I_, _elem)
 
#define GMOCK_INTERNAL_DETECT_NOEXCEPT_I_noexcept   ,
 
#define GMOCK_INTERNAL_GET_CALLTYPE_IMPL(_i, _, _elem)
 
#define GMOCK_INTERNAL_IS_CALLTYPE(_arg)
 
#define GMOCK_INTERNAL_IS_CALLTYPE_I(_arg)   GMOCK_PP_IS_ENCLOSED_PARENS(_arg)
 
#define GMOCK_INTERNAL_GET_VALUE_CALLTYPE(_arg)
 
#define GMOCK_INTERNAL_GET_VALUE_CALLTYPE_I(_arg)   GMOCK_PP_CAT(GMOCK_PP_IDENTITY, _arg)
 
#define GMOCK_INTERNAL_IS_CALLTYPE_HELPER_Calltype
 
#define GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)
 
#define GMOCK_INTERNAL_GET_TYPE(_i, _, _elem)
 
#define GMOCK_INTERNAL_PARAMETER(_i, _Signature, _)
 
#define GMOCK_INTERNAL_FORWARD_ARG(_i, _Signature, _)
 
#define GMOCK_INTERNAL_MATCHER_PARAMETER(_i, _Signature, _)
 
#define GMOCK_INTERNAL_MATCHER_ARGUMENT(_i, _1, _2)
 
#define GMOCK_INTERNAL_A_MATCHER_ARGUMENT(_i, _Signature, _)
 
#define GMOCK_INTERNAL_ARG_O(_tn, _i, ...)   GMOCK_ARG_(_tn, _i, __VA_ARGS__)
 
#define GMOCK_INTERNAL_MATCHER_O(_tn, _i, ...)   GMOCK_MATCHER_(_tn, _i, __VA_ARGS__)
 

Macro Definition Documentation

#define THIRD_PARTY_GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_1 (   ...)    GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_2 (   ...)    GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_3 (   _Ret,
  _MethodName,
  _Args 
)    GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, ())
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_4 (   _Ret,
  _MethodName,
  _Args,
  _Spec 
)
Value:
GMOCK_PP_NARG0 _Args, _MethodName, GMOCK_INTERNAL_HAS_CONST(_Spec), \
(GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)))
#define GMOCK_INTERNAL_MOCK_METHOD_IMPL(_N, _MethodName, _Constness,_Override, _Final, _Noexcept,_CallType, _Signature)
Definition: gmock-function-mocker.h:67
#define GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE(_N,...)
Definition: gmock-function-mocker.h:53
#define GMOCK_INTERNAL_HAS_OVERRIDE(_Tuple)
Definition: gmock-function-mocker.h:108
#define GMOCK_INTERNAL_GET_CALLTYPE(_Tuple)
Definition: gmock-function-mocker.h:119
#define GMOCK_INTERNAL_HAS_FINAL(_Tuple)
Definition: gmock-function-mocker.h:112
#define GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)
Definition: gmock-function-mocker.h:175
#define GMOCK_INTERNAL_HAS_NOEXCEPT(_Tuple)
Definition: gmock-function-mocker.h:115
#define GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Tuple)
Definition: gmock-function-mocker.h:48
#define GMOCK_PP_NARG0(...)
Definition: gmock-pp.h:137
#define GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec)
Definition: gmock-function-mocker.h:64
#define GMOCK_INTERNAL_HAS_CONST(_Tuple)
Definition: gmock-function-mocker.h:105
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_5 (   ...)    GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_6 (   ...)    GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
#define GMOCK_INTERNAL_MOCK_METHOD_ARG_7 (   ...)    GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
#define GMOCK_INTERNAL_WRONG_ARITY (   ...)
Value:
static_assert( \
false, \
"MOCK_METHOD must be called with 3 or 4 arguments. _Ret, " \
"_MethodName, _Args and optionally _Spec. _Args and _Spec must be " \
"enclosed in parentheses. If _Ret is a type with unprotected commas, " \
"it must also be enclosed in parentheses.")
#define GMOCK_INTERNAL_ASSERT_PARENTHESIS (   _Tuple)
Value:
static_assert( \
GMOCK_PP_STRINGIZE(_Tuple) " should be enclosed in parentheses.")
#define GMOCK_PP_STRINGIZE(...)
Definition: gmock-pp.h:21
#define GMOCK_PP_IS_ENCLOSED_PARENS(...)
Definition: gmock-pp.h:148
#define GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE (   _N,
  ... 
)
Value:
static_assert( \
"Signature must be a function type, maybe return type contains " \
"unprotected comma."); \
static_assert( \
::testing::tuple_size<typename ::testing::internal::Function< \
__VA_ARGS__>::ArgumentTuple>::value == _N, \
"This method does not take " GMOCK_PP_STRINGIZE( \
_N) " arguments. Parenthesize all types with unproctected commas.")
#define GMOCK_PP_STRINGIZE(...)
Definition: gmock-pp.h:21
int value
Definition: gmock-matchers_test.cc:657
#define GMOCK_INTERNAL_ASSERT_VALID_SPEC (   _Spec)    GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT, ~, _Spec)
#define GMOCK_INTERNAL_MOCK_METHOD_IMPL (   _N,
  _MethodName,
  _Constness,
  _Override,
  _Final,
  _Noexcept,
  _CallType,
  _Signature 
)
#define GMOCK_INTERNAL_EXPAND (   ...)    __VA_ARGS__
#define GMOCK_INTERNAL_HAS_CONST (   _Tuple)    GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_CONST, ~, _Tuple))
#define GMOCK_INTERNAL_HAS_OVERRIDE (   _Tuple)
Value:
#define GMOCK_PP_HAS_COMMA(...)
Definition: gmock-pp.h:76
#define GMOCK_PP_FOR_EACH(_Macro, _Data, _Tuple)
Definition: gmock-pp.h:159
#define GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem)
Definition: gmock-function-mocker.h:138
#define GMOCK_INTERNAL_HAS_FINAL (   _Tuple)    GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_FINAL, ~, _Tuple))
#define GMOCK_INTERNAL_HAS_NOEXCEPT (   _Tuple)
Value:
#define GMOCK_PP_HAS_COMMA(...)
Definition: gmock-pp.h:76
#define GMOCK_PP_FOR_EACH(_Macro, _Data, _Tuple)
Definition: gmock-pp.h:159
#define GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)
Definition: gmock-function-mocker.h:149
#define GMOCK_INTERNAL_GET_CALLTYPE (   _Tuple)    GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_GET_CALLTYPE_IMPL, ~, _Tuple)
#define GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT (   _i,
  _,
  _elem 
)
Value:
static_assert( \
_elem) " cannot be recognized as a valid specification modifier.");
#define GMOCK_PP_STRINGIZE(...)
Definition: gmock-pp.h:21
#define GMOCK_PP_HAS_COMMA(...)
Definition: gmock-pp.h:76
#define GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem)
Definition: gmock-function-mocker.h:133
#define GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)
Definition: gmock-function-mocker.h:149
#define GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem)
Definition: gmock-function-mocker.h:143
#define GMOCK_INTERNAL_IS_CALLTYPE(_arg)
Definition: gmock-function-mocker.h:162
#define GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem)
Definition: gmock-function-mocker.h:138
#define GMOCK_INTERNAL_DETECT_CONST (   _i,
  _,
  _elem 
)    GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_CONST_I_, _elem)
#define GMOCK_INTERNAL_DETECT_CONST_I_const   ,
#define GMOCK_INTERNAL_DETECT_OVERRIDE (   _i,
  _,
  _elem 
)    GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_OVERRIDE_I_, _elem)
#define GMOCK_INTERNAL_DETECT_OVERRIDE_I_override   ,
#define GMOCK_INTERNAL_DETECT_FINAL (   _i,
  _,
  _elem 
)    GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_FINAL_I_, _elem)
#define GMOCK_INTERNAL_DETECT_FINAL_I_final   ,
#define GMOCK_INTERNAL_DETECT_NOEXCEPT (   _i,
  _,
  _elem 
)    GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_NOEXCEPT_I_, _elem)
#define GMOCK_INTERNAL_DETECT_NOEXCEPT_I_noexcept   ,
#define GMOCK_INTERNAL_GET_CALLTYPE_IMPL (   _i,
  _,
  _elem 
)
Value:
(_elem)
#define GMOCK_PP_EMPTY(...)
Definition: gmock-pp.h:24
#define GMOCK_INTERNAL_GET_VALUE_CALLTYPE(_arg)
Definition: gmock-function-mocker.h:167
#define GMOCK_INTERNAL_IS_CALLTYPE(_arg)
Definition: gmock-function-mocker.h:162
#define GMOCK_PP_IF(_Cond, _Then, _Else)
Definition: gmock-pp.h:121
#define GMOCK_INTERNAL_IS_CALLTYPE (   _arg)
Value:
GMOCK_PP_CAT(GMOCK_INTERNAL_IS_CALLTYPE_HELPER_, _arg))
#define GMOCK_PP_CAT(_1, _2)
Definition: gmock-pp.h:18
#define GMOCK_INTERNAL_IS_CALLTYPE_I(_arg)
Definition: gmock-function-mocker.h:165
#define GMOCK_INTERNAL_IS_CALLTYPE_I (   _arg)    GMOCK_PP_IS_ENCLOSED_PARENS(_arg)
#define GMOCK_INTERNAL_GET_VALUE_CALLTYPE (   _arg)
Value:
GMOCK_PP_CAT(GMOCK_INTERNAL_IS_CALLTYPE_HELPER_, _arg))
#define GMOCK_INTERNAL_GET_VALUE_CALLTYPE_I(_arg)
Definition: gmock-function-mocker.h:170
#define GMOCK_PP_CAT(_1, _2)
Definition: gmock-pp.h:18
#define GMOCK_INTERNAL_GET_VALUE_CALLTYPE_I (   _arg)    GMOCK_PP_CAT(GMOCK_PP_IDENTITY, _arg)
#define GMOCK_INTERNAL_IS_CALLTYPE_HELPER_Calltype
#define GMOCK_INTERNAL_SIGNATURE (   _Ret,
  _Args 
)
Value:
#define GMOCK_INTERNAL_GET_TYPE(_i, _, _elem)
Definition: gmock-function-mocker.h:180
#define GMOCK_PP_IS_BEGIN_PARENS(...)
Definition: gmock-pp.h:142
#define GMOCK_PP_FOR_EACH(_Macro, _Data, _Tuple)
Definition: gmock-pp.h:159
#define GMOCK_PP_REMOVE_PARENS(...)
Definition: gmock-pp.h:153
#define GMOCK_PP_IF(_Cond, _Then, _Else)
Definition: gmock-pp.h:121
#define GMOCK_PP_IDENTITY(_1)
Definition: gmock-pp.h:30
#define GMOCK_INTERNAL_GET_TYPE (   _i,
  _,
  _elem 
)
Value:
(_elem)
#define GMOCK_PP_IS_BEGIN_PARENS(...)
Definition: gmock-pp.h:142
#define GMOCK_PP_COMMA_IF(_i)
Definition: gmock-pp.h:175
#define GMOCK_PP_REMOVE_PARENS(...)
Definition: gmock-pp.h:153
#define GMOCK_PP_IF(_Cond, _Then, _Else)
Definition: gmock-pp.h:121
#define GMOCK_PP_IDENTITY(_1)
Definition: gmock-pp.h:30
#define GMOCK_INTERNAL_PARAMETER (   _i,
  _Signature,
 
)
Value:
GMOCK_PP_REMOVE_PARENS(_Signature)) \
gmock_a##_i
#define GMOCK_PP_COMMA_IF(_i)
Definition: gmock-pp.h:175
#define GMOCK_INTERNAL_ARG_O(_tn, _i,...)
Definition: gmock-function-mocker.h:213
#define GMOCK_PP_REMOVE_PARENS(...)
Definition: gmock-pp.h:153
#define GMOCK_PP_INC(_i)
Definition: gmock-pp.h:172
#define GMOCK_INTERNAL_FORWARD_ARG (   _i,
  _Signature,
 
)
Value:
::std::forward<GMOCK_INTERNAL_ARG_O(typename, GMOCK_PP_INC(_i), \
GMOCK_PP_REMOVE_PARENS(_Signature))>( \
gmock_a##_i)
#define GMOCK_PP_COMMA_IF(_i)
Definition: gmock-pp.h:175
#define GMOCK_INTERNAL_ARG_O(_tn, _i,...)
Definition: gmock-function-mocker.h:213
#define GMOCK_PP_REMOVE_PARENS(...)
Definition: gmock-pp.h:153
#define GMOCK_PP_INC(_i)
Definition: gmock-pp.h:172
#define GMOCK_INTERNAL_MATCHER_PARAMETER (   _i,
  _Signature,
 
)
Value:
GMOCK_PP_REMOVE_PARENS(_Signature)) \
gmock_a##_i
#define GMOCK_PP_COMMA_IF(_i)
Definition: gmock-pp.h:175
#define GMOCK_INTERNAL_MATCHER_O(_tn, _i,...)
Definition: gmock-function-mocker.h:215
#define GMOCK_PP_REMOVE_PARENS(...)
Definition: gmock-pp.h:153
#define GMOCK_PP_INC(_i)
Definition: gmock-pp.h:172
#define GMOCK_INTERNAL_MATCHER_ARGUMENT (   _i,
  _1,
  _2 
)
Value:
gmock_a##_i
#define GMOCK_PP_COMMA_IF(_i)
Definition: gmock-pp.h:175
#define GMOCK_INTERNAL_A_MATCHER_ARGUMENT (   _i,
  _Signature,
 
)
Value:
::testing::A<GMOCK_INTERNAL_ARG_O(typename, GMOCK_PP_INC(_i), \
GMOCK_PP_REMOVE_PARENS(_Signature))>()
#define GMOCK_PP_COMMA_IF(_i)
Definition: gmock-pp.h:175
#define GMOCK_INTERNAL_ARG_O(_tn, _i,...)
Definition: gmock-function-mocker.h:213
#define GMOCK_PP_REMOVE_PARENS(...)
Definition: gmock-pp.h:153
#define GMOCK_PP_INC(_i)
Definition: gmock-pp.h:172
#define GMOCK_INTERNAL_ARG_O (   _tn,
  _i,
  ... 
)    GMOCK_ARG_(_tn, _i, __VA_ARGS__)
#define GMOCK_INTERNAL_MATCHER_O (   _tn,
  _i,
  ... 
)    GMOCK_MATCHER_(_tn, _i, __VA_ARGS__)