aboutsummaryrefslogtreecommitdiff
path: root/kernel/test.c
diff options
context:
space:
mode:
authorMarvin Borner2020-08-31 23:09:35 +0200
committerMarvin Borner2020-08-31 23:09:35 +0200
commitd79b7492910d4a77b8c3a70f28c5ea4c81a0b2e5 (patch)
tree3e7c6c864d984e1f0fc2533f4d4202833b6625a7 /kernel/test.c
parent00adfffc296476f3fe247ce3f341c9f5addd190d (diff)
Abstracted tests from boot process
Diffstat (limited to 'kernel/test.c')
-rw-r--r--kernel/test.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/kernel/test.c b/kernel/test.c
index 6a69cb6..1960a5a 100644
--- a/kernel/test.c
+++ b/kernel/test.c
@@ -35,22 +35,18 @@ void test_math()
void test_conv()
{
- char buf0[3] = { 0 };
- char buf1[3] = { 0 };
- char buf2[1] = { 0 };
- char buf3[7] = { 0 };
- char buf4[5] = { 0 };
- char buf5[2] = { 0 };
- strcpy(buf0, "42");
- strcpy(buf1, "42");
- equals(atoi(buf0), 42);
+ char buf1[1] = { 0 };
+ char buf2[7] = { 0 };
+ char buf3[5] = { 0 };
+ char buf4[3] = { 0 };
+ equals(atoi("42"), 42);
equals_str(htoa(0x42), "42");
- equals(htoi(buf1), 0x42);
+ equals(htoi("42"), 0x42);
equals_str(itoa(42), "42");
- equals_str(conv_base(42, buf2, 0, 0), "");
- equals_str(conv_base(42, buf3, 2, 0), "101010");
- equals_str(conv_base(424242, buf4, 36, 0), "93ci");
- equals_str(conv_base(0xffffffff, buf5, 10, 1), "-1");
+ equals_str(conv_base(42, buf1, 0, 0), "");
+ equals_str(conv_base(42, buf2, 2, 0), "101010");
+ equals_str(conv_base(424242, buf3, 36, 0), "93ci");
+ equals_str(conv_base(0xffffffff, buf4, 10, 1), "-1");
}
void test_mem()
@@ -73,6 +69,7 @@ void test_mem()
equals_str(memset(buf2, 'x', 5), "xxxxx");
}
+// TODO: Move to other file (top!)
void test_all(struct vid_info *vid_info)
{
// Serial connection