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

Function testBitmap

tests/cpmfs.cc:179–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179static void testBitmap()
180{
181 auto sectors = std::make_shared<TestSectorInterface>();
182 auto fs = Filesystem::createCpmFsFilesystem(
183 globalConfig()->filesystem(), diskLayout, sectors);
184
185 setBlock(sectors,
186 0,
187 createDirent("FILE", 1, 128, {1, 0, 0, 0, 0, 0, 0, 0, 2}) +
188 createDirent("FILE", 2, 128, {4}) + (blank_dirent * 62));
189
190 dynamic_cast<HasMount*>(fs.get())->mount();
191 std::vector<bool> bitmap =
192 dynamic_cast<HasBitmap*>(fs.get())->getBitmapForDebugging();
193 AssertThat(bitmap,
194 Equals(std::vector<bool>{
195 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}));
196}
197#if 0
198
199static void testPutGet()

Callers 1

mainFunction · 0.85

Calls 5

setBlockFunction · 0.85
createDirentFunction · 0.85
getBitmapForDebuggingMethod · 0.80
mountMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected