Lines Matching refs:cache
96 const UnifiedCache *cache = UnifiedCache::getInstance(status); in TestEvictionUnderStress() local
97 int64_t evictedCountBefore = cache->autoEvictedCount(); in TestEvictionUnderStress()
101 int64_t evictedCountAfter = cache->autoEvictedCount(); in TestEvictionUnderStress()
120 UnifiedCache cache(status); in TestEvictionPolicy() local
124 cache.setEvictionPolicy(0, 100, status); in TestEvictionPolicy()
135 cache.get( in TestEvictionPolicy()
137 &cache, in TestEvictionPolicy()
144 cache.get( in TestEvictionPolicy()
147 &cache, in TestEvictionPolicy()
154 assertEquals("", UPRV_LENGTHOF(usedReferences), cache.unusedCount()); in TestEvictionPolicy()
155 assertEquals("", 2*UPRV_LENGTHOF(usedReferences), cache.keyCount()); in TestEvictionPolicy()
163 assertEquals("", 0, cache.keyCount()); in TestEvictionPolicy()
181 UnifiedCache cache(status); in TestBounded() local
185 cache.setEvictionPolicy(3, 0, status); in TestBounded()
201 cache.get(LocaleCacheKey<UCTItem>("en_US"), &cache, enUs, status); in TestBounded()
202 cache.get(LocaleCacheKey<UCTItem>("en"), &cache, en, status); in TestBounded()
203 assertEquals("", 1, cache.unusedCount()); in TestBounded()
204 cache.get(LocaleCacheKey<UCTItem>("en_GB"), &cache, enGb, status); in TestBounded()
205 cache.get(LocaleCacheKey<UCTItem>("fr_FR"), &cache, frFr, status); in TestBounded()
206 cache.get(LocaleCacheKey<UCTItem>("fr"), &cache, fr, status); in TestBounded()
210 assertEquals("", 3, cache.unusedCount()); in TestBounded()
211 assertEquals("", 5, cache.keyCount()); in TestBounded()
218 cache.get(LocaleCacheKey<UCTItem>("zn_AA"), &cache, throwAway, status); in TestBounded()
219 cache.get(LocaleCacheKey<UCTItem>("sr_AA"), &cache, throwAway, status); in TestBounded()
220 cache.get(LocaleCacheKey<UCTItem>("de_AU"), &cache, throwAway, status); in TestBounded()
228 assertEquals("", 3, cache.unusedCount()); in TestBounded()
229 assertEquals("", 6, cache.keyCount()); in TestBounded()
234 cache.get(LocaleCacheKey<UCTItem>("en"), &cache, throwAway, status); in TestBounded()
238 cache.get(LocaleCacheKey<UCTItem>("en_US"), &cache, throwAway, status); in TestBounded()
242 cache.get(LocaleCacheKey<UCTItem>("en_GB"), &cache, throwAway, status); in TestBounded()
246 cache.get(LocaleCacheKey<UCTItem>("fr_FR"), &cache, throwAway, status); in TestBounded()
250 cache.get(LocaleCacheKey<UCTItem>("fr_FR"), &cache, throwAway, status); in TestBounded()
251 cache.get(LocaleCacheKey<UCTItem>("fr"), &cache, throwAway, status); in TestBounded()
255 cache.get(LocaleCacheKey<UCTItem>("de_AU"), &cache, throwAway, status); in TestBounded()
260 assertEquals("", 3, cache.unusedCount()); in TestBounded()
261 assertEquals("", 6, cache.keyCount()); in TestBounded()
267 cache.get(LocaleCacheKey<UCTItem>("es"), &cache, es, status); in TestBounded()
268 cache.get(LocaleCacheKey<UCTItem>("ru"), &cache, ru, status); in TestBounded()
269 assertEquals("", 3, cache.unusedCount()); in TestBounded()
270 assertEquals("", 8, cache.keyCount()); in TestBounded()
285 assertEquals("", 3, cache.unusedCount()); in TestBounded()
286 assertEquals("", 3, cache.keyCount()); in TestBounded()
290 cache.setEvictionPolicy(3, 0, status); in TestBounded()
297 const UnifiedCache *cache = UnifiedCache::getInstance(status); in TestBasic() local
299 cache->flush(); in TestBasic()
300 int32_t baseCount = cache->keyCount(); in TestBasic()
307 cache->get(LocaleCacheKey<UCTItem>("en"), en, status); in TestBasic()
308 cache->get(LocaleCacheKey<UCTItem>("en_US"), enUs, status); in TestBasic()
309 cache->get(LocaleCacheKey<UCTItem>("en_GB"), enGb, status); in TestBasic()
310 cache->get(LocaleCacheKey<UCTItem>("fr_FR"), frFr, status); in TestBasic()
311 cache->get(LocaleCacheKey<UCTItem>("fr"), fr, status); in TestBasic()
312 cache->get(LocaleCacheKey<UCTItem>("en_GB"), enGb2, status); in TestBasic()
326 assertEquals("", baseCount + 5, cache->keyCount()); in TestBasic()
328 cache->flush(); in TestBasic()
332 assertEquals("", baseCount + 2, cache->keyCount()); in TestBasic()
335 cache->flush(); in TestBasic()
340 assertEquals("", baseCount + 1, cache->keyCount()); in TestBasic()
342 cache->flush(); in TestBasic()
343 assertEquals("", baseCount + 1, cache->keyCount()); in TestBasic()
345 cache->flush(); in TestBasic()
346 assertEquals("", baseCount + 0, cache->keyCount()); in TestBasic()
352 const UnifiedCache *cache = UnifiedCache::getInstance(status); in TestError() local
354 cache->flush(); in TestError()
355 int32_t baseCount = cache->keyCount(); in TestError()
361 cache->get(LocaleCacheKey<UCTItem>("zh"), zh, status); in TestError()
366 cache->get(LocaleCacheKey<UCTItem>("zh_TW"), zhTw, status); in TestError()
371 cache->get(LocaleCacheKey<UCTItem>("zh_HK"), zhHk, status); in TestError()
376 assertEquals("", baseCount + 3, cache->keyCount()); in TestError()
377 cache->flush(); in TestError()
379 assertEquals("", baseCount + 0, cache->keyCount()); in TestError()