]> granicus.if.org Git - icu/commitdiff
ICU-11767 Fix brokenbuild.
authorTravis Keep <keep94@gmail.com>
Fri, 7 Aug 2015 13:39:05 +0000 (13:39 +0000)
committerTravis Keep <keep94@gmail.com>
Fri, 7 Aug 2015 13:39:05 +0000 (13:39 +0000)
X-SVN-Rev: 37730

icu4c/source/test/intltest/tsmthred.cpp

index be1584942ee616ca79bc7bf60d16ebd85e0b3aef..9fabb4afee720282f0bef6e034261e1402118352 100644 (file)
@@ -1493,9 +1493,10 @@ void MultithreadTest::TestUnifiedCache() {
     }
     // We know that each thread cannot create more than 2 objects in
     // the cache, and there are UPRV_LENGTHOF(gCacheLocales) pairs of
-    // objects fetched from the cache
-    if (gObjectsCreated > 2 * UPRV_LENGTHOF(gCacheLocales)) {
-        errln("%s:%d Too many objects created, got %d, expected %d", __FILE__, __LINE__, gObjectsCreated, 2 * UPRV_LENGTHOF(gCacheLocales));
+    // objects fetched from the cache. If the threads run in series because
+    // of eviction, at worst case each thread creates two objects.
+    if (gObjectsCreated > 2 * CACHE_LOAD * UPRV_LENGTHOF(gCacheLocales)) {
+        errln("%s:%d Too many objects created, got %d, expected %d", __FILE__, __LINE__, gObjectsCreated, 2 * CACHE_LOAD * UPRV_LENGTHOF(gCacheLocales));
 
     }