See if we can clean up error reporting on one test for Ubuntu 12.04
[awesomized/libmemcached] / libtest / result.hpp
index 9e6bf2098a69101bf85299a5fb55d54b9183bdd8..0c78b9980f5469eb2a31ac235b796c36237fe180 100644 (file)
 #include <libtest/result/success.hpp>
 
 #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); }