Go to the documentation of this file.
38 #ifndef FCL_EXPECT_THROWS_MESSAGE_H
39 #define FCL_EXPECT_THROWS_MESSAGE_H
44 #ifdef FCL_DOXYGEN_CXX
68 #define FCL_EXPECT_THROWS_MESSAGE(expression, exception, regexp)
72 #define FCL_ASSERT_THROWS_MESSAGE(expression, exception, regexp)
79 #define FCL_EXPECT_THROWS_MESSAGE_IF_ARMED(expression, exception, regexp)
86 #define FCL_ASSERT_THROWS_MESSAGE_IF_ARMED(expression, exception, regexp)
88 #else // FCL_DOXYGEN_CXX
90 #define FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, \
91 must_throw, fatal_failure) \
95 if (fatal_failure) { \
96 GTEST_FATAL_FAILURE_("\t" #expression " failed to throw " #exception); \
98 GTEST_NONFATAL_FAILURE_("\t" #expression " failed to throw " #exception);\
101 } catch (const exception& err) { \
102 auto matcher = [](const char* s, const std::string& re) { \
103 return std::regex_match(s, std::regex(re)); }; \
104 if (fatal_failure) { \
105 ASSERT_PRED2(matcher, err.what(), regexp); \
107 EXPECT_PRED2(matcher, err.what(), regexp); \
111 #define FCL_EXPECT_THROWS_MESSAGE(expression, exception, regexp) \
112 FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, \
115 #define FCL_ASSERT_THROWS_MESSAGE(expression, exception, regexp) \
116 FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, \
122 #define FCL_EXPECT_THROWS_MESSAGE_IF_DEBUG(expression, exception, regexp) \
123 FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, \
126 #define FCL_ASSERT_THROWS_MESSAGE_IF_DEBUG(expression, exception, regexp) \
127 FCL_EXPECT_THROWS_MESSAGE_HELPER(expression, exception, regexp, \
133 #define FCL_EXPECT_THROWS_MESSAGE_IF_DEBUG(expression, exception, regexp) \
134 FCL_EXPECT_THROWS_MESSAGE(expression, exception, regexp)
136 #define FCL_ASSERT_THROWS_MESSAGE_IF_DEBUG(expression, exception, regexp) \
137 FCL_ASSERT_THROWS_MESSAGE(expression, exception, regexp)
141 #endif // FCL_DOXYGEN_CXX
143 #endif // FCL_EXPECT_THROWS_MESSAGE_H
fcl
Author(s):
autogenerated on Tue Dec 5 2023 03:40:48