aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/inc')
-rw-r--r--kernel/inc/boot.h5
-rw-r--r--kernel/inc/test.h42
2 files changed, 47 insertions, 0 deletions
diff --git a/kernel/inc/boot.h b/kernel/inc/boot.h
index c1d9288..98e964d 100644
--- a/kernel/inc/boot.h
+++ b/kernel/inc/boot.h
@@ -1,6 +1,9 @@
// MIT License, Copyright (c) 2020 Marvin Borner
// This file specifies the structs passed by the bootloader
+#ifndef BOOT_H
+#define BOOT_H
+
#include <def.h>
struct vid_info *boot_passed;
@@ -8,3 +11,5 @@ struct vid_info {
u32 mode;
u32 *vbe;
};
+
+#endif
diff --git a/kernel/inc/test.h b/kernel/inc/test.h
new file mode 100644
index 0000000..6f2cdbb
--- /dev/null
+++ b/kernel/inc/test.h
@@ -0,0 +1,42 @@
+// MIT License, Copyright (c) 2020 Marvin Borner
+
+#ifndef TEST_H
+#define TEST_H
+
+#include <boot.h>
+#include <print.h>
+#include <str.h>
+
+#define a_mag 0x55
+#define b_mag 0x42
+
+#define check(exp) \
+ if ((exp)) { \
+ printf("\x1B[32m[PASS]\x1B[0m %s:%d: %s: Test '%s'\n", __FILE__, __LINE__, \
+ __func__, #exp); \
+ } else { \
+ printf("\x1B[31m[FAIL]\x1B[0m %s:%d: %s: Test '%s'\n", __FILE__, __LINE__, \
+ __func__, #exp); \
+ }
+
+#define equals(first, second) \
+ if ((first) == (second)) { \
+ printf("\x1B[32m[PASS]\x1B[0m %s:%d: %s: Test equality '%s'(%d) == '%s'(%d)\n", \
+ __FILE__, __LINE__, __func__, #first, (first), #second, (second)); \
+ } else { \
+ printf("\x1B[31m[FAIL]\x1B[0m %s:%d: %s: Test equality '%s'(%d) == '%s'(%d)\n", \
+ __FILE__, __LINE__, __func__, #first, (first), #second, (second)); \
+ }
+
+#define equals_str(first, second) \
+ if (strcmp((first), (second)) == 0) { \
+ printf("\x1B[32m[PASS]\x1B[0m %s:%d: %s: Test equality %s(%s) '%s'(%s)\n", \
+ __FILE__, __LINE__, __func__, #first, (first), #second, (second)); \
+ } else { \
+ printf("\x1B[31m[FAIL]\x1B[0m %s:%d: %s: Test equality %s(%s) '%s'(%s)\n", \
+ __FILE__, __LINE__, __func__, #first, (first), #second, (second)); \
+ }
+
+void test_all(struct vid_info *vid_info);
+
+#endif