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"
|
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
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
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
db.set(32, 1);
|
|
|
|
value = db.at(32, 1);
|
|
|
|
ASSERT_EQ(value, true);
|
2016-05-16 04:43:42 +08:00
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
db.clear(32, 1);
|
|
|
|
value = db.at(32, 1);
|
|
|
|
ASSERT_EQ(value, false);
|
2016-12-23 02:28:21 +08:00
|
|
|
}
|
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
int main(int argc, char **argv) {
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
return RUN_ALL_TESTS();
|
2016-05-16 04:43:42 +08:00
|
|
|
}
|