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

Function removeAll

source/test/btree_database_test.cpp:67–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 size_t removeAll(BTreeDatabase& db, const List<uint32_t>& keys) {
68 size_t totalRemoved = 0;
69 for (uint32_t k : keys) {
70 auto old = db.find(toByteArray(k));
71 EXPECT_TRUE(!old || *old == genBlock(k));
72
73 if (db.remove(toByteArray(k))) {
74 EXPECT_FALSE((bool)db.find(toByteArray(k)));
75 ++totalRemoved;
76 }
77 }
78 return totalRemoved;
79 }
80
81 void testBTreeDatabase(size_t testCount, size_t writeRepeat, size_t randCount, size_t rollbackCount, size_t blockSize) {
82 auto tmpFile = File::temporaryFile();

Callers 1

testBTreeDatabaseFunction · 0.70

Calls 4

toByteArrayFunction · 0.85
genBlockFunction · 0.85
findMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected