MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / testLogicalExtents

Function testLogicalExtents

tests/cpmfs.cc:155–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155static void testLogicalExtents()
156{
157 auto sectors = std::make_shared<TestSectorInterface>();
158 auto fs = Filesystem::createCpmFsFilesystem(
159 globalConfig()->filesystem(), diskLayout, sectors);
160
161 setBlock(sectors,
162 0,
163 createDirent("FILE", 1, 128, {1, 0, 0, 0, 0, 0, 0, 0, 2}) +
164 createDirent("FILE", 2, 128, {3}) + (blank_dirent * 62));
165 setBlock(sectors, 1, {1});
166 setBlock(sectors, 2, {2});
167 setBlock(sectors, 3, {3});
168
169 auto files = fs->list(Path());
170 AssertThat(files.size(), Equals(1));
171
172 auto data = fs->getFile(Path("0:FILE"));
173 AssertThat(data.size(), Equals(0x4000 * 3));
174 AssertThat(data[0x4000 * 0], Equals(1));
175 AssertThat(data[0x4000 * 1], Equals(2));
176 AssertThat(data[0x4000 * 2], Equals(3));
177}
178
179static void testBitmap()
180{

Callers 1

mainFunction · 0.85

Calls 6

setBlockFunction · 0.85
createDirentFunction · 0.85
PathClass · 0.50
listMethod · 0.45
sizeMethod · 0.45
getFileMethod · 0.45

Tested by

no test coverage detected