summaryrefslogtreecommitdiff
path: root/include/test.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/test.h')
-rw-r--r--include/test.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/test.h b/include/test.h
index 92d1314e..012ffc51 100644
--- a/include/test.h
+++ b/include/test.h
@@ -213,6 +213,20 @@ extern int debug;
} \
})
+#define assert_negative_goto(a, label, fmt, ...) \
+ ({ \
+ int rc_ = assert_negative_as_expr(a, -1, fmt, ##__VA_ARGS__); \
+ if (rc_ != 0) \
+ goto label; \
+ })
+
+#define assert_positive_goto(a, label, fmt, ...) \
+ ({ \
+ int rc_ = assert_positive_as_expr(a, -1, fmt, ##__VA_ARGS__); \
+ if (rc_ != 0) \
+ goto label; \
+ })
+
#define test(x, ...) \
({ \
int rc; \