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

Function testPutBigFile

tests/cpmfs.cc:228–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228static void testPutBigFile()
229{
230 auto sectors = std::make_shared<TestSectorInterface>();
231 auto fs = Filesystem::createCpmFsFilesystem(
232 globalConfig()->filesystem(), sectors);
233 fs->create(true, "volume");
234
235 Bytes filedata;
236 ByteWriter bw(filedata);
237 while (filedata.size() < 0x9000)
238 bw.write_le32(bw.pos);
239
240 fs->putFile(Path("0:BIGFILE"), filedata);
241
242 auto directory = getBlock(sectors, 0, 256).slice(0, 64);
243 AssertThat(directory,
244 Equals(createDirent("BIGFILE",
245 0,
246 0x80,
247 {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}) +
248 createDirent("BIGFILE", 2, 0x20, {17, 18})));
249}
250
251static void testDelete()
252{

Callers 1

mainFunction · 0.85

Calls 7

getBlockFunction · 0.85
createDirentFunction · 0.85
sliceMethod · 0.80
PathClass · 0.50
createMethod · 0.45
sizeMethod · 0.45
putFileMethod · 0.45

Tested by

no test coverage detected