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

Function test_skew

tests/layout.cc:153–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153static void test_skew()
154{
155 globalConfig().clear();
156 globalConfig().readBaseConfig(R"M(
157 drive {
158 drive_type: DRIVETYPE_80TRACK
159 }
160
161 layout {
162 format_type: FORMATTYPE_80TRACK
163 tracks: 78
164 sides: 2
165 layoutdata {
166 sector_size: 256
167 physical {
168 start_sector: 0
169 count: 12
170 skew: 6
171 }
172 }
173 }
174 )M");
175
176 auto diskLayout = createDiskLayout();
177 auto physicalLayout = diskLayout->layoutByPhysicalLocation.at({0, 0});
178 auto layout = physicalLayout->logicalTrackLayout;
179 AssertThat(layout->naturalSectorOrder,
180 Equals(std::vector<unsigned>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}));
181 AssertThat(layout->diskSectorOrder,
182 Equals(std::vector<unsigned>{0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11}));
183}
184
185static void test_bounds()
186{

Callers 1

mainFunction · 0.85

Calls 3

createDiskLayoutFunction · 0.85
readBaseConfigMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected