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

Function TEST

cachelib/allocator/nvmcache/tests/AccessTimeMapTest.cpp:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace tests {
29
30TEST(AccessTimeMapTest, BasicSetAndGet) {
31 AccessTimeMap m(4);
32
33 // get on missing key returns nullopt
34 ASSERT_EQ(m.get(42), std::nullopt);
35
36 // set then get returns value
37 m.set(42, 100);
38 ASSERT_EQ(m.get(42), 100);
39
40 // overwrite returns new value
41 m.set(42, 200);
42 ASSERT_EQ(m.get(42), 200);
43}
44
45TEST(AccessTimeMapTest, GetAndRemove) {
46 AccessTimeMap m(4);

Callers

nothing calls this directly

Calls 15

AccessTimeMapClass · 0.85
CounterVisitorClass · 0.85
getAndRemoveMethod · 0.80
joinMethod · 0.80
createCountVisitorMethod · 0.80
toMapMethod · 0.80
strMethod · 0.80
removeShmMethod · 0.80
createShmMethod · 0.80
writeToBufferMethod · 0.80
attachShmMethod · 0.80
ASSERT_THROWFunction · 0.50

Tested by

no test coverage detected