mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:34:57 +00:00
Tests/Kernel: Add test for /dev/loop directory structure
This commit is contained in:
parent
d14a0a454a
commit
e14c571916
1 changed files with 25 additions and 0 deletions
|
@ -68,6 +68,31 @@ TEST_CASE(test_devpts_root_directory)
|
|||
EXPECT_EQ(_dirent->d_type, DT_DIR);
|
||||
}
|
||||
|
||||
TEST_CASE(test_devloop_root_directory)
|
||||
{
|
||||
auto dirfd = open("/dev/loop/", O_RDONLY | O_DIRECTORY);
|
||||
auto cleanup_guard = ScopeGuard([&] {
|
||||
close(dirfd);
|
||||
});
|
||||
|
||||
DIR* dir = fdopendir(dirfd);
|
||||
EXPECT(dir != nullptr);
|
||||
|
||||
auto cleanup_dir_guard = ScopeGuard([&] {
|
||||
closedir(dir);
|
||||
});
|
||||
|
||||
auto* _dirent = readdir(dir);
|
||||
EXPECT(_dirent != nullptr);
|
||||
// NOTE: We should see '.'
|
||||
EXPECT_EQ(_dirent->d_type, DT_DIR);
|
||||
|
||||
_dirent = readdir(dir);
|
||||
EXPECT(_dirent != nullptr);
|
||||
// NOTE: We should see '..'
|
||||
EXPECT_EQ(_dirent->d_type, DT_DIR);
|
||||
}
|
||||
|
||||
TEST_CASE(test_procfs_root_directory)
|
||||
{
|
||||
auto dirfd = open("/proc/", O_RDONLY | O_DIRECTORY);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue