| 47 | } |
| 48 | |
| 49 | void checkAll(BTreeDatabase& db, const List<uint32_t>& keys) { |
| 50 | for (uint32_t k : keys) { |
| 51 | auto res = db.find(toByteArray(k)); |
| 52 | EXPECT_TRUE((bool)res); |
| 53 | EXPECT_TRUE(checkBlock(k, *res)); |
| 54 | } |
| 55 | |
| 56 | // Also check that forAll works. |
| 57 | |
| 58 | Set<ByteArray> keySet; |
| 59 | for (uint32_t k : keys) |
| 60 | keySet.add(toByteArray(k)); |
| 61 | |
| 62 | db.forAll([&keySet](ByteArray const& key, ByteArray const&) { EXPECT_TRUE(keySet.remove(key)); }); |
| 63 | |
| 64 | EXPECT_TRUE(keySet.empty()); |
| 65 | } |
| 66 | |
| 67 | size_t removeAll(BTreeDatabase& db, const List<uint32_t>& keys) { |
| 68 | size_t totalRemoved = 0; |
no test coverage detected