155{
156#if defined(_WIN32_WCE)
157 std::ofstream
file(
"\\eh_test.txt" );
158 std::streambuf* old_cout_buf =
cout.rdbuf(
file.rdbuf());
159 std::streambuf* old_cerr_buf =
cerr.rdbuf(
file.rdbuf());
160#endif
161#if defined( __MWERKS__ ) && defined( macintosh )
163
164
165
166#endif
167 unsigned int niters=2;
168 bool run_all=true;
169 bool run_slist = false;
170 bool run_list = false;
171 bool run_vector = false;
172 bool run_bit_vector = false;
173 bool run_deque = false;
174 bool run_hash_map = false;
175 bool run_hash_set = false;
176 bool run_set = false;
177 bool run_map = false;
178 bool run_algo = false;
179 bool run_algobase = false;
180 bool run_rope = false;
181 bool run_string = false;
182 bool run_bitset = false;
183 bool run_valarray = false;
184
185 int cur_argv;
187#if defined (EH_NEW_IOSTREAMS)
188 std::ios_base::sync_with_stdio(false);
189#endif
190
191 cerr <<
argv[0]<<
" : Exception handling testsuite.\n";
193
194 bool track_allocations = false;
195
196
197 for (cur_argv=1; cur_argv<
argc; cur_argv++) {
201 case 'q':
203 break;
204 case 'v':
206 break;
207#if 0
208 case 'i':
210 break;
211#endif
212 case 'n':
213 p1 =
argv[++cur_argv];
214 if (p1 && EH_CSTD::sscanf(p1, "%i", &niters)==1)
215 cerr <<
" Doing "<<niters<<
" iterations\n";
216 else
218 break;
219 case 't':
220 track_allocations = true;
221 break;
222 case 'e':
224 break;
225 case 's':
226 p1 =
argv[++cur_argv];
227 if (p1 && EH_CSTD::sscanf(p1,
"%i", &
random_base)==1)
229 else
231 break;
232 default:
234 break;
235 }
236 } else {
237 run_all = false;
238
239 if (EH_CSTD::strcmp(
p,
"algo")==0) {
240 run_algo=true;
241 }
else if (EH_CSTD::strcmp(
p,
"vector")==0) {
242 run_vector=true;
243 }
else if (EH_CSTD::strcmp(
p,
"bit_vector")==0) {
244 run_bit_vector=true;
245 }
else if (EH_CSTD::strcmp(
p,
"list")==0) {
246 run_list=true;
247 }
else if (EH_CSTD::strcmp(
p,
"slist")==0) {
248 run_slist=true;
249 }
else if (EH_CSTD::strcmp(
p,
"deque")==0) {
250 run_deque=true;
251 }
else if (EH_CSTD::strcmp(
p,
"set")==0) {
252 run_set=true;
253 }
else if (EH_CSTD::strcmp(
p,
"map")==0) {
254 run_map=true;
255 }
else if (EH_CSTD::strcmp(
p,
"hash_set")==0) {
256 run_hash_set=true;
257 }
else if (EH_CSTD::strcmp(
p,
"hash_map")==0) {
258 run_hash_map=true;
259 }
else if (EH_CSTD::strcmp(
p,
"rope")==0) {
260 run_rope=true;
261 }
else if (EH_CSTD::strcmp(
p,
"string")==0) {
262 run_string=true;
263 }
else if (EH_CSTD::strcmp(
p,
"bitset")==0) {
264 run_bitset=true;
265 }
else if (EH_CSTD::strcmp(
p,
"valarray")==0) {
266 run_valarray=true;
267 } else {
269 }
270
271 }
272 }
273
275
276
277 for (
unsigned i = 0;
i < niters ;
i++ )
278 {
279 cerr <<
"iteration #" <<
i <<
"\n";
280 if (run_all || run_algobase) {
282 cerr <<
"EH test : algobase" <<
endl;
284 }
285 if (run_all || run_algo) {
289 }
290
291 if (run_all || run_vector) {
295 }
296
297#if defined( EH_BIT_VECTOR_IMPLEMENTED )
298 if (run_all || run_bit_vector) {
300 cerr <<
"EH test : bit_vector" <<
endl;
302 }
303#endif
304
305 if (run_all || run_list) {
309 }
310
311#if defined( EH_SLIST_IMPLEMENTED )
312 if (run_all || run_slist) {
316 }
317#endif
318
319 if (run_all || run_deque) {
323 }
324 if (run_all || run_set) {
329 cerr <<
"EH test : multiset" <<
endl;
331 }
332
333 if (run_all || run_map) {
338 cerr <<
"EH test : multimap" <<
endl;
340 }
341
342#if defined( EH_HASHED_CONTAINERS_IMPLEMENTED )
343 if (run_all || run_hash_map) {
345 cerr <<
"EH test : hash_map" <<
endl;
348 cerr <<
"EH test : hash_multimap" <<
endl;
350 }
351
352 if (run_all || run_hash_set) {
354 cerr <<
"EH test : hash_set" <<
endl;
357 cerr <<
"EH test : hash_multiset" <<
endl;
359 }
360#endif
361
362#if defined( EH_ROPE_IMPLEMENTED )
363
364#if !( defined(__MWERKS__) && __MWERKS__ < 0x1900 )
365 if (run_all || run_rope) {
369 }
370#endif
371#endif
372#if defined( EH_STRING_IMPLEMENTED )
373 if (run_all || run_string) {
377 }
378#endif
379#if defined( EH_BITSET_IMPLEMENTED )
380 if (run_all || run_bitset) {
383 test_bitset();
384 }
385#endif
386#if defined( EH_VALARRAY_IMPLEMENTED )
387 if (run_all || run_bitset) {
389 cerr <<
"EH test : valarray" <<
endl;
390 test_valarray();
391 }
392#endif
393 }
394
396
397 cerr <<
"EH test : Done\n";
398
399#if defined(_WIN32_WCE)
400 cout.rdbuf(old_cout_buf);
401 cerr.rdbuf(old_cerr_buf);
403#endif
404
405 return 0;
406}
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
GLsizeiptr const GLvoid GLenum usage
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static void test_slist(void)
TestController gTestController
static void TrackAllocations(bool)
static void SetVerbose(bool val)
static void TurnOffExceptions()
static void SetCurrentContainer(const char *str)
void test_hash_multimap()
void test_hash_multiset()