aboutsummaryrefslogtreecommitdiff
path: root/test/test_framework.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_framework.c')
-rw-r--r--test/test_framework.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_framework.c b/test/test_framework.c
new file mode 100644
index 0000000..8cd53ac
--- /dev/null
+++ b/test/test_framework.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdatomic.h>
+#include "test_framework.h"
+
+
+extern atomic_flag test_framework_assertion_failed;
+
+
+void test_report_error(
+ const char *type, const char *condition, const char *fname, int lineno) {
+ printf("\x1B[31;1m%s:%d: Assertion failed:\n %s(%s)\x1B[0m\n",
+ fname, lineno, type, condition);
+ atomic_flag_test_and_set(&test_framework_assertion_failed);
+}