MCPcopy Create free account
hub / github.com/apache/trafficserver / testclear

Function testclear

src/iocore/hostdb/test_RefCountCache.cc:180–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180int
181testclear()
182{
183 int ret = 0;
184
185 RefCountCache<ExampleStruct> *cache = new RefCountCache<ExampleStruct>(4);
186
187 // Create and then immediately delete an item
188 ExampleStruct *item = ExampleStruct::alloc();
189 ret |= item->refcount() != 0;
190 cache->put(1, item);
191 ret |= item->refcount() != 1;
192 cache->clear();
193 ret |= item->refcount() != 0;
194 ret |= item->idx != -1;
195
196 delete cache;
197
198 return ret;
199}
200
201int
202test()

Callers

nothing calls this directly

Calls 3

refcountMethod · 0.80
putMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected