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

Function test_sectoroffsets

tests/layout.cc:222–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222static void test_sectoroffsets()
223{
224 globalConfig().clear();
225 globalConfig().readBaseConfig(R"M(
226 drive {
227 drive_type: DRIVETYPE_80TRACK
228 }
229
230 layout {
231 format_type: FORMATTYPE_80TRACK
232 tracks: 2
233 sides: 2
234 layoutdata {
235 sector_size: 256
236 physical {
237 start_sector: 0
238 count: 4
239 }
240 filesystem {
241 start_sector: 0
242 count: 4
243 skew: 2
244 }
245 }
246 }
247 )M");
248
249 auto diskLayout = createDiskLayout();
250 AssertThat(diskLayout->groupSize, Equals(1));
251 AssertThat(diskLayout->logicalSectorLocationBySectorOffset,
252 EqualsContainer(
253 decltype(diskLayout->logicalSectorLocationBySectorOffset){
254 {0, {0, 0, 0}},
255 {256, {0, 0, 2}},
256 {512, {0, 0, 1}},
257 {768, {0, 0, 3}},
258 {1024, {0, 1, 0}},
259 {1280, {0, 1, 2}},
260 {1536, {0, 1, 1}},
261 {1792, {0, 1, 3}},
262 {2048, {1, 0, 0}},
263 {2304, {1, 0, 2}},
264 {2560, {1, 0, 1}},
265 {2816, {1, 0, 3}},
266 {3072, {1, 1, 0}},
267 {3328, {1, 1, 2}},
268 {3584, {1, 1, 1}},
269 {3840, {1, 1, 3}}
270 }));
271 AssertThat(diskLayout->sectorOffsetByLogicalSectorLocation,
272 EqualsContainer(
273 decltype(diskLayout->sectorOffsetByLogicalSectorLocation){
274 {{0, 0, 0}, 0 },
275 {{0, 0, 1}, 512 },
276 {{0, 0, 2}, 256 },
277 {{0, 0, 3}, 768 },
278 {{0, 1, 0}, 1024},
279 {{0, 1, 1}, 1536},

Callers 1

mainFunction · 0.85

Calls 3

createDiskLayoutFunction · 0.85
readBaseConfigMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected