memgraph/tests/unit/dynamic_bitset.cpp

24 lines
470 B
C++
Raw Normal View History

2016-12-23 02:28:21 +08:00
#include "gtest/gtest.h"
2016-05-16 04:43:42 +08:00
#include "data_structures/bitset/dynamic_bitset.hpp"
TEST(DynamicBitset, BasicFunctionality) {
DynamicBitset<> db;
db.set(222555, 1);
bool value = db.at(222555, 1);
ASSERT_EQ(value, true);
2016-05-16 04:43:42 +08:00
db.set(32, 1);
value = db.at(32, 1);
ASSERT_EQ(value, true);
2016-05-16 04:43:42 +08:00
db.clear(32, 1);
value = db.at(32, 1);
ASSERT_EQ(value, false);
2016-12-23 02:28:21 +08:00
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
2016-05-16 04:43:42 +08:00
}