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

Function testMove

tests/cpmfs.cc:267–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267static void testMove()
268{
269 auto sectors = std::make_shared<TestSectorInterface>();
270 auto fs = Filesystem::createCpmFsFilesystem(
271 globalConfig()->filesystem(), sectors);
272 fs->create(true, "volume");
273
274 fs->putFile(Path("0:FILE1"), Bytes{0x55} * 0x9000);
275 fs->putFile(Path("0:FILE2"), Bytes{5, 6, 7, 8});
276
277 fs->moveFile(Path("0:FILE1"), Path("1:FILE3"));
278
279 auto directory = getBlock(sectors, 0, 256).slice(0, 32 * 3);
280 AssertThat(directory,
281 Equals(createDirent("FILE3",
282 0,
283 0x80,
284 {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16},
285 1) +
286 createDirent("FILE3", 2, 0x20, {17, 18}, 1) +
287 createDirent("FILE2", 0, 1, {19})));
288}
289
290static void testPutMetadata()
291{

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
moveFileMethod · 0.45

Tested by

no test coverage detected