Changeset 1946 for trunk/psLib/test/dataManip/tst_psFunc05.c
- Timestamp:
- Oct 3, 2004, 2:39:58 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/dataManip/tst_psFunc05.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psFunc05.c
r1861 r1946 1 1 /***************************************************************************** 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 6 7 are correct. 7 8 XXX: figure out the memory deallocator9 8 *****************************************************************************/ 10 9 #include <stdio.h> … … 14 13 #include "psMemory.h" 15 14 #include "psFunctions.h" 16 17 15 #define N 8 16 #define SPLINE_ORDER 1 18 17 19 18 int main() … … 22 21 int memLeaks=0; 23 22 int i; 24 //int currentId = psMemGetId();23 int currentId = psMemGetId(); 25 24 psSpline1D *tmpSpline; 26 25 psVector *data; … … 37 36 data = psVectorAlloc(N+1, PS_TYPE_F32); 38 37 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); 41 39 42 40 for (i=0;i<N+1;i++) { … … 59 57 } 60 58 61 psFree(tmpSpline); 59 p_psSpline1DFree(tmpSpline); 60 61 psFree(x); 62 psFree(y); 63 psFree(data); 64 62 65 psMemCheckCorruption(1); 63 //memLeaks = psMemCheckLeaks(currentId,NULL,stderr);66 memLeaks = psMemCheckLeaks(currentId,NULL,stderr); 64 67 if (0 != memLeaks) { 65 68 psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
Note:
See TracChangeset
for help on using the changeset viewer.
