diff options
Diffstat (limited to 'tests/tests.h')
-rw-r--r-- | tests/tests.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/tests.h b/tests/tests.h index d26a5a0..19b7f5e 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -57,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 |