| 288 | } |
| 289 | |
| 290 | static 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 |
| 316 | int main(void) |
no test coverage detected