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

Function testPutMetadata

tests/cpmfs.cc:290–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290static void testPutMetadata()
291{
292 auto sectors = std::make_shared<TestSectorInterface>();
293 auto fs = Filesystem::createCpmFsFilesystem(
294 globalConfig()->filesystem(), sectors);
295 fs->create(true, "volume");
296
297 fs->putFile(Path("0:FILE1"), Bytes{0x55} * 0x9000);
298 fs->putFile(Path("0:FILE2"), Bytes{5, 6, 7, 8});
299
300 fs->putMetadata(Path("0:FILE1"),
301 std::map<std::string, std::string>{
302 {"mode", "SRA"}
303 });
304
305 auto directory = getBlock(sectors, 0, 256).slice(0, 32 * 3);
306 AssertThat(directory,
307 Equals(createDirent("FILE1 \xa0\xa0\xa0",
308 0,
309 0x80,
310 {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}) +
311 createDirent("FILE1 \xa0\xa0\xa0", 2, 0x20, {17, 18}) +
312 createDirent("FILE2", 0, 1, {19})));
313}
314
315#endif
316int main(void)

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

Tested by

no test coverage detected