Skip to content
Snippets Groups Projects

F consolidation

Merged Timm Fitschen requested to merge f-consolidation into dev
1 file
+ 24
6
Compare changes
  • Side-by-side
  • Inline
@@ -29,20 +29,38 @@
* @author Timm Fitschen
* @date 2021-07-07
*/
#define EXPECT_THROW_MESSAGE(statement, exeption_type, message) \
#define EXPECT_THROW_MESSAGE(statement, exception_type, message) \
EXPECT_THROW( \
try { statement; } catch (const exeption_type &e) { \
try { statement; } catch (const exception_type &e) { \
EXPECT_EQ(std::string(e.what()), message); \
throw; \
}, \
exeption_type)
#define ASSERT_THROW_MESSAGE(statement, exeption_type, message) \
exception_type)
#define ASSERT_THROW_MESSAGE(statement, exception_type, message) \
ASSERT_THROW( \
try { statement; } catch (const exeption_type &e) { \
try { statement; } catch (const exception_type &e) { \
ASSERT_EQ(std::string(e.what()), message); \
throw; \
}, \
exeption_type)
exception_type)
#define EXPECT_THROW_STARTS_WITH(statement, exception_type, pattern) \
EXPECT_THROW( \
try { statement; } catch (const exception_type &e) { \
auto pat_s = std::string(pattern); \
EXPECT_EQ(std::string(e.what()).substr(0, pat_s.size()), \
pat_s); \
throw; \
}, \
exception_type)
#define ASSERT_THROW_STARTS_WITH(statement, exception_type, message) \
ASSERT_THROW( \
try { statement; } catch (const exception_type &e) { \
auto pat_s = std::string(pattern); \
ASSERT_EQ(std::string(e.what()).substr(0, pat_s.size()), \
pat_s); \
throw; \
}, \
exception_type)
#define EXPECT_NULL(statement) \
if (statement != nullptr) { \
FAIL() << "Should be a nullptr"; \
Loading