TBits wrong behaviour findnextbit
Original Reporter info from Mantis: apeoperaio @andrea.mauri
-
Reporter name: Andrea Mauri
Original Reporter info from Mantis: apeoperaio @andrea.mauri
- Reporter name: Andrea Mauri
Description:
In the documentation it is written that:
if another bit with the same value is found, its position is returned. If no more bits with the same value are present in the array, -1 is returned.
I tested it and if FindNextBit did not find a bit it raises an exception (invalid bit index).
Steps to reproduce:
using the following code (attached project) you can reproduce it.
b:= TBits.Create;
b.Size:= 128;
b.SetOn(0);
b.SetOn(13);
b.SetOn(118);
i:= b.FindFirstBit(True);
while i >= 0 do
i:= b.FindNextBit;
Instead of exiting from while it raises exception.
Mantis conversion info:
- Mantis ID: 25398
- OS: windows
- OS Build: 7
- Platform: 64bit
- Version: 2.6.2
- Fixed in version: 3.0.0
- Fixed in revision: 26754 (#6c66b8ff)
- Monitored by: » @andrea.mauri (Andrea Mauri)