Lines Matching defs:hStrCache
44 static void tstShowStats(RTSTRCACHE hStrCache)
53 uint32_t cStrings = RTStrCacheGetStats(hStrCache, &cbStrings, &cbChunks, &cbBigEntries,
114 RTSTRCACHE hStrCache;
115 RTTESTI_CHECK_RC_RETV(RTStrCacheCreate(&hStrCache, "hash performance"), VINF_SUCCESS);
119 RTTESTI_CHECK_RETV(RTStrCacheEnter(hStrCache, apszTests[i]) != NULL);
128 RTTESTI_CHECK(RTStrCacheEnter(hStrCache, apszTests[i]) != NULL);
132 tstShowStats(hStrCache);
133 RTTESTI_CHECK_RC(RTStrCacheDestroy(hStrCache), VINF_SUCCESS);
141 static void tst1(RTSTRCACHE hStrCache)
146 RTTESTI_CHECK_RETV(psz = RTStrCacheEnter(hStrCache, "abcdefgh"));
149 RTTESTI_CHECK_RETV(RTStrCacheRelease(hStrCache, psz) == 0);
151 RTTESTI_CHECK_RETV(psz = RTStrCacheEnter(hStrCache, "abcdefghijklmnopqrstuvwxyz"));
154 RTTESTI_CHECK_RETV(RTStrCacheRelease(hStrCache, psz) == 0);
157 RTTESTI_CHECK_RETV(psz = RTStrCacheEnterN(hStrCache, "0123456789", 3));
160 RTTESTI_CHECK_RETV(RTStrCacheRelease(hStrCache, psz) == 0);
162 RTTESTI_CHECK_RETV(psz = RTStrCacheEnterN(hStrCache, "0123456789abcdefghijklmnopqrstuvwxyz", 16));
165 RTTESTI_CHECK_RETV(RTStrCacheRelease(hStrCache, psz) == 0);
175 RTTESTI_CHECK_RETV(psz = RTStrCacheEnterN(hStrCache, szTest, i));
181 RTTESTI_CHECK(RTStrCacheRelease(hStrCache, psz) == 3);
186 RTTESTI_CHECK(RTStrCacheRelease(hStrCache, psz) == 5);
187 RTTESTI_CHECK(RTStrCacheRelease(hStrCache, psz) == 4);
192 RTTESTI_CHECK(RTStrCacheRelease(hStrCache, psz) == cRefs);
199 RTTESTI_CHECK_RETV(psz2 = RTStrCacheEnterN(hStrCache, szTest2, i));
201 RTTESTI_CHECK(RTStrCacheRelease(hStrCache, psz2) == 0);
214 RTTESTI_CHECK(pszTest1Rets[i] = RTStrCacheEnterN(hStrCache, szTest, i));
216 RTTESTI_CHECK(pszTest2Rets[i] = RTStrCacheEnterN(hStrCache, szTest2, i));
226 RTTESTI_CHECK((psz1 = RTStrCacheEnterN(hStrCache, szTest, i)) == pszTest1Rets[i]);
227 RTTESTI_CHECK((psz2 = RTStrCacheEnterN(hStrCache, szTest2, i)) == pszTest2Rets[i]);
228 RTTESTI_CHECK_MSG((cRefs = RTStrCacheRelease(hStrCache, psz1)) == 1, ("cRefs=%#x i=%#x\n", cRefs, i));
229 RTTESTI_CHECK_MSG((cRefs = RTStrCacheRelease(hStrCache, psz2)) == 1, ("cRefs=%#x i=%#x\n", cRefs, i));
237 RTTESTI_CHECK_MSG((cRefs = RTStrCacheRelease(hStrCache, pszTest1Rets[i])) == 0, ("cRefs=%#x i=%#x\n", cRefs, i));
239 RTTESTI_CHECK_MSG((cRefs = RTStrCacheRelease(hStrCache, pszTest2Rets[i])) == 0, ("cRefs=%#x i=%#x\n", cRefs, i));
259 RTSTRCACHE hStrCache;
260 RTTESTI_CHECK_RC(rc = RTStrCacheCreate(&hStrCache, "test 2a"), VINF_SUCCESS);
262 RTTESTI_CHECK_RC(rc = RTStrCacheDestroy(hStrCache), VINF_SUCCESS);
267 RTTESTI_CHECK_RC(rc = RTStrCacheCreate(&hStrCache, "test 2b"), VINF_SUCCESS);
270 tst1(hStrCache);
271 RTTESTI_CHECK_RC(rc = RTStrCacheDestroy(hStrCache), VINF_SUCCESS);