aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-02 15:36:24 -0700
committerChristian Cunningham <cc@localhost>2022-03-02 15:36:24 -0700
commit4c74418b1d97b2e9f7daeea365d5018db199fca7 (patch)
treecf3c2672343c6dd75e316003d2cf4242a30c3d40 /src/tests
parentc31227d9046c3ab853255f89358966fe0721e957 (diff)
Ensure one test is added
Mount and export make
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/src/tests/test.c b/src/tests/test.c
index bb1bf31..7f18627 100644
--- a/src/tests/test.c
+++ b/src/tests/test.c
@@ -1,5 +1,5 @@
#include <cpu.h>
-#include <drivers/uart.h>
+//#include <drivers/uart.h>
#include <graphics/lfb.h>
#include <lib/kmem.h>
#include <sys/core.h>
@@ -10,17 +10,20 @@
extern void atest(void);
void btest(void);
+static int x = 0;
+static int y = 13;
void test_entry(void)
{
- draw_string(0, 18, "Starting tests");
+ x = 0;
+ draw_string(0, y+4, "Starting tests");
unsigned long long ti, tf, dt=0;
for(int i = 0; i < 64; i++) {
sys0_64(SYS_TIME, &ti);
sys0_64(SYS_TIME, &tf);
dt += tf - ti;
}
- DRAW64(0, 19, dt/64);
- DRAW64(17, 19, dt%64);
+ DRAW64(0, y+5, dt/64);
+ DRAW64(17, y+5, dt%64);
// atest
add_thread(atest, 0, 0);
@@ -28,8 +31,8 @@ void test_entry(void)
sys0(SYS_YIELD);
sys0_64(SYS_TIME, &tf);
dt = tf - ti;
- DRAW64(34, 19, dt/64);
- DRAW64(34+17, 19, dt%64);
+ DRAW64(34, y+5, dt/64);
+ DRAW64(34+17, y+5, dt%64);
add_thread(btest, 0, 4);
}
@@ -43,37 +46,49 @@ void ctest4(void);
void ctest1(void)
{
- uart_string("1 Started\n");
- uart_string("1 Locking\n");
+ draw_cletter(x++, y+2, 'S', 0xFF0000);
+ //uart_string("1 Started\n");
+ draw_cletter(x++, y+2, 'L', 0xFF0000);
+ //uart_string("1 Locking\n");
lock(&testm);
add_thread(ctest3, 0, 2);
- uart_string("1 Unlocking\n");
+ draw_cletter(x++, y+2, 'U', 0xFF0000);
+ //uart_string("1 Unlocking\n");
unlock(&testm);
- uart_string("1 Finished\n");
+ draw_cletter(x++, y+2, 'F', 0xFF0000);
+ //uart_string("1 Finished\n");
}
void ctest2(void)
{
- uart_string("2 Started\n");
+ draw_cletter(x++, y+0, 'S', 0x0000FF);
+ //uart_string("2 Started\n");
add_thread(ctest4, 0, 3);
- uart_string("2 Locking\n");
+ draw_cletter(x++, y+0, 'L', 0x0000FF);
+ //uart_string("2 Locking\n");
lock(&testm);
- uart_string("2 Unlocking\n");
+ draw_cletter(x++, y+0, 'U', 0x0000FF);
+ //uart_string("2 Unlocking\n");
unlock(&testm);
- uart_string("2 Finished\n");
+ draw_cletter(x++, y+0, 'F', 0x0000FF);
+ //uart_string("2 Finished\n");
}
void ctest3(void)
{
- uart_string("3 Started\n");
+ draw_cletter(x++, y+1, 'S', 0x00FF00);
+ //uart_string("3 Started\n");
add_thread(ctest2, 0, 1);
- uart_string("3 Finished\n");
+ draw_cletter(x++, y+1, 'F', 0x00FF00);
+ //uart_string("3 Finished\n");
}
void ctest4(void)
{
- uart_string("4 Started\n");
- uart_string("4 Finished\n");
+ draw_cletter(x++, y+2, 'S', 0xAFAF00);
+ //uart_string("4 Started\n");
+ draw_cletter(x++, y+2, 'F', 0xAFAF00);
+ //uart_string("4 Finished\n");
}
void btest(void)