| 106 | } |
| 107 | |
| 108 | static void ReadThread(LruCache<int, int> *cache) { |
| 109 | int64_t now = RealtimeClock.MicroSeconds(); |
| 110 | int value; |
| 111 | while (RealtimeClock.MicroSeconds() - now < 500) { |
| 112 | for (int i = 2; i < 1000; ++i) { |
| 113 | bool r = cache->Get(i, &value); |
| 114 | if (r) { |
| 115 | ASSERT_EQ(0, value % i); |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | TEST(ThreadSafeLruCacheTest, MultiThread) { |
| 122 | LruCache<int, int> cache(900); |
nothing calls this directly
no test coverage detected