X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fresult.hpp;h=0c78b9980f5469eb2a31ac235b796c36237fe180;hb=4e7c4a986b51441df4241e94ee39cabe17cd3709;hp=9e6bf2098a69101bf85299a5fb55d54b9183bdd8;hpb=858824dce02bade6464c404beef41da9321d58ef;p=awesomized%2Flibmemcached diff --git a/libtest/result.hpp b/libtest/result.hpp index 9e6bf209..0c78b998 100644 --- a/libtest/result.hpp +++ b/libtest/result.hpp @@ -44,7 +44,12 @@ #include #define _SUCCESS throw libtest::__success(LIBYATL_DEFAULT_PARAM) -#define SKIP throw libtest::__skipped(LIBYATL_DEFAULT_PARAM) + +#define SKIP(...) \ +do \ +{ \ + throw libtest::__skipped(LIBYATL_DEFAULT_PARAM, __VA_ARGS__); \ +} while (0) #define FAIL(...) \ do \ @@ -52,10 +57,26 @@ do \ throw libtest::__failure(LIBYATL_DEFAULT_PARAM, __VA_ARGS__); \ } while (0) -#define fatal_message(...) \ +#define FATAL(...) \ do \ { \ throw libtest::fatal(LIBYATL_DEFAULT_PARAM, __VA_ARGS__); \ } while (0) +#define FATAL_IF(__expression, ...) \ +do \ +{ \ + if ((__expression)) { \ + throw libtest::fatal(LIBYATL_DEFAULT_PARAM, (#__expression)); \ + } \ +} while (0) + +#define FATAL_IF_(__expression, ...) \ +do \ +{ \ + if ((__expression)) { \ + throw libtest::fatal(LIBYATL_DEFAULT_PARAM, __VA_ARGS__); \ + } \ +} while (0) + #define fatal_assert(__assert) if((__assert)) {} else { throw libtest::fatal(LIBYATL_DEFAULT_PARAM, #__assert); }