MockDefinitions.hpp File Reference
Include dependency graph for MockDefinitions.hpp:
This graph shows which files directly or indirectly include this file:

Macros

#define EXPECT_CALL(OBJECT, METHOD_NAME, ...)
 
#define MOCK0(RESULT, ...)   RILI_MOCK_VA_ARGS_MACRO_EXPAND(RILI_MOCK0_HELPER(__FILE__, __LINE__, RESULT, __VA_ARGS__, , ))
 
#define MOCK1(RESULT, METHOD_NAME, ...)
 
#define MOCK2(RESULT, METHOD_NAME, T1, ...)
 
#define MOCK3(RESULT, METHOD_NAME, T1, T2, ...)
 
#define MOCK4(RESULT, METHOD_NAME, T1, T2, T3, ...)
 
#define MOCK5(RESULT, METHOD_NAME, T1, T2, T3, T4, ...)
 
#define MOCK6(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, ...)
 
#define MOCK7(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, ...)
 
#define MOCK8(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, T7, ...)
 
#define MOCK9(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, T7, T8, ...)
 
#define MOCK10(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, T7, T8, T9, ...)
 

Macro Definition Documentation

#define EXPECT_CALL (   OBJECT,
  METHOD_NAME,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_CALL_HELPER(__FILE__, __LINE__, OBJECT, METHOD_NAME, __VA_ARGS__, std::string(), std::string()))

EXPECT_CALL(OBJECT, METHOD_NAME, MESSAGE) indicate that there is expected call of METHOD_NAME on object OBJECT.

If expectation will be not fullfited produce failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT,
  • METHOD_NAME signature as string
  • optional MESSAGE
Note
message parameter is optional - if not provided empty will be used
#define MOCK0 (   RESULT,
  ... 
)    RILI_MOCK_VA_ARGS_MACRO_EXPAND(RILI_MOCK0_HELPER(__FILE__, __LINE__, RESULT, __VA_ARGS__, , ))

MOCK0(RESULT, METHOD_NAME, SPECIFIERS) generate mocked method which returns RESULT type, take 0 arguments, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc... )

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK1 (   RESULT,
  METHOD_NAME,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND( \
RILI_MOCK1_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, __VA_ARGS__, , ))

MOCK1(RESULT, METHOD_NAME, T1, SPECIFIERS) generate mocked method which returns RESULT type, take 1 argument of type T1, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc...)

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified argument (if T1 is streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK10 (   RESULT,
  METHOD_NAME,
  T1,
  T2,
  T3,
  T4,
  T5,
  T6,
  T7,
  T8,
  T9,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND(RILI_MOCK10_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, \
T7, T8, T9, __VA_ARGS__, , ))

MOCK10(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, SPECIFIERS) generate mocked method which returns RESULT type, take 10 arguments of types T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc... )

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK2 (   RESULT,
  METHOD_NAME,
  T1,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND( \
RILI_MOCK2_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, __VA_ARGS__, , ))

MOCK2(RESULT, METHOD_NAME, T1, T2, SPECIFIERS) generate mocked method which returns RESULT type, take 2 arguments of types T1, T2, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc... )

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK3 (   RESULT,
  METHOD_NAME,
  T1,
  T2,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND( \
RILI_MOCK3_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, T2, __VA_ARGS__, , ))

MOCK3(RESULT, METHOD_NAME, T1, T2, T3, SPECIFIERS) generate mocked method which returns RESULT type, take 3 arguments of types T1, T2, T3, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc... )

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2, T3 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK4 (   RESULT,
  METHOD_NAME,
  T1,
  T2,
  T3,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND( \
RILI_MOCK4_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, T2, T3, __VA_ARGS__, , ))

MOCK4(RESULT, METHOD_NAME, T1, T2, T3, T4, SPECIFIERS) generate mocked method which returns RESULT type, take 4 arguments of types T1, T2, T3, T4, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc...)

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2, T3, T4 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK5 (   RESULT,
  METHOD_NAME,
  T1,
  T2,
  T3,
  T4,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND( \
RILI_MOCK5_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, T2, T3, T4, __VA_ARGS__, , ))

MOCK5(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, SPECIFIERS) generate mocked method which returns RESULT type, take 5 arguments of types T1, T2, T3, T4, T5, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc...)

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2, T3, T4, T5 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK6 (   RESULT,
  METHOD_NAME,
  T1,
  T2,
  T3,
  T4,
  T5,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND( \
RILI_MOCK6_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, T2, T3, T4, T5, __VA_ARGS__, , ))

MOCK6(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, SPECIFIERS) generate mocked method which returns RESULT type, take 6 arguments of types T1, T2, T3, T4, T5, T6, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc...)

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2, T3, T4, T5, T6 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK7 (   RESULT,
  METHOD_NAME,
  T1,
  T2,
  T3,
  T4,
  T5,
  T6,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND(RILI_MOCK7_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, \
__VA_ARGS__, , ))

MOCK7(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, T7, SPECIFIERS) generate mocked method which returns RESULT type, take 7 arguments of types T1, T2, T3, T4, T5, T6, T7, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc...)

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2, T3, T4, T5, T6, T7 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK8 (   RESULT,
  METHOD_NAME,
  T1,
  T2,
  T3,
  T4,
  T5,
  T6,
  T7,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND(RILI_MOCK8_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, \
T7, __VA_ARGS__, , ))

MOCK8(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, T7, T8, SPECIFIERS) generate mocked method which returns RESULT type, take 8 arguments of types T1, T2, T3, T4, T5, T6, T7, T8, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc...)

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2, T3, T4, T5, T6, T7, T8 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.
#define MOCK9 (   RESULT,
  METHOD_NAME,
  T1,
  T2,
  T3,
  T4,
  T5,
  T6,
  T7,
  T8,
  ... 
)
Value:
RILI_MOCK_VA_ARGS_MACRO_EXPAND(RILI_MOCK9_HELPER(__FILE__, __LINE__, RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, \
T7, T8, __VA_ARGS__, , ))

MOCK9(RESULT, METHOD_NAME, T1, T2, T3, T4, T5, T6, T7, T8, T9, SPECIFIERS) generate mocked method which returns RESULT type, take 9 arguments of types T1, T2, T3, T4, T5, T6, T7, T8, T9, have name METHOD_NAME and optional SPECIFIERS (like "noexcept", "const" etc... )

In case of unexpected call will be produced failure event, which contain:

  • file location
  • line number
  • pointer to OBJECT on which mocked method was called,
  • stringified arguments (if T1, T2, T3, T4, T5, T6, T7, T8, T9 are streamable)
  • METHOD_NAME signature includeing optional SPECIFIERS and RESULT type
Note
SPECIFIERS parameter is optional, however important if you would like to mock "const" or "noexcept" method.