summaryrefslogtreecommitdiffstats
path: root/tests/main.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-03-27 11:20:20 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-03-27 13:13:23 -0400
commit25769288f62816d733004c9e8347c35dd0e4ce2a (patch)
tree9f4face40989e824c24cea08e02bd01c384d1778 /tests/main.c
parent0ad5c7edda2de25e47077d138d7c371f94590a22 (diff)
downloadbfs-25769288f62816d733004c9e8347c35dd0e4ce2a.tar.xz
tests: New bfs_pcheck() macro to report xstrerror(errno)
Diffstat (limited to 'tests/main.c')
-rw-r--r--tests/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/main.c b/tests/main.c
index 8849e8c..7dec320 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -6,8 +6,10 @@
*/
#include "tests.h"
+#include "../src/bfstd.h"
#include "../src/color.h"
#include "../src/config.h"
+#include <errno.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
@@ -88,6 +90,10 @@ static void run_test(struct test_ctx *ctx, const char *test, test_fn *fn) {
}
}
+const char *bfs_errstr(void) {
+ return xstrerror(errno);
+}
+
int main(int argc, char *argv[]) {
// Try to set a UTF-8 locale
if (!setlocale(LC_ALL, "C.UTF-8")) {