From f8b9ece2fd9b788ba163934c1203cf753448e01e Mon Sep 17 00:00:00 2001 From: Mavo Date: Tue, 1 Mar 2016 10:21:55 +0100 Subject: [PATCH] Added mini test for BitVector Former-commit-id: 8ec7395c0d80a1cb31eeef8b2cf9e74a50639238 --- test/functional/storage/BitVectorTest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/functional/storage/BitVectorTest.cpp b/test/functional/storage/BitVectorTest.cpp index db92724fe..3e4d53235 100644 --- a/test/functional/storage/BitVectorTest.cpp +++ b/test/functional/storage/BitVectorTest.cpp @@ -510,4 +510,17 @@ TEST(BitVectorTest, Iterator) { for (auto bit : vector) { 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); } \ No newline at end of file