The wrong bitwise operations were used here, resulting in e.g. a set of bit 2 of
of `
0b011000` updating to `
0b011100` instead of being a no-op.
This bug was present since the first introduction of this interface in
3ced90bd756bb8e56920620f2686e0ba6b482bbb, but this has not yet made it into a
release.
if (value) {
base[index / 8] |= (uint8_t)(UINT8_C(1) << (index % 8));
} else {
- base[index / 8] ^= (uint8_t)(UINT8_C(1) << (index % 8));
+ base[index / 8] &= (uint8_t)~(UINT8_C(1) << (index % 8));
}
}
# pass this through gvmap
subprocess.run(["gvmap"], input=input.encode("utf-8"), check=True)
-@pytest.mark.xfail(strict=True) # FIXME
def test_bitarray():
"""run the bitarray unit tests"""