f3probe unit test
- Dominant language
- C
- Stars
- 3.4k
- Forks
- 177
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 2
Description
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.)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.