diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/src/main.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/kernel/src/main.cpp b/kernel/src/main.cpp index 19a0992..4510240 100644 --- a/kernel/src/main.cpp +++ b/kernel/src/main.cpp @@ -111,16 +111,32 @@ auto test_file_lookup() -> void auto vfs = filesystem::vfs::get(); auto storage_mgmt = devices::storage::storage_management::get(); - vfs.open("/a/b/c"); - vfs.open("/a/d/e"); + auto ofd1 = vfs.open("/a/b/c"); + auto ofd2 = vfs.open("/dev/ram0"); + auto ofd3 = vfs.open("/a/d/e"); + if (!ofd1 || !ofd2 || !ofd3) + { + kstd::os::panic("test code failed"); + } + + if (auto ofd4 = vfs.open("/dev/xxx")) + { + kstd::os::panic("test code failed"); + } auto new_filesystem = kstd::make_shared<filesystem::ext2::ext2_filesystem>(); auto device = storage_mgmt.device_by_major_minor(1, 16); new_filesystem->mount(device); - vfs.do_mount("/a/b", new_filesystem); - vfs.open("/a/b/c"); + if (vfs.do_mount("/a/b", new_filesystem) != 0) + { + kstd::os::panic("test code failed"); + } + auto ofd5 = vfs.open("/a/b/c"); - vfs.open("x/y/z"); + if (auto ofd6 = vfs.open("x/y/z")) + { + kstd::os::panic("test code failed"); + } } auto run_test_code() -> void |
