basic test on dynamic bitset
This commit is contained in:
parent
c155b7b77b
commit
44c9585602
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,3 +2,6 @@
|
||||
.ycm_extra_conf.py
|
||||
.ycm_extra_conf.pyc
|
||||
*.swp
|
||||
*.swo
|
||||
*.out
|
||||
*.dSYM/
|
||||
|
3
test/README.md
Normal file
3
test/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# NOTE
|
||||
Files with .old extension are old test files. They have to be rewritten because of changes in the appropriate project files.
|
||||
bitblock.hpp is going to be replaced with the dynamic_bitset
|
19
test/dynamic_bitset.cpp
Normal file
19
test/dynamic_bitset.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "catch.hpp"
|
||||
#include "data_structures/bitset/dynamic_bitset.hpp"
|
||||
|
||||
TEST_CASE("Dynamic bitset basic functionality")
|
||||
{
|
||||
DynamicBitset<> db;
|
||||
db.set(2222255555, 1);
|
||||
bool value = db.at(2222255555, 1);
|
||||
REQUIRE(value == true);
|
||||
|
||||
|
||||
db.set(32, 1);
|
||||
value = db.at(32, 1);
|
||||
REQUIRE(value == true);
|
||||
|
||||
db.clear(32, 1);
|
||||
value = db.at(32, 1);
|
||||
REQUIRE(value == false);
|
||||
}
|
Loading…
Reference in New Issue
Block a user