Lines Matching refs:cache
98 const UnifiedCache *cache = UnifiedCache::getInstance(status); in TestEvictionUnderStress() local
99 int64_t evictedCountBefore = cache->autoEvictedCount(); in TestEvictionUnderStress()
103 int64_t evictedCountAfter = cache->autoEvictedCount(); in TestEvictionUnderStress()
122 UnifiedCache cache(status); in TestEvictionPolicy() local
126 cache.setEvictionPolicy(0, 100, status); in TestEvictionPolicy()
137 cache.get( in TestEvictionPolicy()
139 &cache, in TestEvictionPolicy()
146 cache.get( in TestEvictionPolicy()
149 &cache, in TestEvictionPolicy()
156 assertEquals("T1", UPRV_LENGTHOF(usedReferences), cache.unusedCount()); in TestEvictionPolicy()
157 assertEquals("T2", 2*UPRV_LENGTHOF(usedReferences), cache.keyCount()); in TestEvictionPolicy()
165 assertEquals("T3", 0, cache.keyCount()); in TestEvictionPolicy()
183 UnifiedCache cache(status); in TestBounded() local
187 cache.setEvictionPolicy(3, 0, status); in TestBounded()
203 cache.get(LocaleCacheKey<UCTItem>("en_US"), &cache, enUs, status); in TestBounded()
204 cache.get(LocaleCacheKey<UCTItem>("en"), &cache, en, status); in TestBounded()
205 assertEquals("T1", 1, cache.unusedCount()); in TestBounded()
206 cache.get(LocaleCacheKey<UCTItem>("en_GB"), &cache, enGb, status); in TestBounded()
207 cache.get(LocaleCacheKey<UCTItem>("fr_FR"), &cache, frFr, status); in TestBounded()
208 cache.get(LocaleCacheKey<UCTItem>("fr"), &cache, fr, status); in TestBounded()
212 assertEquals("T2", 3, cache.unusedCount()); in TestBounded()
213 assertEquals("T3", 5, cache.keyCount()); in TestBounded()
220 cache.get(LocaleCacheKey<UCTItem>("zn_AA"), &cache, throwAway, status); in TestBounded()
221 cache.get(LocaleCacheKey<UCTItem>("sr_AA"), &cache, throwAway, status); in TestBounded()
222 cache.get(LocaleCacheKey<UCTItem>("de_AU"), &cache, throwAway, status); in TestBounded()
230 assertEquals("T4", 3, cache.unusedCount()); in TestBounded()
231 assertEquals("T5", 6, cache.keyCount()); in TestBounded()
236 cache.get(LocaleCacheKey<UCTItem>("en"), &cache, throwAway, status); in TestBounded()
240 cache.get(LocaleCacheKey<UCTItem>("en_US"), &cache, throwAway, status); in TestBounded()
244 cache.get(LocaleCacheKey<UCTItem>("en_GB"), &cache, throwAway, status); in TestBounded()
248 cache.get(LocaleCacheKey<UCTItem>("fr_FR"), &cache, throwAway, status); in TestBounded()
252 cache.get(LocaleCacheKey<UCTItem>("fr_FR"), &cache, throwAway, status); in TestBounded()
253 cache.get(LocaleCacheKey<UCTItem>("fr"), &cache, throwAway, status); in TestBounded()
257 cache.get(LocaleCacheKey<UCTItem>("de_AU"), &cache, throwAway, status); in TestBounded()
262 assertEquals("T12", 3, cache.unusedCount()); in TestBounded()
263 assertEquals("T13", 6, cache.keyCount()); in TestBounded()
269 cache.get(LocaleCacheKey<UCTItem>("es"), &cache, es, status); in TestBounded()
270 cache.get(LocaleCacheKey<UCTItem>("ru"), &cache, ru, status); in TestBounded()
271 assertEquals("T14", 3, cache.unusedCount()); in TestBounded()
272 assertEquals("T15", 8, cache.keyCount()); in TestBounded()
287 assertEquals("T16", 3, cache.unusedCount()); in TestBounded()
288 assertEquals("T17", 3, cache.keyCount()); in TestBounded()
292 cache.setEvictionPolicy(3, 0, status); in TestBounded()
299 const UnifiedCache *cache = UnifiedCache::getInstance(status); in TestBasic() local
301 cache->flush(); in TestBasic()
302 int32_t baseCount = cache->keyCount(); in TestBasic()
309 cache->get(LocaleCacheKey<UCTItem>("en"), en, status); in TestBasic()
310 cache->get(LocaleCacheKey<UCTItem>("en_US"), enUs, status); in TestBasic()
311 cache->get(LocaleCacheKey<UCTItem>("en_GB"), enGb, status); in TestBasic()
312 cache->get(LocaleCacheKey<UCTItem>("fr_FR"), frFr, status); in TestBasic()
313 cache->get(LocaleCacheKey<UCTItem>("fr"), fr, status); in TestBasic()
314 cache->get(LocaleCacheKey<UCTItem>("en_GB"), enGb2, status); in TestBasic()
328 assertEquals("T2", baseCount + 5, cache->keyCount()); in TestBasic()
330 cache->flush(); in TestBasic()
334 assertEquals("T3", baseCount + 2, cache->keyCount()); in TestBasic()
337 cache->flush(); in TestBasic()
342 assertEquals("T4", baseCount + 1, cache->keyCount()); in TestBasic()
344 cache->flush(); in TestBasic()
345 assertEquals("T5", baseCount + 1, cache->keyCount()); in TestBasic()
347 cache->flush(); in TestBasic()
348 assertEquals("T6", baseCount + 0, cache->keyCount()); in TestBasic()
354 const UnifiedCache *cache = UnifiedCache::getInstance(status); in TestError() local
356 cache->flush(); in TestError()
357 int32_t baseCount = cache->keyCount(); in TestError()
363 cache->get(LocaleCacheKey<UCTItem>("zh"), zh, status); in TestError()
368 cache->get(LocaleCacheKey<UCTItem>("zh_TW"), zhTw, status); in TestError()
373 cache->get(LocaleCacheKey<UCTItem>("zh_HK"), zhHk, status); in TestError()
378 assertEquals("", baseCount + 3, cache->keyCount()); in TestError()
379 cache->flush(); in TestError()
381 assertEquals("", baseCount + 0, cache->keyCount()); in TestError()