31#if defined (EH_NEW_IOSTREAMS)
37#if defined(macintosh)&&(!defined(__MRC__) && !defined(__SC__)) || defined (_MAC) && defined(__MWERKS__)
53# if defined (_STL_DEBUG)
55# if defined ( EH_USE_SGI_STL )
59void STLPORT::__stl_debug_message(
const char * format_str, ...)
64 std::vsnprintf(
msg,
sizeof(
msg)/
sizeof(*
msg) - 1, format_str,
args );
65 DebugStr( c2pstr(
msg) );
81 std::strncat(
msg,
": ", 255 );
83 std::strncat(
msg,
", ", 255 );
85 std::sprintf(
line,
"%d", lineno );
87 DebugStr( c2pstr(
msg ) );
98#if defined (EH_NEW_HEADERS)
113# if defined(EH_USE_NAMESPACES)
130 cerr<<
"Usage : "<<
name<<
" [-n <iterations>] [-s <size>] [-l] [-e] [-q]/[-v] [-t] [test_name...]\n";
131 cerr<<
"\t[-n <iterations>] : number of test iterations, default==100;"<<
endl;
132 cerr<<
"\t[-s <size>] : base value for random container sizes, default==1000;"<<
endl;
133 cerr<<
"\t[-e] : don't throw exceptions, test for leak in normal conditions;"<<
endl;
137 cerr<<
"\t[-v] : verbose mode;"<<
endl;
138 cerr<<
"\t[-t] : track each allocation;"<<
endl;
139 cerr<<
"\t[test name [test name...]] : run only some of the tests by name (default==all tests):"<<
endl;
140 cerr<<
"\t\tpossible test names are : algo vector bit_vector list slist deque set map hash_set hash_map rope string bitset valarray"<<
endl;
150#if defined(_WIN32_WCE)
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());
161#if defined( __MWERKS__ ) && defined( macintosh )
167 unsigned int niters=2;
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;
187#if defined (EH_NEW_IOSTREAMS)
188 std::ios_base::sync_with_stdio(
false);
191 cerr <<
argv[0]<<
" : Exception handling testsuite.\n";
194 bool track_allocations =
false;
197 for (cur_argv=1; cur_argv<
argc; cur_argv++) {
213 p1 =
argv[++cur_argv];
214 if (p1 && EH_CSTD::sscanf(p1,
"%i", &niters)==1)
215 cerr <<
" Doing "<<niters<<
" iterations\n";
220 track_allocations =
true;
226 p1 =
argv[++cur_argv];
227 if (p1 && EH_CSTD::sscanf(p1,
"%i", &
random_base)==1)
239 if (EH_CSTD::strcmp(
p,
"algo")==0) {
241 }
else if (EH_CSTD::strcmp(
p,
"vector")==0) {
243 }
else if (EH_CSTD::strcmp(
p,
"bit_vector")==0) {
245 }
else if (EH_CSTD::strcmp(
p,
"list")==0) {
247 }
else if (EH_CSTD::strcmp(
p,
"slist")==0) {
249 }
else if (EH_CSTD::strcmp(
p,
"deque")==0) {
251 }
else if (EH_CSTD::strcmp(
p,
"set")==0) {
253 }
else if (EH_CSTD::strcmp(
p,
"map")==0) {
255 }
else if (EH_CSTD::strcmp(
p,
"hash_set")==0) {
257 }
else if (EH_CSTD::strcmp(
p,
"hash_map")==0) {
259 }
else if (EH_CSTD::strcmp(
p,
"rope")==0) {
261 }
else if (EH_CSTD::strcmp(
p,
"string")==0) {
263 }
else if (EH_CSTD::strcmp(
p,
"bitset")==0) {
265 }
else if (EH_CSTD::strcmp(
p,
"valarray")==0) {
277 for (
unsigned i = 0;
i < niters ;
i++ )
279 cerr <<
"iteration #" <<
i <<
"\n";
280 if (run_all || run_algobase) {
282 cerr <<
"EH test : algobase" <<
endl;
285 if (run_all || run_algo) {
291 if (run_all || run_vector) {
297#if defined( EH_BIT_VECTOR_IMPLEMENTED )
298 if (run_all || run_bit_vector) {
300 cerr <<
"EH test : bit_vector" <<
endl;
305 if (run_all || run_list) {
311#if defined( EH_SLIST_IMPLEMENTED )
312 if (run_all || run_slist) {
319 if (run_all || run_deque) {
324 if (run_all || run_set) {
329 cerr <<
"EH test : multiset" <<
endl;
333 if (run_all || run_map) {
338 cerr <<
"EH test : multimap" <<
endl;
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;
352 if (run_all || run_hash_set) {
354 cerr <<
"EH test : hash_set" <<
endl;
357 cerr <<
"EH test : hash_multiset" <<
endl;
362#if defined( EH_ROPE_IMPLEMENTED )
364#if !( defined(__MWERKS__) && __MWERKS__ < 0x1900 )
365 if (run_all || run_rope) {
372#if defined( EH_STRING_IMPLEMENTED )
373 if (run_all || run_string) {
379#if defined( EH_BITSET_IMPLEMENTED )
380 if (run_all || run_bitset) {
386#if defined( EH_VALARRAY_IMPLEMENTED )
387 if (run_all || run_bitset) {
389 cerr <<
"EH test : valarray" <<
endl;
397 cerr <<
"EH test : Done\n";
399#if defined(_WIN32_WCE)
400 cout.rdbuf(old_cout_buf);
401 cerr.rdbuf(old_cerr_buf);
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 const CHAR testfilename[]
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()