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

Function CO_TEST_F

cachelib/interface/tests/InterfaceTest.cpp:316–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316CO_TEST_F(InterfaceTest, basic) {
317 co_await allocateAndInsertItem();
318
319 auto readHandle = CO_ASSERT_OK(co_await cache_.find(key_));
320 CO_ASSERT_TRUE(readHandle.has_value());
321 checkItemFields(readHandle.value());
322
323 {
324 auto writeHandle = CO_ASSERT_OK(co_await cache_.findToWrite(key_));
325 CO_ASSERT_TRUE(writeHandle.has_value());
326 checkItemFields(writeHandle.value());
327 writeHandle->markDirty();
328 }
329 EXPECT_EQ(cache_.writeBacks_, 1);
330
331 auto removed = CO_ASSERT_OK(co_await cache_.remove(key_));
332 EXPECT_TRUE(removed);
333 EXPECT_FALSE(this->cache_.cachedItems_.contains(this->key_));
334}
335
336CO_TEST_F(InterfaceTest, replace) {
337 co_await allocateAndInsertItem();

Callers

nothing calls this directly

Calls 11

markDirtyMethod · 0.80
setFailIncRefMethod · 0.80
findMethod · 0.45
valueMethod · 0.45
findToWriteMethod · 0.45
removeMethod · 0.45
allocateMethod · 0.45
getMemoryMethod · 0.45
insertOrReplaceMethod · 0.45
getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected