Changeset 2273 for trunk/psLib/test/sysUtils/tst_psMemory.c
- Timestamp:
- Nov 3, 2004, 3:05:00 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sysUtils/tst_psMemory.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psMemory.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-11-04 01:05:00 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 99 99 mem = ( psS32* ) psAlloc( size * sizeof( psS32 ) ); 100 100 if ( mem == NULL ) { 101 psError( __FILE__, "psAlloc returned a NULL value in %s!", __func__ );101 psError(PS_ERR_UNKNOWN, true, "psAlloc returned a NULL value in %s!", __func__ ); 102 102 return 1; 103 103 } … … 130 130 ref = psMemGetRefCounter( mem ); 131 131 if ( ref != 1 ) { 132 psError( __func__, "Expected to buffer reference count to be initially 1, but it was %d.", ref );132 psError(PS_ERR_UNKNOWN, true, "Expected to buffer reference count to be initially 1, but it was %d.", ref ); 133 133 return 1; 134 134 } … … 140 140 ref = psMemGetRefCounter( mem ); 141 141 if ( ref != 4 ) { 142 psError( __func__, "Expected to find buffer reference count to be 4, but it was %d.", ref );142 psError(PS_ERR_UNKNOWN, true, "Expected to find buffer reference count to be 4, but it was %d.", ref ); 143 143 return 1; 144 144 } … … 149 149 ref = psMemGetRefCounter( mem ); 150 150 if ( ref != 2 ) { 151 psError( __func__, "Expected to find buffer reference count to be 2, but it was %d.", ref );151 psError(PS_ERR_UNKNOWN, true, "Expected to find buffer reference count to be 2, but it was %d.", ref ); 152 152 return 1; 153 153 } … … 159 159 ref = psMemGetRefCounter( mem ); 160 160 if ( ref != 1 ) { 161 psError( __func__, "Expected to find buffer reference count to be 1, but it was %d.", ref );161 psError(PS_ERR_UNKNOWN, true, "Expected to find buffer reference count to be 1, but it was %d.", ref ); 162 162 return 1; 163 163 } … … 197 197 198 198 if ( exhaustedCallbackCalled == 0 ) { 199 psError( __FILE__, "Called psRealloc with HUGE memory requirement and survived in %s!", __func__ );199 psError(PS_ERR_UNKNOWN,true, "Called psRealloc with HUGE memory requirement and survived in %s!", __func__ ); 200 200 return 1; 201 201 } … … 232 232 233 233 if ( exhaustedCallbackCalled == 0 ) { 234 psError( __FILE__, "Called psAlloc with HUGE memory requirement and survived in %s!", __func__ );234 psError(PS_ERR_UNKNOWN,true, "Called psAlloc with HUGE memory requirement and survived in %s!", __func__ ); 235 235 return 1; 236 236 } … … 273 273 for ( psS32 i = 0;i < initialSize;i++ ) { 274 274 if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) { 275 psError( __FILE__, "Realloc didn't preserve the contents with expanding buffer in %s.",276 __func__ );275 psError(PS_ERR_UNKNOWN,true, "Realloc didn't preserve the contents with expanding buffer in %s.", 276 __func__ ); 277 277 break; 278 278 } … … 290 290 for ( psS32 i = 0;i < initialSize / 2;i++ ) { 291 291 if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) { 292 psError( __FILE__, "Realloc didn't preserve the contents with shrinking buffer in %s.",293 __func__ );292 psError(PS_ERR_UNKNOWN,true, "Realloc didn't preserve the contents with shrinking buffer in %s.", 293 __func__ ); 294 294 break; 295 295 } … … 333 333 334 334 if ( allocCallbackCalled != 2 || freeCallbackCalled != 2 ) { 335 psError( __FILE__, "alloc/free callbacks were not called the proper number of times in %s",336 __func__ );335 psError(PS_ERR_UNKNOWN,true, "alloc/free callbacks were not called the proper number of times in %s", 336 __func__ ); 337 337 return 1; 338 338 } … … 352 352 353 353 if ( allocCallbackCalled != 2 ) { 354 psError( __FILE__, "realloc callbacks were not called the proper number of times in %s",355 __func__ );354 psError(PS_ERR_UNKNOWN,true, "realloc callbacks were not called the proper number of times in %s", 355 __func__ ); 356 356 return 1; 357 357 } … … 388 388 389 389 if ( nLeaks != 1 ) { 390 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );390 psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ ); 391 391 return 1; 392 392 } 393 393 394 394 if ( blks[ 0 ] ->lineno != lineMark ) { 395 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one (line %d vs %d) in %s.",396 lineMark, blks[ 0 ] ->lineno, __func__ );395 psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks found a leak other than the expected one (line %d vs %d) in %s.", 396 lineMark, blks[ 0 ] ->lineno, __func__ ); 397 397 return 1; 398 398 } … … 418 418 419 419 if ( nLeaks != 1 ) { 420 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );420 psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ ); 421 421 return 1; 422 422 } 423 423 424 424 if ( blks[ 0 ] ->lineno != lineMark ) { 425 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ );425 psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ ); 426 426 return 1; 427 427 } … … 448 448 449 449 if ( nLeaks != 2 ) { 450 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );450 psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ ); 451 451 return 1; 452 452 } 453 453 454 454 if ( blks[ 0 ] ->lineno != lineMark ) { 455 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ );455 psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ ); 456 456 return 1; 457 457 } … … 499 499 500 500 if ( corruptions != 1 ) { 501 psError( __FILE__, "Expected one memory corruption but found %d in %s.",502 corruptions, __func__ );501 psError(PS_ERR_UNKNOWN,true, "Expected one memory corruption but found %d in %s.", 502 corruptions, __func__ ); 503 503 return 1; 504 504 } 505 505 506 506 if ( problemCallbackCalled != 1 ) { 507 psError( __FILE__, "The memProblemCallback was not invoked but should have been in %s",508 __func__ );507 psError(PS_ERR_UNKNOWN,true, "The memProblemCallback was not invoked but should have been in %s", 508 __func__ ); 509 509 return 1; 510 510 } … … 556 556 557 557 if (err->code != PS_ERR_MEMORY_DEREF_USAGE) { 558 psError Msg("psLibTest.sysUtils.tst_psMemory",PS_ERR_UNKNOWN,true,559 "Multiple psFree calls generated wrong error code (%d)",560 err->code);558 psError(PS_ERR_UNKNOWN,true, 559 "Multiple psFree calls generated wrong error code (%d)", 560 err->code); 561 561 psFree(err); 562 562 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.
