IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 624


Ignore:
Timestamp:
May 7, 2004, 4:40:56 PM (22 years ago)
Author:
evanalst
Message:

Added memory leak and corruption checks.

File:
1 edited

Legend:

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

    r544 r624  
    1010 *  @author  Eric Van Alst, MHPCC
    1111 *
    12  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-04-28 22:00:59 $
     12 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-05-08 02:40:56 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131    char  charval = 'E';
    3232    char *stringval = "E R R O R";
     33    int   memBlockAllocated = 0;
     34    psMemBlock  ***memBlockPtr = NULL;
    3335
    3436    // Test point #1 Multiple type values placed in the error string
     
    4850    psError("","");
    4951    printFooter(stderr, "psError","Empty strings in error message",true);
     52
     53    // Check for memory leaks
     54    memBlockAllocated = psMemCheckLeaks(0, memBlockPtr, stderr);
     55    if ( memBlockAllocated != 0 ) {
     56        fprintf(stderr,"FAIL - Memory leak detected - Number of blocks = %d\n",memBlockAllocated);
     57    }
     58    // Check for memory corruption and abort if detected
     59    memBlockAllocated = psMemCheckCorruption(1);
     60
    5061    return 0;
    5162}
Note: See TracChangeset for help on using the changeset viewer.