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

Function test_physical_sectors

tests/layout.cc:33–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33static void test_physical_sectors()
34{
35 globalConfig().clear();
36 globalConfig().readBaseConfig(R"M(
37 drive {
38 drive_type: DRIVETYPE_80TRACK
39 }
40
41 layout {
42 format_type: FORMATTYPE_80TRACK
43 tracks: 78
44 sides: 2
45 layoutdata {
46 sector_size: 256
47 physical {
48 sector: 0
49 sector: 2
50 sector: 1
51 sector: 3
52 }
53 }
54 }
55 )M");
56
57 auto diskLayout = createDiskLayout();
58 auto physicalLayout = diskLayout->layoutByPhysicalLocation.at({0, 0});
59 auto layout = physicalLayout->logicalTrackLayout;
60 AssertThat(diskLayout->layoutByLogicalLocation.at({0, 0}), Equals(layout));
61 AssertThat(
62 layout->naturalSectorOrder, Equals(std::vector<unsigned>{0, 1, 2, 3}));
63 AssertThat(
64 layout->diskSectorOrder, Equals(std::vector<unsigned>{0, 2, 1, 3}));
65 AssertThat(layout->filesystemSectorOrder,
66 Equals(std::vector<unsigned>{0, 1, 2, 3}));
67}
68
69static void test_logical_sectors()
70{

Callers 1

mainFunction · 0.85

Calls 3

createDiskLayoutFunction · 0.85
readBaseConfigMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected