| 40 | ~CacheTest() { delete cache_; } |
| 41 | |
| 42 | int Lookup(int key) { |
| 43 | Cache::Handle* handle = cache_->Lookup(EncodeKey(key)); |
| 44 | const int r = (handle == nullptr) ? -1 : DecodeValue(cache_->Value(handle)); |
| 45 | if (handle != nullptr) { |
| 46 | cache_->Release(handle); |
| 47 | } |
| 48 | return r; |
| 49 | } |
| 50 | |
| 51 | void Insert(int key, int value, int charge = 1) { |
| 52 | cache_->Release(cache_->Insert(EncodeKey(key), EncodeValue(value), charge, |
no test coverage detected