summaryrefslogtreecommitdiffstats
path: root/tests/tests.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests.h')
-rw-r--r--tests/tests.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/tests.h b/tests/tests.h
index 351badb..19b7f5e 100644
--- a/tests/tests.h
+++ b/tests/tests.h
@@ -8,8 +8,8 @@
#ifndef BFS_TESTS_H
#define BFS_TESTS_H
-#include "../src/config.h"
-#include "../src/diag.h"
+#include "prelude.h"
+#include "diag.h"
/** Unit test function type. */
typedef bool test_fn(void);
@@ -26,6 +26,9 @@ bool check_bit(void);
/** I/O queue tests. */
bool check_ioq(void);
+/** Signal hook tests. */
+bool check_sighook(void);
+
/** Trie tests. */
bool check_trie(void);
@@ -54,20 +57,17 @@ static inline bool bfs_check(bool ret) {
: "Check failed: `%s`%s", \
str, __VA_ARGS__), false))
-/** Get a string description of the last error. */
-const char *bfs_errstr(void);
-
/**
* Check a condition, logging the current error string on failure.
*/
-#define bfs_pcheck(...) \
- bfs_pcheck_(#__VA_ARGS__, __VA_ARGS__, "", "")
+#define bfs_echeck(...) \
+ bfs_echeck_(#__VA_ARGS__, __VA_ARGS__, "", bfs_errstr())
-#define bfs_pcheck_(str, cond, format, ...) \
+#define bfs_echeck_(str, cond, format, ...) \
((cond) ? true : (bfs_diag( \
sizeof(format) > 1 \
- ? "%.0s" format "%s%s: %s" \
- : "Check failed: `%s`%s: %s", \
- str, __VA_ARGS__, bfs_errstr()), false))
+ ? "%.0s" format "%s: %s" \
+ : "Check failed: `%s`: %s", \
+ str, __VA_ARGS__), false))
#endif // BFS_TESTS_H