60 for (uint i=0; i<siz; ++i)
62 char c (rand() % 256);
70 CHECK (siz == mySiz_,
"using wrong type information for de-allocation");
71 for (uint i=0; i<siz; ++i)
72 checksum -= myCrap_[i];
125 CHECK (0 == killer.size());
127 killer.manage<
short> (NULL);
128 CHECK (0 == killer.size());
130 Probe<5> *p = makeViktim<5>();
131 Probe<7> &r = *makeViktim<7>();
132 void *v = makeViktim<9>();
133 CHECK (0 < checksum);
137 killer.manage (
static_cast<Probe<9>*
> (v));
139 CHECK (3 == killer.size());
142 CHECK (2 == killer.size());
145 CHECK (1 == killer.size());
148 CHECK (1 == killer.size());
151 CHECK (0 == killer.size());
152 CHECK (0 == checksum);
159 for (uint i=1; i <= MAX_MASS; ++i)
161 case 0: feedViktim<12> (killer);
break;
162 case 1: feedViktim<23> (killer);
break;
163 case 2: feedViktim<34> (killer);
break;
164 case 3: feedViktim<45> (killer);
break;
165 case 4: feedViktim<56> (killer);
break;
174 CHECK (0 == killer.size());
176 CHECK (0 == checksum);
177 CHECK (0 == killer.size());
179 feedViktims (killer);
180 CHECK (MAX_MASS == killer.size());
183 CHECK (0 == killer.size());
184 CHECK (0 == checksum);
193 CHECK (0 == killer.size());
194 CHECK (0 == checksum);
196 feedViktims (killer);
197 Probe<444> * individuum = makeViktim<444>();
198 killer.manage (individuum);
199 feedViktims (killer);
200 killer.manage (makeViktim<5555>());
201 feedViktims (killer);
203 CHECK (3*MAX_MASS + 2 == killer.size());
205 killer.kill(individuum);
206 CHECK (3*MAX_MASS + 1 == killer.size());
208 CHECK (0 < checksum);
211 CHECK (0 == checksum);
222 CHECK (0 == killer.size());
237 , secret_(
'a' + (rand() % (1+
'z'-
'a')))
245 Special *
self =
static_cast<Special*
> (it);
246 checksum -=
self->secret_;
252 void * type_erased =
new Special();
253 CHECK (0 < checksum);
255 killer.manage (type_erased, &Special::selfKill);
256 CHECK (1 == killer.size());
258 killer.kill(type_erased);
259 CHECK (0 == killer.size());
260 CHECK (0 == checksum);
Collecting and finally triggering deleter functions.
Implementation namespace for support and library code.
Simple test class runner.
Manage a collection of deleter functions.