IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 3, 2004, 2:39:58 PM (22 years ago)
Author:
gusciora
Message:

Added memory corruption checks to these files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/dataManip/tst_psFunc05.c

    r1861 r1946  
    11/*****************************************************************************
    2     This routine must ensure that the psSpline1DEval() function works
    3     properly.  It creates a spline with psSpline1DAlloc(), creates a set of
    4     data values, sets the spline polynomials with psVectorFitSpline1D(), then
    5     calls psSpline1DEval() on new data values and ensures that the results
     2    This routine must ensure that the psSpline1DEvalVector() function works
     3    properly.  It creates a spline with psSpline1DAlloc(), (1-D functions
     4    are used for the spline polynomials) creates a set of data values, sets
     5    the spline polynomials with psVectorFitSpline1D(), then calls
     6    psSpline1DEvalVector() on new data values and ensures that the results
    67    are correct.
    7  
    8     XXX: figure out the memory deallocator
    98 *****************************************************************************/
    109#include <stdio.h>
     
    1413#include "psMemory.h"
    1514#include "psFunctions.h"
    16 
    1715#define N 8
     16#define SPLINE_ORDER 1
    1817
    1918int main()
     
    2221    int memLeaks=0;
    2322    int i;
    24     //    int  currentId = psMemGetId();
     23    int  currentId = psMemGetId();
    2524    psSpline1D *tmpSpline;
    2625    psVector *data;
     
    3736    data = psVectorAlloc(N+1, PS_TYPE_F32);
    3837    x = psVectorAlloc(N+1, PS_TYPE_F32);
    39     y = psVectorAlloc(N+1, PS_TYPE_F32);
    40     tmpSpline = psSpline1DAlloc(N, 1, 1.0, 10.0);
     38    tmpSpline = psSpline1DAlloc(N, SPLINE_ORDER, 1.0, 10.0);
    4139
    4240    for (i=0;i<N+1;i++) {
     
    5957    }
    6058
    61     psFree(tmpSpline);
     59    p_psSpline1DFree(tmpSpline);
     60
     61    psFree(x);
     62    psFree(y);
     63    psFree(data);
     64
    6265    psMemCheckCorruption(1);
    63     //    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
     66    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
    6467    if (0 != memLeaks) {
    6568        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
Note: See TracChangeset for help on using the changeset viewer.