IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

Added check for memory leaks for each test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/psTest.c

    r931 r951  
    1717
    1818#include "psTest.h"
     19#include "psMemory.h"
     20#include "psError.h"
    1921
    2022#define HEADER_TOP    "/----------------------------- TESTPOINT ------------------------------------------\\\n"
     
    4446    child = fork();
    4547    if (child == 0) {                   // I am the child process, run the test
    46         exit(fcn());
     48        int currentId = psMemGetId();
     49        int retVal = fcn();
     50        if (retVal == expectedReturn) {
     51            if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {
     52                psError(__func__,"Memory Leaks Detected");
     53                retVal = 64;
     54            }
     55            psMemCheckCorruption(1);
     56        }
     57        exit(retVal);
    4758    } else if (child < 0) {
    4859        fprintf(fp,"Couldn't fork a process to run a negative test (%s|%s)", packageName, testPointName);
Note: See TracChangeset for help on using the changeset viewer.