Add GetBit() method to Block

This commit is contained in:
Leonetienne
2022-05-24 23:18:39 +02:00
parent db0add6e6e
commit e552e1a6f8
3 changed files with 29 additions and 0 deletions

View File

@@ -633,3 +633,18 @@ TEST_CASE(__FILE__"/multiple-combined-shifts-and-additions-can-be-undone", "[Blo
REQUIRE(a == initial_a);
}
// Tests that the get-bit method works
TEST_CASE(__FILE__"/get-bit", "[Block]") {
// Setup
Block a = Key::FromPassword("Halleluja");
// Exercise
std::stringstream ss;
for (std::size_t i = 0; i < 512; i++) {
ss << a.GetBit(i);
}
// Verify
REQUIRE(ss.str() == a.ToString());
}