Macros
expect_throws_message.h File Reference
#include <regex>
#include <string>
Include dependency graph for expect_throws_message.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FCL_ASSERT_THROWS_MESSAGE(expression, exception, regexp)
 
#define FCL_ASSERT_THROWS_MESSAGE_IF_DEBUG(expression, exception, regexp)   FCL_ASSERT_THROWS_MESSAGE(expression, exception, regexp)
 
#define FCL_EXPECT_THROWS_MESSAGE(expression, exception, regexp)
 
#define FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, must_throw, fatal_failure)
 
#define FCL_EXPECT_THROWS_MESSAGE_IF_DEBUG(expression, exception, regexp)   FCL_EXPECT_THROWS_MESSAGE(expression, exception, regexp)
 

Macro Definition Documentation

◆ FCL_ASSERT_THROWS_MESSAGE

#define FCL_ASSERT_THROWS_MESSAGE (   expression,
  exception,
  regexp 
)
Value:
FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, \
true /*must_throw*/, true /*fatal*/)

Definition at line 115 of file expect_throws_message.h.

◆ FCL_ASSERT_THROWS_MESSAGE_IF_DEBUG

#define FCL_ASSERT_THROWS_MESSAGE_IF_DEBUG (   expression,
  exception,
  regexp 
)    FCL_ASSERT_THROWS_MESSAGE(expression, exception, regexp)

Definition at line 136 of file expect_throws_message.h.

◆ FCL_EXPECT_THROWS_MESSAGE

#define FCL_EXPECT_THROWS_MESSAGE (   expression,
  exception,
  regexp 
)
Value:
FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, \
true /*must_throw*/, false /*non-fatal*/)

Definition at line 111 of file expect_throws_message.h.

◆ FCL_EXPECT_THROWS_MESSAGE_HELPER

#define FCL_EXPECT_THROWS_MESSAGE_HELPER (   expression,
  exception,
  regexp,
  must_throw,
  fatal_failure 
)
Value:
try { \
expression; \
if (must_throw) { \
if (fatal_failure) { \
GTEST_FATAL_FAILURE_("\t" #expression " failed to throw " #exception); \
} else { \
GTEST_NONFATAL_FAILURE_("\t" #expression " failed to throw " #exception);\
} \
} \
} catch (const exception& err) { \
auto matcher = [](const char* s, const std::string& re) { \
return std::regex_match(s, std::regex(re)); }; \
if (fatal_failure) { \
ASSERT_PRED2(matcher, err.what(), regexp); \
} else { \
EXPECT_PRED2(matcher, err.what(), regexp); \
} \
}

Definition at line 90 of file expect_throws_message.h.

◆ FCL_EXPECT_THROWS_MESSAGE_IF_DEBUG

#define FCL_EXPECT_THROWS_MESSAGE_IF_DEBUG (   expression,
  exception,
  regexp 
)    FCL_EXPECT_THROWS_MESSAGE(expression, exception, regexp)

Definition at line 133 of file expect_throws_message.h.

FCL_EXPECT_THROWS_MESSAGE_HELPER
#define FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, must_throw, fatal_failure)
Definition: expect_throws_message.h:90


fcl
Author(s):
autogenerated on Tue Dec 5 2023 03:40:49