MCPcopy Create free account
hub / github.com/cpputest/cpputest / TEST

Function TEST

tests/CppUTest/SimpleStringCacheTest.cpp:82–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80};
81
82TEST(SimpleStringInternalCache, cacheHitWithOneEntry)
83{
84 createCacheForSize(10, 1);
85 cache.setAllocator(allocator);
86
87 char* mem = cache.alloc(10);
88 mem[0] = 'B';
89 mem[3] = 'A';
90 mem[9] = 'S';
91
92 cache.setAllocator(allocator->originalAllocator());
93
94 LONGS_EQUAL(0, accountant.totalAllocationsOfSize(10));
95 CHECK(!cache.hasFreeBlocksOfSize(10));
96
97 cache.setAllocator(allocator);
98}
99
100TEST(SimpleStringInternalCache, cacheHitWithTwoEntries)
101{

Callers

nothing calls this directly

Calls 15

createCacheForSizeFunction · 0.85
defaultMallocAllocatorFunction · 0.85
hasFreeBlocksOfSizeMethod · 0.80
clearCacheMethod · 0.80
assertPrintContainsMethod · 0.80
getOutputMethod · 0.80
totalAllocationsMethod · 0.80
totalDeallocationsMethod · 0.80
setAllocatorMethod · 0.45

Tested by

no test coverage detected