IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1242


Ignore:
Timestamp:
Jul 19, 2004, 12:38:36 PM (22 years ago)
Author:
desonia
Message:

added test for multiple frees.

File:
1 edited

Legend:

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

    r1193 r1242  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-07-08 01:05:01 $
     8 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-07-19 22:38:36 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3535static psMemoryId memAllocateCallback(const psMemBlock *ptr);
    3636static psMemoryId memFreeCallback(const psMemBlock *ptr);
    37 int TPcheckLeaks(void);
    38 int TPmemCorruption(void);
     37static int TPcheckLeaks(void);
     38static int TPmemCorruption(void);
     39static int TPmultipleFree(void);
    3940void memProblemCallback(const psMemBlock *ptr, const char *file, int lineno);
    4041
     
    5455                              {TPmemCorruption,455,"psMemCorruption",0,false},
    5556                              {TPFreeReferencedMemory,456,"freeReferencedMemory",0,false},
     57                              {TPmultipleFree,699,"multipleFree",-6,false},
    5658                              {NULL}
    5759                          };
     
    522524    return NULL;
    523525}
     526
     527int TPmultipleFree(void)
     528{
     529
     530    void* buffer = psAlloc(1024);
     531
     532    psFree(buffer);
     533
     534    psLogMsg(__func__,PS_LOG_INFO,"Next should be an error about multiple freeing.");
     535    psFree(buffer);
     536
     537    return 0;
     538}
Note: See TracChangeset for help on using the changeset viewer.