diff options
author | Claudius 'keldu' Holeksa <mail@keldu.de> | 2024-08-14 10:19:32 +0200 |
---|---|---|
committer | Claudius 'keldu' Holeksa <mail@keldu.de> | 2024-08-14 10:19:32 +0200 |
commit | 2a442407538628b7b04c63c0643d521739de6b69 (patch) | |
tree | 5fa20a4786b868e81ad26d9ccd16ec62ba159d5a /modules/core | |
parent | fad5d37382552af7328dd67d038c1eaf44cf0aee (diff) |
Adding a macro for simpler test writing and wip on fs
Diffstat (limited to 'modules/core')
-rw-r--r-- | modules/core/c++/test/suite.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/core/c++/test/suite.hpp b/modules/core/c++/test/suite.hpp index 38a4716..88d741a 100644 --- a/modules/core/c++/test/suite.hpp +++ b/modules/core/c++/test/suite.hpp @@ -4,6 +4,7 @@ #include <memory> #include <stdexcept> #include <type_traits> +#include <sstream> #include "../common.hpp" @@ -41,3 +42,11 @@ public: auto msg = msg_split; \ throw std::runtime_error{std::string{msg}};\ } + +#define SAW_EOV_EXPECT(eov_expr, msg_split) \ + if( (eov_expr.is_error()) ){ \ + auto& err = eov_expr.get_error(); \ + std::stringstream sstr; \ + sstr<<msg_split<<" [Category] "<<err.get_category()<<" [Message] "<<err.get_message(); \ + throw std::runtime_error{sstr.str()}; \ + } |