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

Function test_logical_sectors

tests/layout.cc:69–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69static void test_logical_sectors()
70{
71 globalConfig().clear();
72 globalConfig().readBaseConfig(R"M(
73 drive {
74 drive_type: DRIVETYPE_80TRACK
75 }
76
77 layout {
78 format_type: FORMATTYPE_80TRACK
79 tracks: 78
80 sides: 2
81 layoutdata {
82 sector_size: 256
83 physical {
84 sector: 0
85 sector: 1
86 sector: 2
87 sector: 3
88 }
89 filesystem {
90 sector: 0
91 sector: 2
92 sector: 1
93 sector: 3
94 }
95 }
96 }
97 )M");
98
99 auto diskLayout = createDiskLayout();
100 auto physicalLayout = diskLayout->layoutByPhysicalLocation.at({0, 0});
101 auto layout = physicalLayout->logicalTrackLayout;
102 AssertThat(diskLayout->layoutByLogicalLocation.at({0, 0}), Equals(layout));
103 AssertThat(
104 layout->naturalSectorOrder, Equals(std::vector<unsigned>{0, 1, 2, 3}));
105 AssertThat(
106 layout->diskSectorOrder, Equals(std::vector<unsigned>{0, 1, 2, 3}));
107 AssertThat(layout->filesystemSectorOrder,
108 Equals(std::vector<unsigned>{0, 2, 1, 3}));
109}
110
111static void test_both_sectors()
112{

Callers 1

mainFunction · 0.85

Calls 3

createDiskLayoutFunction · 0.85
readBaseConfigMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected