summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authordzwdz2021-10-15 19:11:12 +0200
committerdzwdz2021-10-15 19:11:12 +0200
commitbbb7e4c4515bcf0e81c931406fdf398356280bd3 (patch)
tree7b82df98cd6851d6bad45fc80c404aab0bddee1b /src/init
parent4fca75ee901e5e8fdee0a8e12ebd18d51fff811f (diff)
init/tests: remove test_fs, as it doesn't even test anything
Diffstat (limited to 'src/init')
-rw-r--r--src/init/tests/main.c35
-rw-r--r--src/init/tests/main.h1
2 files changed, 0 insertions, 36 deletions
diff --git a/src/init/tests/main.c b/src/init/tests/main.c
index f759e33..48134d0 100644
--- a/src/init/tests/main.c
+++ b/src/init/tests/main.c
@@ -11,46 +11,11 @@ static void run_forked(void (*fn)()) {
} else _syscall_await();
}
-static void read_file(const char *path, size_t len) {
- int fd = _syscall_open(path, len);
- static char buf[64];
- int buf_len = 64;
-
- _syscall_write(__tty_fd, path, len, 0);
- printf(": ");
- if (fd < 0) {
- printf("couldn't open.\n");
- return;
- }
-
- buf_len = _syscall_read(fd, buf, buf_len, 0);
- _syscall_write(__tty_fd, buf, buf_len, 0);
-
- _syscall_close(fd);
-}
void test_all(void) {
- run_forked(test_fs);
run_forked(test_await);
}
-void test_fs(void) {
- // TODO this test is shit
- read_file(argify("/init/fake.txt"));
- read_file(argify("/init/1.txt"));
- read_file(argify("/init/2.txt"));
- read_file(argify("/init/dir/3.txt"));
-
- printf("\nshadowing /init/dir...\n");
- _syscall_mount(-1, argify("/init/dir"));
- read_file(argify("/init/fake.txt"));
- read_file(argify("/init/1.txt"));
- read_file(argify("/init/2.txt"));
- read_file(argify("/init/dir/3.txt"));
-
- printf("\n");
-}
-
void test_await(void) {
int ret;
diff --git a/src/init/tests/main.h b/src/init/tests/main.h
index 5525c64..4899bd5 100644
--- a/src/init/tests/main.h
+++ b/src/init/tests/main.h
@@ -2,5 +2,4 @@
void test_all(void);
-void test_fs(void);
void test_await(void);