MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / checkAll

Function checkAll

source/test/btree_database_test.cpp:49–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 1

testBTreeDatabaseFunction · 0.70

Calls 7

toByteArrayFunction · 0.85
checkBlockFunction · 0.85
findMethod · 0.45
addMethod · 0.45
forAllMethod · 0.45
removeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected