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

Method checkItemFields

cachelib/interface/tests/InterfaceTest.cpp:241–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240 template <typename HandleT>
241 void checkItemFields(const HandleT& handle) {
242 ASSERT_TRUE(handle);
243 EXPECT_EQ(handle->getCreationTime(), 1000);
244 EXPECT_EQ(handle->getExpiryTime(), 1010);
245 EXPECT_EQ(handle->getKey(), this->key_);
246 EXPECT_EQ(handle->getKeySize(), this->key_.size());
247 EXPECT_EQ(
248 std::memcmp(handle->getMemory(), this->data_, sizeof(this->data_)), 0);
249 EXPECT_EQ(handle->getMemorySize(), 128);
250 EXPECT_EQ(handle->getTotalSize(),
251 sizeof(TestCacheItem) + this->key_.size() + 128);
252 }
253
254 std::string keyData_{"test_key"};
255 Key key_{keyData_};

Callers 1

TYPED_TESTFunction · 0.80

Calls 8

getKeySizeMethod · 0.80
getCreationTimeMethod · 0.45
getExpiryTimeMethod · 0.45
getKeyMethod · 0.45
sizeMethod · 0.45
getMemoryMethod · 0.45
getMemorySizeMethod · 0.45
getTotalSizeMethod · 0.45

Tested by

no test coverage detected