Browse Source

Added mini test for BitVector

Former-commit-id: 8ec7395c0d
tempestpy_adaptions
Mavo 9 years ago
parent
commit
f8b9ece2fd
  1. 13
      test/functional/storage/BitVectorTest.cpp

13
test/functional/storage/BitVectorTest.cpp

@ -511,3 +511,16 @@ TEST(BitVectorTest, Iterator) {
ASSERT_TRUE(bit % 2 == 0); ASSERT_TRUE(bit % 2 == 0);
} }
} }
TEST(BitVectorTest, CompareAndSwap) {
storm::storage::BitVector vector(140);
vector.setFromInt(0, 64, 2377830234574424100);
vector.setFromInt(64, 64, 1152921504607379586);
vector.setFromInt(128, 12, 2080);
bool result = vector.compareAndSwap(0, 68, 68);
ASSERT_FALSE(result);
result = vector.compareAndSwap(68, 0, 68);
ASSERT_TRUE(result);
}
Loading…
Cancel
Save