| 197 | #if 0 |
| 198 | |
| 199 | static void testPutGet() |
| 200 | { |
| 201 | auto sectors = std::make_shared<TestSectorInterface>(); |
| 202 | auto fs = Filesystem::createCpmFsFilesystem( |
| 203 | globalConfig()->filesystem(), sectors); |
| 204 | fs->create(true, "volume"); |
| 205 | |
| 206 | fs->putFile(Path("0:FILE1"), Bytes{1, 2, 3, 4}); |
| 207 | fs->putFile(Path("0:FILE2"), Bytes{5, 6, 7, 8}); |
| 208 | |
| 209 | dynamic_cast<HasMount*>(fs.get())->mount(); |
| 210 | std::vector<bool> bitmap = |
| 211 | dynamic_cast<HasBitmap*>(fs.get())->getBitmapForDebugging(); |
| 212 | AssertThat(bitmap, |
| 213 | Equals(std::vector<bool>{ |
| 214 | 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})); |
| 215 | |
| 216 | auto directory = getBlock(sectors, 0, 256).slice(0, 64); |
| 217 | AssertThat(directory, |
| 218 | Equals(createDirent("FILE1", 0, 1, {1}) + |
| 219 | createDirent("FILE2", 0, 1, {2}))); |
| 220 | |
| 221 | auto file1 = getBlock(sectors, 1, 8).slice(0, 8); |
| 222 | AssertThat(file1, Equals(Bytes{1, 2, 3, 4, 0, 0, 0, 0})); |
| 223 | |
| 224 | auto file2 = getBlock(sectors, 2, 8).slice(0, 8); |
| 225 | AssertThat(file2, Equals(Bytes{5, 6, 7, 8, 0, 0, 0, 0})); |
| 226 | } |
| 227 | |
| 228 | static void testPutBigFile() |
| 229 | { |
no test coverage detected