|
@ -19,24 +19,24 @@ class TestBitvector: |
|
|
bit = stormpy.BitVector(5, [2, 3]) |
|
|
bit = stormpy.BitVector(5, [2, 3]) |
|
|
assert bit.size() == 5 |
|
|
assert bit.size() == 5 |
|
|
assert bit.number_of_set_bits() == 2 |
|
|
assert bit.number_of_set_bits() == 2 |
|
|
assert bit.get(0) == False |
|
|
|
|
|
assert bit.get(1) == False |
|
|
|
|
|
assert bit.get(2) == True |
|
|
|
|
|
assert bit.get(3) == True |
|
|
|
|
|
assert bit.get(4) == False |
|
|
|
|
|
|
|
|
assert bit.get(0) is False |
|
|
|
|
|
assert bit.get(1) is False |
|
|
|
|
|
assert bit.get(2) is True |
|
|
|
|
|
assert bit.get(3) is True |
|
|
|
|
|
assert bit.get(4) is False |
|
|
|
|
|
|
|
|
def test_init_bitvector(self): |
|
|
def test_init_bitvector(self): |
|
|
bit = stormpy.BitVector(7, [0, 6]) |
|
|
bit = stormpy.BitVector(7, [0, 6]) |
|
|
bit2 = stormpy.BitVector(bit) |
|
|
bit2 = stormpy.BitVector(bit) |
|
|
assert bit == bit2 |
|
|
assert bit == bit2 |
|
|
assert bit2.get(0) == True |
|
|
|
|
|
assert bit2.get(6) == True |
|
|
|
|
|
|
|
|
assert bit2.get(0) is True |
|
|
|
|
|
assert bit2.get(6) is True |
|
|
|
|
|
|
|
|
def test_negate(self): |
|
|
def test_negate(self): |
|
|
bit = stormpy.BitVector(7, [0, 6]) |
|
|
bit = stormpy.BitVector(7, [0, 6]) |
|
|
bit2 = stormpy.BitVector(bit) |
|
|
bit2 = stormpy.BitVector(bit) |
|
|
bit = ~bit |
|
|
bit = ~bit |
|
|
assert bit.get(0) == False |
|
|
|
|
|
assert bit.get(6) == False |
|
|
|
|
|
|
|
|
assert bit.get(0) is False |
|
|
|
|
|
assert bit.get(6) is False |
|
|
for i in range(bit.size()): |
|
|
for i in range(bit.size()): |
|
|
assert bit.get(i) is not bit2.get(i) |
|
|
assert bit.get(i) is not bit2.get(i) |