} \
} while (0)
+#define ASSERT_ERROR(expr, e) \
+ do { \
+ int __r = expr; \
+ if (__r >= 0) { \
+ LOG_ERROR("Failed assertion: " #expr " unexpectedly didn't fail in %s:%d %s\n", \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ goto FAIL; \
+ } else if (e != -__r) { \
+ LOG_ERROR("Failed assertion: " #expr " failed with (%d - %s) " \
+ "but was expected to fail with (%d - %s) in %s:%d\n", \
+ errno, strerror(-__r), e, strerror(e), __FILE__, __LINE__); \
+ goto FAIL; \
+ } \
+ } while (0)
+
#define ASSERT_ERRNO(expr, e) \
do { \
if (!(expr)) { \