| 38 | } |
| 39 | |
| 40 | TEST(RamFileBlockCacheTest, IsCacheEnabled) { |
| 41 | auto fetcher = [](const string& filename, size_t offset, size_t n, |
| 42 | char* buffer, size_t* bytes_transferred) { |
| 43 | // Do nothing. |
| 44 | return Status::OK(); |
| 45 | }; |
| 46 | RamFileBlockCache cache1(0, 0, 0, fetcher); |
| 47 | RamFileBlockCache cache2(16, 0, 0, fetcher); |
| 48 | RamFileBlockCache cache3(0, 32, 0, fetcher); |
| 49 | RamFileBlockCache cache4(16, 32, 0, fetcher); |
| 50 | |
| 51 | EXPECT_FALSE(cache1.IsCacheEnabled()); |
| 52 | EXPECT_FALSE(cache2.IsCacheEnabled()); |
| 53 | EXPECT_FALSE(cache3.IsCacheEnabled()); |
| 54 | EXPECT_TRUE(cache4.IsCacheEnabled()); |
| 55 | } |
| 56 | |
| 57 | TEST(RamFileBlockCacheTest, ValidateAndUpdateFileSignature) { |
| 58 | int calls = 0; |
nothing calls this directly
no test coverage detected