diff options
author | dzwdz | 2021-10-15 19:11:12 +0200 |
---|---|---|
committer | dzwdz | 2021-10-15 19:11:12 +0200 |
commit | bbb7e4c4515bcf0e81c931406fdf398356280bd3 (patch) | |
tree | 7b82df98cd6851d6bad45fc80c404aab0bddee1b /src/init/tests | |
parent | 4fca75ee901e5e8fdee0a8e12ebd18d51fff811f (diff) |
init/tests: remove test_fs, as it doesn't even test anything
Diffstat (limited to 'src/init/tests')
-rw-r--r-- | src/init/tests/main.c | 35 | ||||
-rw-r--r-- | src/init/tests/main.h | 1 |
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); |