137 unsigned int nbok = 0;
141 trace.
beginBlock (
"An invalid CountedPtr does not create any instance." );
145 ++nb; nbok += A::nb == 0 ? 1 : 0;
146 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 0" << std::endl;
149 trace.
beginBlock (
"CountedPtr can be used as a simple pointer with automatic deallocation." );
152 ++nb; nbok += A::nb == 1 ? 1 : 0;
153 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 1" << std::endl;
155 ++nb; nbok += A::nb == 0 ? 1 : 0;
156 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 0" << std::endl;
159 trace.
beginBlock (
"CountedPtr can be initialized with = CountedPtr<A>( pointer )." );
162 ++nb; nbok += A::nb == 1 ? 1 : 0;
163 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 1" << std::endl;
165 ++nb; nbok += A::nb == 0 ? 1 : 0;
166 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 0" << std::endl;
173 ++nb; nbok += A::nb == 1 ? 1 : 0;
174 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 1" << std::endl;
175 ++nb; nbok += cptr.
get() == cptr2.
get() ? 1 : 0;
176 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"cptr.get() == cptr2.get()" << std::endl;
177 ++nb; nbok += cptr.
count() == 2 ? 1 : 0;
178 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"cptr.count() == 2" << std::endl;
179 ++nb; nbok += cptr2.
count() == 2 ? 1 : 0;
180 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"cptr2.count() == 2" << std::endl;
182 ++nb; nbok += A::nb == 0 ? 1 : 0;
183 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 0" << std::endl;
190 ++nb; nbok += A::nb == 2 ? 1 : 0;
191 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 2" << std::endl;
192 ++nb; nbok += cptr.
get() != cptr2.
get() ? 1 : 0;
193 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"cptr.get() != cptr2.get()" << std::endl;
195 ++nb; nbok += A::nb == 1 ? 1 : 0;
196 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 1" << std::endl;
197 ++nb; nbok += cptr.
get()->a == 12 ? 1 : 0;
198 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"cptr.get()->a == 12" << std::endl;
199 ++nb; nbok += cptr.
get() == cptr2.
get() ? 1 : 0;
200 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"cptr.get() == cptr2.get()" << std::endl;
201 ++nb; nbok += cptr.
count() == 2 ? 1 : 0;
202 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"cptr.count() == 2" << std::endl;
203 ++nb; nbok += cptr2.
count() == 2 ? 1 : 0;
204 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"cptr2.count() == 2" << std::endl;
206 ++nb; nbok += A::nb == 0 ? 1 : 0;
207 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " <<
"A::nb == 0" << std::endl;