Changeset 2204 for trunk/psLib/test/sysUtils
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- Location:
- trunk/psLib/test/sysUtils
- Files:
-
- 8 edited
-
tst_psAbort.c (modified) (6 diffs)
-
tst_psError.c (modified) (11 diffs)
-
tst_psLogMsg.c (modified) (9 diffs)
-
tst_psMemory.c (modified) (27 diffs)
-
tst_psString.c (modified) (12 diffs)
-
tst_psStringCopy.c (modified) (12 diffs)
-
tst_psTrace.c (modified) (11 diffs)
-
verified/tst_psTrace.stderr (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psAbort.c
r1701 r2204 8 8 * @author Eric Van Alst, MHPCC 9 9 * 10 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2004- 09-07 21:26:13 $10 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-27 00:57:33 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 17 17 #include "psTest.h" 18 18 19 static inttestAbort00(void);20 static inttestAbort01(void);21 static inttestAbort02(void);19 static psS32 testAbort00(void); 20 static psS32 testAbort01(void); 21 static psS32 testAbort02(void); 22 22 23 23 testDescription tests[] = { … … 28 28 }; 29 29 30 int main( intargc, char* argv[] )30 psS32 main( psS32 argc, char* argv[] ) 31 31 { 32 32 psLogSetLevel( PS_LOG_INFO ); … … 35 35 } 36 36 37 static inttestAbort00(void)37 static psS32 testAbort00(void) 38 38 { 39 intintval = 1;40 longlongval = 2;39 psS32 intval = 1; 40 psS64 longval = 2; 41 41 float floatval = 3.01; 42 42 char charval = 'E'; … … 54 54 } 55 55 56 static inttestAbort01(void)56 static psS32 testAbort01(void) 57 57 { 58 58 // Test point #2 String values in abort message … … 65 65 } 66 66 67 static inttestAbort02(void)67 static psS32 testAbort02(void) 68 68 { 69 69 // Test point #2 String values in abort message -
trunk/psLib/test/sysUtils/tst_psError.c
r2129 r2204 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-10- 14 21:14:58$15 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-10-27 00:57:33 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psTest.h" 27 27 28 static inttestError00(void);29 static inttestError01(void);30 static inttestError02(void);31 static inttestError03(void);32 static inttestError04(void);33 static inttestError05(void);34 static inttestErrorRegister(void);28 static psS32 testError00(void); 29 static psS32 testError01(void); 30 static psS32 testError02(void); 31 static psS32 testError03(void); 32 static psS32 testError04(void); 33 static psS32 testError05(void); 34 static psS32 testErrorRegister(void); 35 35 36 36 // Function used in testError02 to verify the psErrorStackPrintV function … … 58 58 }; 59 59 60 int main( intargc, char* argv[] )60 psS32 main( psS32 argc, char* argv[] ) 61 61 { 62 62 psLogSetLevel( PS_LOG_INFO ); … … 65 65 } 66 66 67 static inttestError05(void)67 static psS32 testError05(void) 68 68 { 69 69 psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE; … … 81 81 } 82 82 83 static inttestError04(void)83 static psS32 testError04(void) 84 84 { 85 85 psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE; … … 134 134 } 135 135 136 static inttestError03(void)136 static psS32 testError03(void) 137 137 { 138 138 psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE; … … 214 214 } 215 215 216 static inttestError02(void)216 static psS32 testError02(void) 217 217 { 218 218 psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE; … … 228 228 } 229 229 230 static inttestError01(void)230 static psS32 testError01(void) 231 231 { 232 232 psErrorCode code=PS_ERR_BAD_PARAMETER_VALUE; … … 277 277 } 278 278 279 static inttestError00(void)280 { 281 282 intintval=1;283 longlongval = 2;279 static psS32 testError00(void) 280 { 281 282 psS32 intval=1; 283 psS64 longval = 2; 284 284 float floatval = 3.01; 285 285 char charval = 'E'; … … 300 300 } 301 301 302 static inttestErrorRegister(void)303 { 304 305 intnumErr = 4;302 static psS32 testErrorRegister(void) 303 { 304 305 psS32 numErr = 4; 306 306 psErrorDescription errDesc[] = { {PS_ERR_N_ERR_CLASSES+1,"first"}, 307 307 {PS_ERR_N_ERR_CLASSES+2,"second"}, … … 314 314 psErrorRegister(errDesc,numErr); 315 315 316 for ( inti = 0; i < numErr; i++) {316 for (psS32 i = 0; i < numErr; i++) { 317 317 const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i); 318 318 if (desc == NULL) { -
trunk/psLib/test/sysUtils/tst_psLogMsg.c
r1702 r2204 8 8 #include "psTest.h" 9 9 10 static inttestLogMsg00();11 static inttestLogMsg01();12 static inttestLogMsg02();13 static inttestLogMsg03();14 static inttestLogMsg04();15 static inttestLogMsg05();10 static psS32 testLogMsg00(); 11 static psS32 testLogMsg01(); 12 static psS32 testLogMsg02(); 13 static psS32 testLogMsg03(); 14 static psS32 testLogMsg04(); 15 static psS32 testLogMsg05(); 16 16 17 17 testDescription tests[] = { … … 39 39 }; 40 40 41 int main( intargc, char* argv[] )41 psS32 main( psS32 argc, char* argv[] ) 42 42 { 43 43 psLogSetLevel( PS_LOG_INFO ); … … 48 48 49 49 static void myLogMsg(const char *name, 50 intlevel,50 psS32 level, 51 51 const char *fmt, 52 52 ...) … … 60 60 } 61 61 62 static inttestLogMsg00()63 { 64 inti = 0;62 static psS32 testLogMsg00() 63 { 64 psS32 i = 0; 65 65 66 66 // Send a log messages for levels 0:9. Only the first four messages … … 74 74 } 75 75 76 static inttestLogMsg01()77 { 78 inti = 0;76 static psS32 testLogMsg01() 77 { 78 psS32 i = 0; 79 79 80 80 // Send a log messages for levels 0:9. Only the first four messages … … 88 88 } 89 89 90 static inttestLogMsg02()90 static psS32 testLogMsg02() 91 91 { 92 92 93 93 psLogSetLevel(9); 94 94 // Send a log messages for levels 0:9. 95 for ( inti=0;i<10;i++) {95 for (psS32 i=0;i<10;i++) { 96 96 psLogMsg(__func__, i, "Hello World! My level is %d\n", i); 97 97 } … … 105 105 } 106 106 107 static inttestLogMsg03()108 { 109 inti;107 static psS32 testLogMsg03() 108 { 109 psS32 i; 110 110 111 111 fprintf(stderr,"------------- psLogSetFormat() -------------\n"); … … 161 161 162 162 163 inttestLogMsg04()163 psS32 testLogMsg04() 164 164 { 165 165 psLogMsg("Under 15 chars", 0, "Hello World!\n"); … … 173 173 } 174 174 175 inttestLogMsg05()176 { 177 inti = 0;175 psS32 testLogMsg05() 176 { 177 psS32 i = 0; 178 178 FILE* file; 179 179 char line[256]; -
trunk/psLib/test/sysUtils/tst_psMemory.c
r1811 r2204 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2004- 09-14 23:55:47$8 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-27 00:57:33 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "pslib.h" 27 27 28 static intTPFreeReferencedMemory( void );29 static intTPOutOfMemory( void );30 static intTPReallocOutOfMemory( void );31 static void*TPOutOfMemoryExhaustedCallback( size_t size );32 static intTPCheckBufferPositive( void );33 static intTPrealloc( void );34 static intTPallocCallback( void );28 static psS32 TPFreeReferencedMemory( void ); 29 static psS32 TPOutOfMemory( void ); 30 static psS32 TPReallocOutOfMemory( void ); 31 static psPtr TPOutOfMemoryExhaustedCallback( size_t size ); 32 static psS32 TPCheckBufferPositive( void ); 33 static psS32 TPrealloc( void ); 34 static psS32 TPallocCallback( void ); 35 35 static psMemoryId memAllocateCallback( const psMemBlock *ptr ); 36 36 static psMemoryId memFreeCallback( const psMemBlock *ptr ); 37 static intTPcheckLeaks( void );38 static intTPmemCorruption( void );39 static intTPmultipleFree( void );40 void memProblemCallback( const psMemBlock *ptr, const char *file, intlineno );41 42 static intproblemCallbackCalled = 0;43 static intallocCallbackCalled = 0;44 static intfreeCallbackCalled = 0;45 static intexhaustedCallbackCalled = 0;37 static psS32 TPcheckLeaks( void ); 38 static psS32 TPmemCorruption( void ); 39 static psS32 TPmultipleFree( void ); 40 void memProblemCallback( const psMemBlock *ptr, const char *file, psS32 lineno ); 41 42 static psS32 problemCallbackCalled = 0; 43 static psS32 allocCallbackCalled = 0; 44 static psS32 freeCallbackCalled = 0; 45 static psS32 exhaustedCallbackCalled = 0; 46 46 47 47 testDescription tests[] = { … … 81 81 }; 82 82 83 int main( intargc, char* argv[] )83 psS32 main( psS32 argc, char* argv[] ) 84 84 { 85 85 psLogSetLevel( PS_LOG_INFO ); … … 89 89 90 90 // Testpoint #449, psAlloc shall allocate memory blocks writeable by caller. 91 intTPCheckBufferPositive( void )92 { 93 int* mem;94 const intsize = 100;95 intfailed = 0;91 psS32 TPCheckBufferPositive( void ) 92 { 93 psS32 * mem; 94 const psS32 size = 100; 95 psS32 failed = 0; 96 96 97 97 psLogMsg( __func__, PS_LOG_INFO, "psAlloc shall allocate memory blocks writeable by caller.\n" ); 98 98 99 mem = ( int* ) psAlloc( size * sizeof( int) );99 mem = ( psS32* ) psAlloc( size * sizeof( psS32 ) ); 100 100 if ( mem == NULL ) { 101 101 psError( __FILE__, "psAlloc returned a NULL value in %s!", __func__ ); … … 103 103 } 104 104 105 for ( intindex = 0;index < size;index++ ) {105 for ( psS32 index = 0;index < size;index++ ) { 106 106 mem[ index ] = index; 107 107 } 108 108 109 for ( intindex = 0;index < size;index++ ) {109 for ( psS32 index = 0;index < size;index++ ) { 110 110 if ( mem[ index ] != index ) { 111 111 failed++; … … 118 118 } 119 119 120 intTPFreeReferencedMemory( void )120 psS32 TPFreeReferencedMemory( void ) 121 121 { 122 122 // create memory 123 int* mem;124 intref = 0;123 psS32 * mem; 124 psS32 ref = 0; 125 125 126 126 psLogMsg( __func__, PS_LOG_INFO, "memory reference count shall be incrementable/decrementable" ); 127 127 128 mem = ( int* ) psAlloc( 100 * sizeof( int) );128 mem = ( psS32* ) psAlloc( 100 * sizeof( psS32 ) ); 129 129 130 130 ref = psMemGetRefCounter( mem ); … … 170 170 // Bug/Task #562 regression test. Upon requesting more memory than is available, psRealloc shall call 171 171 // the psMemExhaustedCallback. 172 intTPReallocOutOfMemory( void )173 { 174 int* mem[ 100 ];172 psS32 TPReallocOutOfMemory( void ) 173 { 174 psS32 * mem[ 100 ]; 175 175 psMemExhaustedCallback cb; 176 176 177 for ( intlcv = 0; lcv < 100; lcv++ ) {177 for ( psS32 lcv = 0; lcv < 100; lcv++ ) { 178 178 mem[ lcv ] = NULL; 179 179 } … … 186 186 cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback ); 187 187 188 for ( intlcv = 0; lcv < 100; lcv++ ) {189 mem[ lcv ] = ( int* ) psAlloc( 10 );190 } 191 192 for ( intlcv = 0; lcv < 100; lcv++ ) {193 mem[ lcv ] = ( int* ) psRealloc( mem[ lcv ], SIZE_MAX/2 - 1000 );188 for ( psS32 lcv = 0; lcv < 100; lcv++ ) { 189 mem[ lcv ] = ( psS32* ) psAlloc( 10 ); 190 } 191 192 for ( psS32 lcv = 0; lcv < 100; lcv++ ) { 193 mem[ lcv ] = ( psS32* ) psRealloc( mem[ lcv ], SIZE_MAX/2 - 1000 ); 194 194 } 195 195 … … 201 201 } 202 202 203 for ( intlcv = 0; lcv < 100; lcv++ ) {203 for ( psS32 lcv = 0; lcv < 100; lcv++ ) { 204 204 psFree( mem[ lcv ] ); 205 205 } … … 209 209 // Testpoint #450, Upon requesting more memory than is available, psalloc shall call 210 210 // the psMemExhaustedCallback. 211 intTPOutOfMemory( void )212 { 213 int* mem[ 100 ];211 psS32 TPOutOfMemory( void ) 212 { 213 psS32 * mem[ 100 ]; 214 214 psMemExhaustedCallback cb; 215 215 216 for ( intlcv = 0; lcv < 100; lcv++ ) {216 for ( psS32 lcv = 0; lcv < 100; lcv++ ) { 217 217 mem[ lcv ] = NULL; 218 218 } … … 225 225 cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback ); 226 226 227 for ( intlcv = 0; lcv < 100; lcv++ ) {228 mem[ lcv ] = ( int* ) psAlloc( SIZE_MAX/2 - 1000 );227 for ( psS32 lcv = 0; lcv < 100; lcv++ ) { 228 mem[ lcv ] = ( psS32* ) psAlloc( SIZE_MAX/2 - 1000 ); 229 229 } 230 230 … … 236 236 } 237 237 238 for ( intlcv = 0; lcv < 100; lcv++ ) {238 for ( psS32 lcv = 0; lcv < 100; lcv++ ) { 239 239 psFree( mem[ lcv ] ); 240 240 } … … 244 244 245 245 // Testpoint #451, psRealloc shall increase/decrease memory buffer while preserving contents 246 intTPrealloc( void )247 { 248 int* mem1;249 int* mem2;250 int* mem3;251 const intinitialSize = 100;246 psS32 TPrealloc( void ) 247 { 248 psS32 * mem1; 249 psS32* mem2; 250 psS32* mem3; 251 const psS32 initialSize = 100; 252 252 253 253 psLogMsg( __func__, PS_LOG_INFO, "psRealloc shall increase/decrease memory buffer while " … … 255 255 256 256 // allocate buffer with known values. 257 mem1 = ( int* ) psAlloc( initialSize * sizeof( int) );258 mem2 = ( int* ) psAlloc( initialSize * sizeof( int) );259 mem3 = ( int* ) psAlloc( initialSize * sizeof( int) );260 for ( intlcv = 0;lcv < initialSize;lcv++ ) {257 mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) ); 258 mem2 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) ); 259 mem3 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) ); 260 for ( psS32 lcv = 0;lcv < initialSize;lcv++ ) { 261 261 mem1[ lcv ] = mem2[ lcv ] = mem3[ lcv ] = lcv; 262 262 } … … 266 266 267 267 // realloc to 2x 268 mem1 = ( int* ) psRealloc( mem1, 2 * initialSize * sizeof( int) );269 mem2 = ( int* ) psRealloc( mem2, 2 * initialSize * sizeof( int) );270 mem3 = ( int* ) psRealloc( mem3, 2 * initialSize * sizeof( int) );268 mem1 = ( psS32* ) psRealloc( mem1, 2 * initialSize * sizeof( psS32 ) ); 269 mem2 = ( psS32* ) psRealloc( mem2, 2 * initialSize * sizeof( psS32 ) ); 270 mem3 = ( psS32* ) psRealloc( mem3, 2 * initialSize * sizeof( psS32 ) ); 271 271 272 272 // check values of initial block 273 for ( inti = 0;i < initialSize;i++ ) {273 for ( psS32 i = 0;i < initialSize;i++ ) { 274 274 if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) { 275 275 psError( __FILE__, "Realloc didn't preserve the contents with expanding buffer in %s.", … … 283 283 284 284 // realloc to 1/2 initial value. 285 mem1 = ( int* ) psRealloc( mem1, ( initialSize / 2 ) * sizeof( int) );286 mem2 = ( int* ) psRealloc( mem2, ( initialSize / 2 ) * sizeof( int) );287 mem3 = ( int* ) psRealloc( mem3, ( initialSize / 2 ) * sizeof( int) );285 mem1 = ( psS32* ) psRealloc( mem1, ( initialSize / 2 ) * sizeof( psS32 ) ); 286 mem2 = ( psS32* ) psRealloc( mem2, ( initialSize / 2 ) * sizeof( psS32 ) ); 287 mem3 = ( psS32* ) psRealloc( mem3, ( initialSize / 2 ) * sizeof( psS32 ) ); 288 288 289 289 // check values of initial block 290 for ( inti = 0;i < initialSize / 2;i++ ) {290 for ( psS32 i = 0;i < initialSize / 2;i++ ) { 291 291 if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) { 292 292 psError( __FILE__, "Realloc didn't preserve the contents with shrinking buffer in %s.", … … 303 303 } 304 304 305 intTPallocCallback( void )306 { 307 int* mem1;308 int* mem2;309 int* mem3;310 intcurrentId = psMemGetId();311 const intinitialSize = 100;312 intmark;305 psS32 TPallocCallback( void ) 306 { 307 psS32 * mem1; 308 psS32* mem2; 309 psS32* mem3; 310 psS32 currentId = psMemGetId(); 311 const psS32 initialSize = 100; 312 psS32 mark; 313 313 314 314 allocCallbackCalled = 0; … … 324 324 325 325 // allocate buffer with known values. 326 mem1 = ( int* ) psAlloc( initialSize * sizeof( int) );327 mem2 = ( int* ) psAlloc( initialSize * sizeof( int) );328 mem3 = ( int* ) psAlloc( initialSize * sizeof( int) );326 mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) ); 327 mem2 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) ); 328 mem3 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) ); 329 329 330 330 psFree( mem1 ); … … 343 343 mark = psMemGetId(); 344 344 345 mem1 = ( int* ) psAlloc( initialSize * sizeof( int) );345 mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) ); 346 346 347 347 psMemAllocateCallbackSetID( mark ); 348 348 349 mem1 = ( int* ) psRealloc( mem1, initialSize * 2 * sizeof( int) );349 mem1 = ( psS32* ) psRealloc( mem1, initialSize * 2 * sizeof( psS32 ) ); 350 350 351 351 psFree( mem1 ); … … 361 361 } 362 362 363 intTPcheckLeaks( void )364 { 365 const intnumBuffers = 5;366 int* buffers[ 5 ];367 intlcv;368 intcurrentId = psMemGetId();363 psS32 TPcheckLeaks( void ) 364 { 365 const psS32 numBuffers = 5; 366 psS32* buffers[ 5 ]; 367 psS32 lcv; 368 psS32 currentId = psMemGetId(); 369 369 psMemBlock** blks; 370 intnLeaks = 0;371 intlineMark = 0;370 psS32 nLeaks = 0; 371 psS32 lineMark = 0; 372 372 373 373 psLogMsg( __func__, PS_LOG_INFO, "psMemCheckLeaks shall return the number of blocks above an ID " … … 376 376 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 377 377 lineMark = __LINE__ + 1; 378 buffers[ lcv ] = psAlloc( sizeof( int) );378 buffers[ lcv ] = psAlloc( sizeof( psS32 ) ); 379 379 } 380 380 … … 406 406 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 407 407 lineMark = __LINE__ + 1; 408 buffers[ lcv ] = psAlloc( sizeof( int) );408 buffers[ lcv ] = psAlloc( sizeof( psS32 ) ); 409 409 } 410 410 … … 434 434 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 435 435 lineMark = __LINE__ + 1; 436 buffers[ lcv ] = psAlloc( sizeof( int) );436 buffers[ lcv ] = psAlloc( sizeof( psS32 ) ); 437 437 } 438 438 … … 464 464 } 465 465 466 intTPmemCorruption( void )467 { 468 int* buffer = NULL;469 intoldValue = 0;470 intcorruptions = 0;466 psS32 TPmemCorruption( void ) 467 { 468 psS32 * buffer = NULL; 469 psS32 oldValue = 0; 470 psS32 corruptions = 0; 471 471 psMemProblemCallback cb; 472 472 473 473 psLogMsg( __func__, PS_LOG_INFO, "psMemCheckCorruption shall detect memory corruptions" ); 474 474 475 buffer = psAlloc( sizeof( int) );475 buffer = psAlloc( sizeof( psS32 ) ); 476 476 477 477 // cause memory corruption via buffer underflow … … 514 514 } 515 515 516 void memProblemCallback( const psMemBlock *ptr, const char *file, intlineno )516 void memProblemCallback( const psMemBlock *ptr, const char *file, psS32 lineno ) 517 517 { 518 518 psLogMsg( __func__, PS_LOG_INFO, "memory callback called for id %d (%s:%d).", … … 536 536 } 537 537 538 void*TPOutOfMemoryExhaustedCallback( size_t size )538 psPtr TPOutOfMemoryExhaustedCallback( size_t size ) 539 539 { 540 540 psLogMsg( __func__, PS_LOG_INFO, "Custom MemExhaustedCallback was invoked." ); … … 543 543 } 544 544 545 intTPmultipleFree( void )546 { 547 548 void *buffer = psAlloc( 1024 );545 psS32 TPmultipleFree( void ) 546 { 547 548 psPtr buffer = psAlloc( 1024 ); 549 549 550 550 psFree( buffer ); -
trunk/psLib/test/sysUtils/tst_psString.c
r1977 r2204 17 17 * @author Eric Van Alst, MHPCC 18 18 * 19 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $20 * @date $Date: 2004-10- 06 01:59:08$19 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-10-27 00:57:33 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psTest.h" 29 29 30 static inttestStringCopy00(void);31 static inttestStringCopy01(void);32 static inttestStringCopy02(void);33 static inttestStringCopy03(void);34 static inttestStringCopy04(void);35 static inttestStringCopy05(void);36 static inttestStringCopy06(void);30 static psS32 testStringCopy00(void); 31 static psS32 testStringCopy01(void); 32 static psS32 testStringCopy02(void); 33 static psS32 testStringCopy03(void); 34 static psS32 testStringCopy04(void); 35 static psS32 testStringCopy05(void); 36 static psS32 testStringCopy06(void); 37 37 38 38 testDescription tests[] = { … … 47 47 }; 48 48 49 int main( intargc, char* argv[] )49 psS32 main( psS32 argc, char* argv[] ) 50 50 { 51 51 psLogSetLevel( PS_LOG_INFO ); … … 55 55 56 56 /* 57 int main( intargc,57 psS32 main( psS32 argc, 58 58 char * argv[] ) 59 59 { 60 bool tpResult = false;60 psBool tpResult = false; 61 61 char stringval[20] = "E R R O R"; 62 62 char stringval1[20] = "e r r o r"; 63 63 char *stringvalnocopy = "F A I L"; 64 64 char *substringval = "e r r"; 65 intsubstringlen = 6;65 psS32 substringlen = 6; 66 66 char *emptyval = ""; 67 inttpFails = 0;68 char *strResult; 69 intincreaseSize = 5;70 intnegativeSize = -5;71 intresult = 0;72 intresult1 = 0;73 intmemBlockAllocated = 0;67 psS32 tpFails = 0; 68 char *strResult; 69 psS32 increaseSize = 5; 70 psS32 negativeSize = -5; 71 psS32 result = 0; 72 psS32 result1 = 0; 73 psS32 memBlockAllocated = 0; 74 74 psMemBlock ***memBlockPtr = NULL; 75 75 76 76 */ 77 77 78 static inttestStringCopy00(void)79 { 80 char stringval[20] = "E R R O R"; 81 intresult = 0;82 intresult1 = 0;78 static psS32 testStringCopy00(void) 79 { 80 char stringval[20] = "E R R O R"; 81 psS32 result = 0; 82 psS32 result1 = 0; 83 83 char *strResult; 84 84 … … 107 107 } 108 108 109 static inttestStringCopy01(void)109 static psS32 testStringCopy01(void) 110 110 { 111 111 char *emptyval = ""; 112 intresult = 0;112 psS32 result = 0; 113 113 char *strResult; 114 114 … … 130 130 } 131 131 132 static inttestStringCopy02(void)133 { 134 intresult = 0;135 intresult1 = 0;132 static psS32 testStringCopy02(void) 133 { 134 psS32 result = 0; 135 psS32 result1 = 0; 136 136 char *strResult; 137 137 char stringval1[20] = "e r r o r"; 138 intsubstringlen = 5;138 psS32 substringlen = 5; 139 139 char *substringval = "e r r"; 140 140 … … 161 161 } 162 162 163 static inttestStringCopy03(void)164 { 165 intresult = 0;166 intresult1 = 0;163 static psS32 testStringCopy03(void) 164 { 165 psS32 result = 0; 166 psS32 result1 = 0; 167 167 char *strResult; 168 168 char *stringvalnocopy = "F A I L"; … … 185 185 } 186 186 187 static inttestStringCopy04(void)188 { 189 intresult = 0;190 intresult1 = 0;191 char *strResult; 192 char stringval[20] = "E R R O R"; 193 intincreaseSize = 5;187 static psS32 testStringCopy04(void) 188 { 189 psS32 result = 0; 190 psS32 result1 = 0; 191 char *strResult; 192 char stringval[20] = "E R R O R"; 193 psS32 increaseSize = 5; 194 194 195 195 // Test point #5 Copy string to larger string - psStringNCopy … … 205 205 strResult, stringval); 206 206 fprintf(stderr," strlne result = %d expected %d\n",result1, 207 ( int)strlen(stringval));207 (psS32)strlen(stringval)); 208 208 return 1; 209 209 } … … 214 214 } 215 215 216 static inttestStringCopy05(void)217 { 218 char *strResult; 219 char stringval[20] = "E R R O R"; 220 intnegativeSize = -5;216 static psS32 testStringCopy05(void) 217 { 218 char *strResult; 219 char stringval[20] = "E R R O R"; 220 psS32 negativeSize = -5; 221 221 222 222 // Test point #6 Copy string with negative size - psStringNCopy … … 224 224 if ( strResult != NULL ) { 225 225 fprintf(stderr,"Failed test point #6 return value = %ld expected NULL\n", 226 ( unsigned long)strResult);226 (psU64)strResult); 227 227 return 1; 228 228 } … … 232 232 } 233 233 234 static inttestStringCopy06(void)235 { 236 char *strResult; 237 char stringval[20] = "E R R O R"; 238 intresult = 0;234 static psS32 testStringCopy06(void) 235 { 236 char *strResult; 237 char stringval[20] = "E R R O R"; 238 psS32 result = 0; 239 239 240 240 // Test point #7 Verify creation of string literal - PS_STRING -
trunk/psLib/test/sysUtils/tst_psStringCopy.c
r1977 r2204 17 17 * @author Eric Van Alst, MHPCC 18 18 * 19 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $20 * @date $Date: 2004-10- 06 01:59:08$19 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-10-27 00:57:33 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psTest.h" 29 29 30 static inttestStringCopy00(void);31 static inttestStringCopy01(void);32 static inttestStringCopy02(void);33 static inttestStringCopy03(void);34 static inttestStringCopy04(void);35 static inttestStringCopy05(void);36 static inttestStringCopy06(void);30 static psS32 testStringCopy00(void); 31 static psS32 testStringCopy01(void); 32 static psS32 testStringCopy02(void); 33 static psS32 testStringCopy03(void); 34 static psS32 testStringCopy04(void); 35 static psS32 testStringCopy05(void); 36 static psS32 testStringCopy06(void); 37 37 38 38 testDescription tests[] = { … … 47 47 }; 48 48 49 int main( intargc, char* argv[] )49 psS32 main( psS32 argc, char* argv[] ) 50 50 { 51 51 psLogSetLevel( PS_LOG_INFO ); … … 55 55 56 56 /* 57 int main( intargc,57 psS32 main( psS32 argc, 58 58 char * argv[] ) 59 59 { 60 bool tpResult = false;60 psBool tpResult = false; 61 61 char stringval[20] = "E R R O R"; 62 62 char stringval1[20] = "e r r o r"; 63 63 char *stringvalnocopy = "F A I L"; 64 64 char *substringval = "e r r"; 65 intsubstringlen = 6;65 psS32 substringlen = 6; 66 66 char *emptyval = ""; 67 inttpFails = 0;68 char *strResult; 69 intincreaseSize = 5;70 intnegativeSize = -5;71 intresult = 0;72 intresult1 = 0;73 intmemBlockAllocated = 0;67 psS32 tpFails = 0; 68 char *strResult; 69 psS32 increaseSize = 5; 70 psS32 negativeSize = -5; 71 psS32 result = 0; 72 psS32 result1 = 0; 73 psS32 memBlockAllocated = 0; 74 74 psMemBlock ***memBlockPtr = NULL; 75 75 76 76 */ 77 77 78 static inttestStringCopy00(void)79 { 80 char stringval[20] = "E R R O R"; 81 intresult = 0;82 intresult1 = 0;78 static psS32 testStringCopy00(void) 79 { 80 char stringval[20] = "E R R O R"; 81 psS32 result = 0; 82 psS32 result1 = 0; 83 83 char *strResult; 84 84 … … 107 107 } 108 108 109 static inttestStringCopy01(void)109 static psS32 testStringCopy01(void) 110 110 { 111 111 char *emptyval = ""; 112 intresult = 0;112 psS32 result = 0; 113 113 char *strResult; 114 114 … … 130 130 } 131 131 132 static inttestStringCopy02(void)133 { 134 intresult = 0;135 intresult1 = 0;132 static psS32 testStringCopy02(void) 133 { 134 psS32 result = 0; 135 psS32 result1 = 0; 136 136 char *strResult; 137 137 char stringval1[20] = "e r r o r"; 138 intsubstringlen = 5;138 psS32 substringlen = 5; 139 139 char *substringval = "e r r"; 140 140 … … 161 161 } 162 162 163 static inttestStringCopy03(void)164 { 165 intresult = 0;166 intresult1 = 0;163 static psS32 testStringCopy03(void) 164 { 165 psS32 result = 0; 166 psS32 result1 = 0; 167 167 char *strResult; 168 168 char *stringvalnocopy = "F A I L"; … … 185 185 } 186 186 187 static inttestStringCopy04(void)188 { 189 intresult = 0;190 intresult1 = 0;191 char *strResult; 192 char stringval[20] = "E R R O R"; 193 intincreaseSize = 5;187 static psS32 testStringCopy04(void) 188 { 189 psS32 result = 0; 190 psS32 result1 = 0; 191 char *strResult; 192 char stringval[20] = "E R R O R"; 193 psS32 increaseSize = 5; 194 194 195 195 // Test point #5 Copy string to larger string - psStringNCopy … … 205 205 strResult, stringval); 206 206 fprintf(stderr," strlne result = %d expected %d\n",result1, 207 ( int)strlen(stringval));207 (psS32)strlen(stringval)); 208 208 return 1; 209 209 } … … 214 214 } 215 215 216 static inttestStringCopy05(void)217 { 218 char *strResult; 219 char stringval[20] = "E R R O R"; 220 intnegativeSize = -5;216 static psS32 testStringCopy05(void) 217 { 218 char *strResult; 219 char stringval[20] = "E R R O R"; 220 psS32 negativeSize = -5; 221 221 222 222 // Test point #6 Copy string with negative size - psStringNCopy … … 224 224 if ( strResult != NULL ) { 225 225 fprintf(stderr,"Failed test point #6 return value = %ld expected NULL\n", 226 ( unsigned long)strResult);226 (psU64)strResult); 227 227 return 1; 228 228 } … … 232 232 } 233 233 234 static inttestStringCopy06(void)235 { 236 char *strResult; 237 char stringval[20] = "E R R O R"; 238 intresult = 0;234 static psS32 testStringCopy06(void) 235 { 236 char *strResult; 237 char stringval[20] = "E R R O R"; 238 psS32 result = 0; 239 239 240 240 // Test point #7 Verify creation of string literal - PS_STRING -
trunk/psLib/test/sysUtils/tst_psTrace.c
r2202 r2204 10 10 11 11 12 static inttestTrace00(void);13 static inttestTrace01(void);14 static inttestTrace02(void);15 static inttestTrace03(void);16 static inttestTrace04(void);17 static inttestTrace05(void);18 static inttestTrace05a(void);19 static inttestTrace06(void);20 static inttestTrace08(void);12 static psS32 testTrace00(void); 13 static psS32 testTrace01(void); 14 static psS32 testTrace02(void); 15 static psS32 testTrace03(void); 16 static psS32 testTrace04(void); 17 static psS32 testTrace05(void); 18 static psS32 testTrace05a(void); 19 static psS32 testTrace06(void); 20 static psS32 testTrace08(void); 21 21 22 22 testDescription tests[] = { … … 37 37 }; 38 38 39 int main( intargc, char* argv[] )39 psS32 main( psS32 argc, char* argv[] ) 40 40 { 41 41 psLogSetLevel( PS_LOG_INFO ); … … 44 44 } 45 45 46 static inttestTrace00(void)47 { 48 inti;49 intlev = 0;46 static psS32 testTrace00(void) 47 { 48 psS32 i; 49 psS32 lev = 0; 50 50 51 51 psTraceSetDestination(stderr); … … 94 94 } 95 95 96 static inttestTrace01(void)96 static psS32 testTrace01(void) 97 97 { 98 98 psTraceSetDestination(stderr); … … 104 104 } 105 105 106 static inttestTrace02(void)106 static psS32 testTrace02(void) 107 107 { 108 108 psTraceReset(); … … 133 133 } 134 134 135 static inttestTrace03(void)136 { 137 inti = 0;138 intlev = 0;135 static psS32 testTrace03(void) 136 { 137 psS32 i = 0; 138 psS32 lev = 0; 139 139 140 140 psTraceSetDestination(stderr); … … 176 176 177 177 178 static inttestTrace04(void)178 static psS32 testTrace04(void) 179 179 { 180 180 FILE *fp; 181 intnb = 0;181 psS32 nb = 0; 182 182 183 183 fp = fopen("tst_psTrace02_OUT", "w"); … … 221 221 } 222 222 223 static inttestTrace05(void)223 static psS32 testTrace05(void) 224 224 { 225 225 psTraceSetDestination(stderr); … … 247 247 } 248 248 249 static inttestTrace05a(void)249 static psS32 testTrace05a(void) 250 250 { 251 251 (void)psTraceSetLevel(".", 9); … … 271 271 } 272 272 273 static inttestTrace06(void)273 static psS32 testTrace06(void) 274 274 { 275 275 psTraceSetDestination(stderr); … … 311 311 312 312 // Ensure that the leading dot in the component names are optional. 313 static inttestTrace08(void)313 static psS32 testTrace08(void) 314 314 { 315 315 psTraceReset(); -
trunk/psLib/test/sysUtils/verified/tst_psTrace.stderr
r2110 r2204 25 25 /***************************** TESTPOINT ******************************************\ 26 26 * TestFile: tst_psTrace.c * 27 * TestPoint: psTrace{psTraceSetLevel(): test static inheritance}*27 * TestPoint: psTrace{psTraceSetLevel(): test static/dynamic inheritance} * 28 28 * TestType: Positive * 29 29 \**********************************************************************************/ … … 42 42 E 5 43 43 44 ---> TESTPOINT PASSED (psTrace{psTraceSetLevel(): test static inheritance} | tst_psTrace.c)44 ---> TESTPOINT PASSED (psTrace{psTraceSetLevel(): test static/dynamic inheritance} | tst_psTrace.c) 45 45 46 46 /***************************** TESTPOINT ******************************************\
Note:
See TracChangeset
for help on using the changeset viewer.
