f3probe unit test
- Vorherrschende Sprache
- C
- Sterne
- 3.4k
- Forks
- 177
- Ø Merge
- 2 T. 15 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
The "real limbo drive" unit test cases suggest an intention to detect wrapping by modulus other than a power of 2. However, the code `offset &= fdev->address_mask;` in `fdev_write_block()` that is used for the simulation of the fake drive and `fdev->address_mask = (((uint64_t)1) << wrap) - 1;` in `create_file_device()` suggests that only powers of 2 are supported. Furthermore, the code seems to use only the `wrap` variable, not `real_size_bytes`, to do the wrapping, effectively operating the test with a power of 2 wrapping, rendering it unable to detect whether or not wrapping with a different modulus that is not a power of 2 would be detected.
Either there needs to be clear comment with each real limbo drive unit test record what it is meant to test or the simulated fake drive needs support wrapping at the real device size. (If a fake device uses a 2^n-1 mask as in the code and the real device has slightly more capacity this extra capacity will never be seen and the fake device will behave as if it has a 2^n capacity real drive.)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.