| 265 | } |
| 266 | |
| 267 | static 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 | |
| 290 | static void testPutMetadata() |
| 291 | { |