IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 953


Ignore:
Timestamp:
Jun 9, 2004, 11:20:53 AM (22 years ago)
Author:
desonia
Message:

moved memory leak check into runTest (../psTest.c).

Location:
trunk/psLib/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/collections/tst_psList.c

    r950 r953  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-06-09 20:56:23 $
     8 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-06-09 21:20:53 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4747int testListAlloc(void)
    4848{
    49     int currentId = psMemGetId();
    5049    psList* list;
    5150    int ref;
     
    108107    psListFree(list,PS_FREE);
    109108
    110     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    111         psError(__func__,"Memory Leaks Detected");
    112         return 64;
    113     }
    114     psMemCheckCorruption(1);
    115 
    116109    return 0;
    117110}
     
    119112int testListAdd(void)
    120113{
    121     int currentId = psMemGetId();
    122114    psList* list = NULL;
    123115    int* data = NULL;
     
    289281
    290282    psListFree(list, PS_FREE);
    291 
    292     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    293         psError(__func__,"Memory Leaks Detected");
    294         return 64;
    295     }
    296     psMemCheckCorruption(1);
    297283
    298284    return 0;
     
    323309int testListGet(void)
    324310{
    325     int currentId = psMemGetId();
    326311    psList* list = NULL;
    327312    int* data;
     
    418403    psListFree(list,PS_FREE);
    419404
    420     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    421         psError(__func__,"Memory Leaks Detected");
    422         return 64;
    423     }
    424     psMemCheckCorruption(1);
    425 
    426405    return 0;
    427406}
     
    429408int testListRemove(void)
    430409{
    431     int currentId = psMemGetId();
    432410    psList* list = NULL;
    433411    int* data;
     
    658636    psListFree(list,PS_FREE);
    659637
    660     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    661         psError(__func__,"Memory Leaks Detected");
    662         return 64;
    663     }
    664     psMemCheckCorruption(1);
    665 
    666638    return 0;
    667639
     
    671643{
    672644
    673     int currentId = psMemGetId();
    674645    psList* list = NULL;
    675646    psVector* vec = NULL;
     
    720691    psListFree(list,PS_FREE);
    721692
    722     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    723         psError(__func__,"Memory Leaks Detected");
    724         return 64;
    725     }
    726     psMemCheckCorruption(1);
    727 
    728693    // test vector -> dlist
    729694
     
    800765    psListFree(list,PS_FREE);
    801766
    802     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    803         psError(__func__,"Memory Leaks Detected");
    804         return 64;
    805     }
    806     psMemCheckCorruption(1);
    807 
    808767    return 0;
    809768}
     
    811770int testListIterator(void)
    812771{
    813     int currentId = psMemGetId();
    814772    psList* list = NULL;
    815773    int* data;
     
    936894    psListFree(list,PS_FREE);
    937895
    938     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    939         psError(__func__,"Memory Leaks Detected");
    940         return 64;
    941     }
    942     psMemCheckCorruption(1);
    943 
    944896    return 0;
    945897}
     898
     899int testListFree(void)
     900{
     901
     902    /*
     903    Call psDlistAlloc to create a doubly linked list. Create several data items and add them to the list.
     904    Verify    items are within the list. Verify the data item's reference counter are incremented after adding
     905    to    the list.    Call psDlistFree with NULL specified as the elemFree function. Verify the list is
     906    deallocated but    not the data    items. Verify the data item's reference counters are decremented by one
     907    compared to when added    to the list.
     908    */
     909
     910    return 0;
     911}
  • trunk/psLib/test/collections/verified/tst_psList.stderr

    r934 r953  
    3030
    3131 <DATE> <TIME> <HOST> |I|testListGet    |Following should be an error
    32  <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:274).
     32 <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:264).
    3333
    3434---> TESTPOINT PASSED (psList{489-testListGet} | tst_psList.c)
     
    4747 <DATE> <TIME> <HOST> |E|psListRemove   |Couldn't position to given index (-2) to remove element from list.
    4848 <DATE> <TIME> <HOST> |I|testListRemove |Next message should be an error
    49  <DATE> <TIME> <HOST> |E|psListRemove   |Failed to find 0x0 on psList 0x6d7f10 in psListRemove.
     49 <DATE> <TIME> <HOST> |E|psListRemove   |Failed to find 0x0 on psList 0x6d7f30 in psListRemove.
    5050 <DATE> <TIME> <HOST> |I|testListRemove |Next message should be an error
    51  <DATE> <TIME> <HOST> |E|psListRemove   |Failed to find 0x6d8820 on psList 0x6d7f10 in psListRemove.
     51 <DATE> <TIME> <HOST> |E|psListRemove   |Failed to find 0x6d8840 on psList 0x6d7f30 in psListRemove.
    5252
    5353---> TESTPOINT PASSED (psList{490-testListRemove} | tst_psList.c)
     
    7070 <DATE> <TIME> <HOST> |I|testListIterator| psListSetIterator/psListGetNext/psListGetPrev shall move the list cursor to the specified location
    7171 <DATE> <TIME> <HOST> |I|testListIterator|Following should error with 'Unexpected null pointer'
    72  <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:274).
     72 <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:264).
    7373 <DATE> <TIME> <HOST> |I|testListIterator|Following should error with 'Can't move to an unknown position.'
    7474 <DATE> <TIME> <HOST> |E|listSetIterator|Can't move to an unknown position.  Not moving the iterator position.
  • trunk/psLib/test/image/tst_psImage.c

    r949 r953  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-06-09 20:34:34 $
     8 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-06-09 21:20:53 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4848int testImageAlloc(void)
    4949{
    50     int currentId = psMemGetId();
    5150    psImage* image = NULL;
    5251    unsigned int sizes = 6;
     
    224223            // children is freed.
    225224            psImageFree(image);
    226             if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    227                 psError(__func__,"Memory Leaks Detected");
    228                 return 64;
    229             }
    230             psMemCheckCorruption(1);
    231 
    232225        }
    233226    }
     
    235228    // #548: Verify program execution doesn't stop, if the input psImage structure pointer is null.
    236229    psImageFree(NULL);
    237     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    238         psError(__func__,"Memory Leaks Detected");
    239         return 64;
    240     }
    241     psMemCheckCorruption(1);
    242230
    243231    // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with multiple
     
    249237    psImageFree(image);
    250238
    251     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    252         psError(__func__,"Memory Leaks Detected");
    253         return 64;
    254     }
    255     psMemCheckCorruption(1);
    256 
    257239    return 0;
    258240}
     
    261243int testImageSubset(void)
    262244{
    263     int currentId = psMemGetId();
    264245    psImage preSubsetStruct;
    265246    psImage* original;
     
    519500    psImageFree(original);
    520501
    521     // Verify no memory leaks or corruption are detected for a psImage structure
    522     // Verify no memory leaks or corruption are detected for a psImage structure
    523     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    524         psError(__func__,"Memory Leaks Detected");
    525         return 64;
    526     }
    527     psMemCheckCorruption(1);
    528 
    529502    return 0;
    530503}
     
    537510    unsigned int c = 128;
    538511    unsigned int r = 256;
    539     int currentId = psMemGetId();
    540512
    541513    img = psImageAlloc(c,r,PS_TYPE_F32);
     
    627599    psImageFree(img2);
    628600
    629     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    630         psAbort(__func__,"Memory Leaks!");
    631     }
    632     psMemCheckCorruption(1);
    633 
    634601    return 0;
    635602}
     
    642609    psF32 min;
    643610    psF32 max;
    644     int currentId = psMemGetId();
    645611    int numClipped = 0;
    646612    int retVal;
     
    740706    }
    741707
    742     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    743         psAbort(__func__,"Memory Leaks!");
    744     }
    745     psMemCheckCorruption(1);
    746 
    747708    return 0;
    748709}
     
    753714    unsigned int c = 128;
    754715    unsigned int r = 256;
    755     int currentId = psMemGetId();
    756716    int numClipped = 0;
    757717    int retVal;
     
    825785    }
    826786
    827 
    828     if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
    829         psAbort(__func__,"Memory Leaks!");
    830     }
    831     psMemCheckCorruption(1);
    832 
    833787    return 0;
    834788}
Note: See TracChangeset for help on using the changeset viewer.