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

Function testDelete

tests/cpmfs.cc:251–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251static void testDelete()
252{
253 auto sectors = std::make_shared<TestSectorInterface>();
254 auto fs = Filesystem::createCpmFsFilesystem(
255 globalConfig()->filesystem(), sectors);
256 fs->create(true, "volume");
257
258 fs->putFile(Path("0:FILE1"), Bytes{1, 2, 3, 4});
259 fs->putFile(Path("0:FILE2"), Bytes{5, 6, 7, 8});
260 fs->deleteFile(Path("0:FILE1"));
261
262 auto directory = getBlock(sectors, 0, 256).slice(0, 64);
263 AssertThat(directory,
264 Equals((Bytes{0xe5} * 32) + createDirent("FILE2", 0, 1, {2})));
265}
266
267static void testMove()
268{

Callers 1

mainFunction · 0.85

Calls 7

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

Tested by

no test coverage detected