summaryrefslogtreecommitdiff
path: root/src/user/app/init/tests/tests.h
diff options
context:
space:
mode:
authordzwdz2022-07-26 19:31:06 +0200
committerdzwdz2022-07-26 19:31:06 +0200
commita3e27d361919392eeb0086ed93b105d8301c7913 (patch)
tree91996a17172b650416bda82a472336b9d0edcdf0 /src/user/app/init/tests/tests.h
parent7a29c68ce0dc190cd6350746210441bc41d7da91 (diff)
user: move the POSIX-y stuff to the proper header files
Diffstat (limited to 'src/user/app/init/tests/tests.h')
-rw-r--r--src/user/app/init/tests/tests.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/user/app/init/tests/tests.h b/src/user/app/init/tests/tests.h
new file mode 100644
index 0000000..23ed1e3
--- /dev/null
+++ b/src/user/app/init/tests/tests.h
@@ -0,0 +1,20 @@
+#pragma once
+#include <camellia/syscalls.h>
+#include <stdio.h>
+
+void stress_all(void);
+void test_all(void);
+
+void test_pipe(void);
+void test_semaphore(void);
+
+#ifdef TEST_MACROS
+
+#define argify(str) str, sizeof(str) - 1
+#define test_fail() do { \
+ printf("\033[31m" "TEST FAILED: %s:%xh\n" "\033[0m", __func__, __LINE__); \
+ _syscall_exit(0); \
+} while (0)
+#define assert(cond) if (!(cond)) test_fail();
+
+#endif