| 35 | }; |
| 36 | |
| 37 | TEST(TestCache, TestGetPut) { |
| 38 | Cache<TestCacheKey, std::shared_ptr<std::string>> cache(2); |
| 39 | auto hello = std::make_shared<std::string>("hello"); |
| 40 | cache.PutObjectCode(TestCacheKey(1), hello); |
| 41 | auto world = std::make_shared<std::string>("world"); |
| 42 | cache.PutObjectCode(TestCacheKey(2), world); |
| 43 | ASSERT_EQ(cache.GetObjectCode(TestCacheKey(1)), hello); |
| 44 | ASSERT_EQ(cache.GetObjectCode(TestCacheKey(2)), world); |
| 45 | } |
| 46 | |
| 47 | namespace { |
| 48 | constexpr auto cache_capacity_env_var = "GANDIVA_CACHE_SIZE"; |
nothing calls this directly
no test coverage detected