summaryrefslogtreecommitdiff
path: root/tests/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils.h')
-rw-r--r--tests/utils.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/utils.h b/tests/utils.h
index 213f5834c1..c8efe49b3a 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -63,6 +63,13 @@ extern void fail_ignore(const char *format, ...)
extern void success(const char *format, ...)
__attribute__ ((format(printf, 1, 2)));
+/* assumes test_name is defined */
+#define test_fail(fmt, ...) \
+ fail("%s: "fmt, test_name, ##__VA_ARGS__)
+
+#define test_success(fmt, ...) \
+ success("%s: "fmt, test_name, ##__VA_ARGS__)
+
extern void c_print(const unsigned char *str, size_t len);
extern void escapeprint(const char *str, size_t len);
extern void hexprint(const void *str, size_t len);