From bbb7e4c4515bcf0e81c931406fdf398356280bd3 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 15 Oct 2021 19:11:12 +0200 Subject: init/tests: remove test_fs, as it doesn't even test anything --- src/init/tests/main.c | 35 ----------------------------------- src/init/tests/main.h | 1 - 2 files changed, 36 deletions(-) (limited to 'src/init/tests') 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); -- cgit v1.2.3