IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 860


Ignore:
Timestamp:
Jun 3, 2004, 5:20:08 PM (22 years ago)
Author:
gusciora
Message:

Added memory leak chewcks.

Location:
trunk/psLib/test/sysUtils
Files:
5 edited

Legend:

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

    r584 r860  
    11/*****************************************************************************
    2     This code tests whether a hash table be allocated successfully.
     2    This code will test whether a hash table can be allocated successfully.
    33 *****************************************************************************/
    44#include <stdio.h>
     
    1212    int testStatus      = true;
    1313    int i               = 0;
    14 
     14    int currentId = psMemGetId();
     15    int memLeaks        = 0;
    1516    printPositiveTestHeader(stdout,
    1617                            "psHash functions",
     
    5152                testStatus);
    5253
     54    psHashFree(myHashTable, NULL);
     55
     56    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     57    if (0 != memLeaks) {
     58        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
     59    }
     60    psMemCheckCorruption(1);
     61
    5362    return (!testStatus);
    5463}
  • trunk/psLib/test/sysUtils/tst_psHash01.c

    r847 r860  
    3636    psHash *myHashTable = NULL;
    3737    int testStatus      = true;
     38    int currentId = psMemGetId();
     39    int memLeaks        = 0;
    3840
    3941    printPositiveTestHeader(stdout,
     
    6769                testStatus);
    6870
     71    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     72    if (0 != memLeaks) {
     73        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
     74    }
     75    psMemCheckCorruption(1);
     76
    6977    return (!testStatus);
    7078}
  • trunk/psLib/test/sysUtils/tst_psHash02.c

    r584 r860  
    11/*****************************************************************************
    2     This code tests whether hash tables entries can be inserted correctly.
     2    This code will test whether hash tables entries can be inserted correctly.
    33 
    44    GUS: Add code to test whether duplicates are handled correctly (use a
    5     small hast table and lots of keys).
     5    small hash table and lots of keys).
    66 *****************************************************************************/
    77#include <stdio.h>
     
    4141    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
    4242    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
     43    int currentId = psMemGetId();
     44    int memLeaks        = 0;
    4345
    4446    printPositiveTestHeader(stdout,
     
    6971                testStatus);
    7072
     73    psHashFree(myHashTable, NULL);
     74
     75    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     76    if (0 != memLeaks) {
     77        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
     78    }
     79    psMemCheckCorruption(1);
     80
    7181    return (!testStatus);
    7282}
  • trunk/psLib/test/sysUtils/tst_psHash03.c

    r584 r860  
    11/*****************************************************************************
    2     This code tests whether hash tables entries can be removed correctly.
     2    This code will test whether hash tables entries can be removed correctly.
    33 
    44    GUS: Add code to test whether duplicates are handled correctly.
     
    4040    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
    4141    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
     42    int currentId = psMemGetId();
     43    int memLeaks        = 0;
    4244
    4345    printPositiveTestHeader(stdout,
     
    8284                testStatus);
    8385
     86    psHashFree(myHashTable, NULL);
     87    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     88    if (0 != memLeaks) {
     89        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
     90    }
     91    psMemCheckCorruption(1);
     92
    8493    return (!testStatus);
    8594}
  • trunk/psLib/test/sysUtils/tst_psHash04.c

    r584 r860  
    11/*****************************************************************************
    2     This code tests whether the call psHashKeyList() function works.
     2    This code will test whether the call psHashKeyList() function works.
    33 *****************************************************************************/
    44#include <stdio.h>
     
    3636    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
    3737    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL};
     38    int currentId = psMemGetId();
     39    int memLeaks        = 0;
    3840
    3941    printPositiveTestHeader(stdout,
     
    5961                testStatus);
    6062
     63    psHashFree(myHashTable, NULL);
     64
     65    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     66    if (0 != memLeaks) {
     67        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
     68    }
     69    psMemCheckCorruption(1);
     70
    6171    return(!testStatus);
    6272}
Note: See TracChangeset for help on using the changeset viewer.