MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / TEST_F

Function TEST_F

tests/unit_test/vfs_test.cpp:111–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109// 测试挂载表
110class MountTableTest : public BaseEnvTest {};
111TEST_F(MountTableTest, MountAndUnmount) {
112 MountTable mount_table;
113 MockFs mock_fs;
114
115 // 测试挂载
116 auto mount_result = mount_table.Mount("/", &mock_fs, nullptr);
117 EXPECT_TRUE(mount_result.has_value());
118 EXPECT_TRUE(mock_fs.mount_called);
119
120 // 测试重复挂载
121 mount_result = mount_table.Mount("/", &mock_fs, nullptr);
122 EXPECT_FALSE(mount_result.has_value());
123
124 // 测试卸载
125 auto unmount_result = mount_table.Unmount("/");
126 (void)unmount_result;
127 EXPECT_TRUE(unmount_result.has_value());
128 EXPECT_TRUE(mock_fs.unmount_called);
129
130 // 测试卸载未挂载的路径
131 unmount_result = mount_table.Unmount("/mnt");
132 EXPECT_FALSE(unmount_result.has_value());
133}
134
135TEST_F(MountTableTest, LookupMountPoint) {
136 MountTable mount_table;

Callers

nothing calls this directly

Calls 11

GetMountTableFunction · 0.85
LookupFunction · 0.85
InitFunction · 0.85
AllocMethod · 0.80
DupMethod · 0.80
SetupStandardFilesMethod · 0.80
MountMethod · 0.45
UnmountMethod · 0.45
LookupMethod · 0.45
GetMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected