MCPcopy Create free account
hub / github.com/facebook/CacheLib / resetTestRun

Function resetTestRun

cachelib/navy/block_cache/tests/BlockCacheTest.cpp:1224–1242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222}
1223
1224void resetTestRun(Driver& cache) {
1225 std::vector<CacheEntry> log;
1226 BufferGen bg;
1227 // Fill up the first region and write one entry into the second region
1228 for (size_t i = 0; i < 17; i++) {
1229 CacheEntry e{bg.gen(8), bg.gen(800)};
1230 EXPECT_EQ(Status::Ok,
1231 cache.insertAsync(e.key(), e.value(), nullptr, 0 /* poolId */,
1232 0 /* expiryTime */));
1233 log.push_back(std::move(e));
1234 }
1235 cache.flush();
1236 for (size_t i = 0; i < 17; i++) {
1237 Buffer value;
1238 uint32_t lat = 0;
1239 EXPECT_EQ(Status::Ok, cache.lookup(log[i].key(), value, lat));
1240 EXPECT_EQ(log[i].value(), value.view());
1241 }
1242}
1243} // namespace
1244
1245TEST(BlockCache, Reset) {

Callers 1

TESTFunction · 0.85

Calls 7

genMethod · 0.80
insertAsyncMethod · 0.80
keyMethod · 0.45
valueMethod · 0.45
flushMethod · 0.45
lookupMethod · 0.45
viewMethod · 0.45

Tested by

no test coverage detected