IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 23, 2004, 5:31:22 PM (22 years ago)
Author:
evanalst
Message:

Function psHashRemove was changed to return boolean and removes the data
from the hash table.

File:
1 edited

Legend:

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

    r1201 r1295  
    6868    int i               = 0;
    6969    int TotalKeys       = 0;
     70    bool retVal         = false;
    7071    ID *id = NULL;
    7172    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL};
     
    101102    i = 0;
    102103    while (myKeys[i] != NULL) {
    103         id = psHashRemove(myHashTable, myKeys[i]);
    104104        // The psHashRemove() procedure removes the entry from the hash
    105         // table, but does not delete the data.  The following is necessary
    106         // to delete the data as well (which is returned from the call).
    107         psFree(id);
     105        // table and deletes the data.
     106        retVal = psHashRemove(myHashTable, myKeys[i]);
     107        if (!retVal) {
     108            fprintf(stderr,"%s: Hash table entry not removed.\n",__func__);
     109        }
    108110        id = psHashLookup(myHashTable, myKeys[i]);
    109111        if (id != NULL) {
     
    124126        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
    125127    }
    126     psMemCheckCorruption(1);
     128    psMemCheckCorruption(true);
    127129
    128130    return (!testStatus);
    129131}
     132
Note: See TracChangeset for help on using the changeset viewer.