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

Function verifyCache

src/iocore/hostdb/test_RefCountCache.cc:108–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108int
109verifyCache(RefCountCache<ExampleStruct> *cache, int start, int end)
110{
111 // Re-query all the structs to make sure they are there and accurate
112 for (int i = start; i < end; i++) {
113 Ptr<ExampleStruct> ccitem = cache->get(i);
114 ExampleStruct *tmp = ccitem.get();
115 if (tmp == nullptr) {
116 // printf("ExampleStruct %d missing, skipping\n", i);
117 continue;
118 }
119 // printf("Get (%p) ExampleStruct%d idx=%d name=%s\n", tmp, i, tmp->idx, tmp->name());
120
121 // Check that idx is correct
122 if (tmp->idx != i) {
123 printf("IDX of ExampleStruct%d incorrect! (%d)\n", i, tmp->idx);
124 return 1; // TODO: spin over all?
125 }
126 }
127 return 0;
128}
129
130// TODO: check that the memory was actually free-d better
131int

Callers 1

testFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected