diff options
Diffstat (limited to 'tests/tests.h')
-rw-r--r-- | tests/tests.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/tests.h b/tests/tests.h index 9078938..2958fe1 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -9,6 +9,7 @@ #define BFS_TESTS_H #include "prelude.h" +#include "bfstd.h" #include "diag.h" /** Unit test function type. */ @@ -26,6 +27,12 @@ bool check_bit(void); /** I/O queue tests. */ bool check_ioq(void); +/** Linked list tests. */ +bool check_list(void); + +/** Signal hook tests. */ +bool check_sighook(void); + /** Trie tests. */ bool check_trie(void); @@ -54,20 +61,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__, "", 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 |