| 262 | public: |
| 263 | template <typename HandleT> |
| 264 | TestCacheItem* makeItem() { |
| 265 | auto* item = new TestCacheItem(key_, |
| 266 | /* valueSize */ 128, |
| 267 | /* creationTime */ 1000, |
| 268 | /* ttlSecs */ 10); |
| 269 | std::memcpy(item->getMemory(), data_, sizeof(data_)); |
| 270 | if constexpr (std::is_same_v<HandleT, AllocatedHandle>) { |
| 271 | cache_.allocatedItems_.emplace_back(item); |
| 272 | } else { |
| 273 | cache_.cachedItems_.try_emplace(key_, item); |
| 274 | } |
| 275 | return item; |
| 276 | } |
| 277 | |
| 278 | template <typename HandleT> |
| 279 | void checkReleased(TestCacheItem* item, bool removedFromCache = true) { |