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

Macros

#define ADD_FAILURE(...)
 
#define EXPECT_EQ(LEFT, ...)
 
#define EXPECT_NE(LEFT, ...)
 
#define EXPECT_NEAR(LEFT, RIGHT, ...)
 
#define EXPECT_LT(LEFT, ...)
 
#define EXPECT_LE(LEFT, ...)
 
#define EXPECT_GT(LEFT, ...)
 
#define EXPECT_GE(LEFT, ...)
 
#define EXPECT_TRUE(...)
 
#define EXPECT_FALSE(...)
 
#define EXPECT_ANY_THROW(...)
 
#define EXPECT_THROW(TYPE, ...)
 

Macro Definition Documentation

#define ADD_FAILURE (   ...)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_ADD_FAILURE_HELPER(__FILE__, __LINE__, __VA_ARGS__, std::string(), std::string()))

ADD_FAILURE(MESSAGE) indicate about custom failure.

To failure information is included:

  • file location
  • line number
  • message
Note
message parameter is optional - if not provided empty will be used
#define EXPECT_ANY_THROW (   ...)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_ANY_THROW_HELPER(__FILE__, __LINE__, __VA_ARGS__, std::string(), std::string()))

EXPECT_ANY_THROW(INVOKE, MESSAGE) indicate about if any exception will be not thrown from INVOKE.

To failure information is included:

  • file location
  • line number
  • INVOKE stringified expression,
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
check result
#define EXPECT_EQ (   LEFT,
  ... 
)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_EQ_HELPER(__FILE__, __LINE__, LEFT, __VA_ARGS__, std::string(), std::string()))

EXPECT_EQ(LEFT, RIGHT, MESSAGE) indicate about failure if LEFT and RIGHT are not equal(using: !(LEFT == RIGHT))

To failure information is included:

  • file location
  • line number
  • LEFT and RIGHT stringified expression,
  • LEFT and RIGHT value if convertiable to string (by std::ostringstream interface)
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result
#define EXPECT_FALSE (   ...)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_FALSE_HELPER(__FILE__, __LINE__, __VA_ARGS__, std::string(), std::string()))

EXPECT_FALSE(EXPR, MESSAGE) indicate about failure if EXPR is true(using: !(EXPR == false))

To failure information is included:

  • file location
  • line number
  • EXPR stringified expression,
  • EXPR value
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result
#define EXPECT_GE (   LEFT,
  ... 
)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_GE_HELPER(__FILE__, __LINE__, LEFT, __VA_ARGS__, std::string(), std::string()))

EXPECT_GE(LEFT, RIGHT, MESSAGE) indicate about failure if LEFT is not greater or equal RIGHT(using: !(LEFT >= RIGHT))

To failure information is included:

  • file location
  • line number
  • LEFT and RIGHT stringified expression,
  • LEFT and RIGHT value if convertiable to string (by std::ostringstream interface)
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result
#define EXPECT_GT (   LEFT,
  ... 
)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_GT_HELPER(__FILE__, __LINE__, LEFT, __VA_ARGS__, std::string(), std::string()))

EXPECT_GT(LEFT, RIGHT, MESSAGE) indicate about failure if LEFT is not greater than RIGHT(using: !(LEFT > RIGHT))

To failure information is included:

  • file location
  • line number
  • LEFT and RIGHT stringified expression,
  • LEFT and RIGHT value if convertiable to string (by std::ostringstream interface)
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result
#define EXPECT_LE (   LEFT,
  ... 
)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_LE_HELPER(__FILE__, __LINE__, LEFT, __VA_ARGS__, std::string(), std::string()))

EXPECT_LE(LEFT, RIGHT, MESSAGE) indicate about failure if LEFT is not less or equal RIGHT(using: !(LEFT <= RIGHT))

To failure information is included:

  • file location
  • line number
  • LEFT and RIGHT stringified expression,
  • LEFT and RIGHT value if convertiable to string (by std::ostringstream interface)
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result
#define EXPECT_LT (   LEFT,
  ... 
)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_LT_HELPER(__FILE__, __LINE__, LEFT, __VA_ARGS__, std::string(), std::string()))

EXPECT_LT(LEFT, RIGHT, MESSAGE) indicate about failure if LEFT is not less than RIGHT(using: !(LEFT < RIGHT))

To failure information is included:

  • file location
  • line number
  • LEFT and RIGHT stringified expression,
  • LEFT and RIGHT value if convertiable to string (by std::ostringstream interface)
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result
#define EXPECT_NE (   LEFT,
  ... 
)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_NE_HELPER(__FILE__, __LINE__, LEFT, __VA_ARGS__, std::string(), std::string()))

EXPECT_NE(LEFT, RIGHT, MESSAGE) indicate about failure if LEFT and RIGHT are equal(using: !(LEFT != RIGHT))

To failure information is included:

  • file location
  • line number
  • LEFT and RIGHT stringified expression,
  • LEFT and RIGHT value if convertiable to string (by std::ostringstream interface)
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result
#define EXPECT_NEAR (   LEFT,
  RIGHT,
  ... 
)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_NEAR_HELPER(__FILE__, __LINE__, LEFT, RIGHT, __VA_ARGS__, std::string(), std::string()))

EXPECT_NEAR(LEFT, RIGHT, PRECISION, MESSAGE) indicate about failure if LEFT and RIGHT are not very close.

To failure information is included:

  • file location
  • line number
  • LEFT and RIGHT stringified expression,
  • LEFT and RIGHT value if convertiable to string (by std::ostringstream interface)
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result
#define EXPECT_THROW (   TYPE,
  ... 
)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_THROW_HELPER(__FILE__, __LINE__, TYPE, __VA_ARGS__, std::string(), std::string()))

EXPECT_THROW(TYPE, INVOKE, MESSAGE) indicate about if any exception will be not thrown from INVOKE or thrown exception type is not equal to expected type.

To failure information is included:

  • file location
  • line number
  • TYPE and INVOKE stringified expression,
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
check result
#define EXPECT_TRUE (   ...)
Value:
RILI_EXPECT_VA_ARGS_MACRO_EXPAND( \
RILI_EXPECT_TRUE_HELPER(__FILE__, __LINE__, __VA_ARGS__, std::string(), std::string()))

EXPECT_TRUE(EXPR, MESSAGE) indicate about failure if EXPR is true(using: !(EXPR == true))

To failure information is included:

  • file location
  • line number
  • EXPR stringified expression,
  • EXPR value
  • optional message
Note
message parameter is optional - if not provided empty will be used
Returns
comparation result