IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 3, 2004, 3:05:00 PM (22 years ago)
Author:
desonia
Message:

changed the psError signature to match SDRS. Also made misc. cleanups as
I was combing the files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sysUtils/tst_psMemory.c

    r2204 r2273  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-10-27 00:57:33 $
     8*  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-11-04 01:05:00 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9999    mem = ( psS32* ) psAlloc( size * sizeof( psS32 ) );
    100100    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__ );
    102102        return 1;
    103103    }
     
    130130    ref = psMemGetRefCounter( mem );
    131131    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 );
    133133        return 1;
    134134    }
     
    140140    ref = psMemGetRefCounter( mem );
    141141    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 );
    143143        return 1;
    144144    }
     
    149149    ref = psMemGetRefCounter( mem );
    150150    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 );
    152152        return 1;
    153153    }
     
    159159    ref = psMemGetRefCounter( mem );
    160160    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 );
    162162        return 1;
    163163    }
     
    197197
    198198    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__ );
    200200        return 1;
    201201    }
     
    232232
    233233    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__ );
    235235        return 1;
    236236    }
     
    273273    for ( psS32 i = 0;i < initialSize;i++ ) {
    274274        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__ );
    277277            break;
    278278        }
     
    290290    for ( psS32 i = 0;i < initialSize / 2;i++ ) {
    291291        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__ );
    294294            break;
    295295        }
     
    333333
    334334    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__ );
    337337        return 1;
    338338    }
     
    352352
    353353    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__ );
    356356        return 1;
    357357    }
     
    388388
    389389    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__ );
    391391        return 1;
    392392    }
    393393
    394394    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__ );
    397397        return 1;
    398398    }
     
    418418
    419419    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__ );
    421421        return 1;
    422422    }
    423423
    424424    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__ );
    426426        return 1;
    427427    }
     
    448448
    449449    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__ );
    451451        return 1;
    452452    }
    453453
    454454    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__ );
    456456        return 1;
    457457    }
     
    499499
    500500    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__ );
    503503        return 1;
    504504    }
    505505
    506506    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__ );
    509509        return 1;
    510510    }
     
    556556
    557557    if (err->code != PS_ERR_MEMORY_DEREF_USAGE) {
    558         psErrorMsg("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);
    561561        psFree(err);
    562562        return 1;
Note: See TracChangeset for help on using the changeset viewer.