Changeset 42822 for trunk/psLib/test/math/tap_psSpline1D.c
- Timestamp:
- May 8, 2025, 4:42:12 PM (14 months ago)
- Location:
- trunk/psLib/test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test
- Property svn:ignore
-
old new 6 6 *.da 7 7 gmon.out 8 test.00.jpg 9 test.01.jpg 10 test.02.jpg 11 test.03.jpg 12 test.04.jpg 13 test.05.jpg 14 test.06.jpg 15 test.07.jpg 16 test.08.jpg 17 test.09.jpg 18 test.10.jpg 19 test.11.jpg 20 test.12.jpg 21 test.im.fits 22 test.mk.fits 23 test.sm1.fits 24 test.sm2.fits 25 test.sm3.fits 26 test.sm4.fits 27 tmpImages 28 tst_psTrace02_OUT
-
- Property svn:ignore
-
trunk/psLib/test/math
- Property svn:ignore
-
old new 53 53 tap_psSpline1D 54 54 tap_psPolynomialMD 55 tap_psMinimizeLMM 56 tap_psMinimizeLMM_Alt 57 tap_psMinimizeLMM_Trail 58 tap_psPolyFit_IRLS_1D 59 tap_psPolyFit_IRLS_2D 60 tap_psPolynomialMD_sampleDark 61 test-suite.log
-
- Property svn:ignore
-
trunk/psLib/test/math/tap_psSpline1D.c
r42336 r42822 107 107 psSpline1D *tmpSpline = NULL; 108 108 if (!xNull) { 109 tmpSpline = psSpline1DFitVector(xF32, yF32);109 tmpSpline = psSpline1DFitVector(xF32, yF32, NAN, NAN); 110 110 } else { 111 tmpSpline = psSpline1DFitVector(NULL, yF32 );111 tmpSpline = psSpline1DFitVector(NULL, yF32, NAN, NAN); 112 112 } 113 113 … … 120 120 testStatus = false; 121 121 } 122 if(tmpSpline->spline == NULL) { 123 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline member."); 124 testStatus = false; 125 } 126 for (psS32 i = 0 ; i < NumSplines ; i++) { 127 if (tmpSpline->spline[i] == NULL) { 128 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline[%d] member.", i); 129 testStatus = false; 130 } 131 } 132 if (tmpSpline->knots == NULL) { 122 if (tmpSpline->xKnots == NULL) { 133 123 diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member"); 134 124 testStatus = false; 135 125 } 136 if (tmpSpline->p_psDeriv2 == NULL) { 126 if (tmpSpline->yKnots == NULL) { 127 diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member"); 128 testStatus = false; 129 } 130 if (tmpSpline->d2yKnots == NULL) { 137 131 diag("psSpline1DFitVector()returned a NULL psSpline1D->p_psDeriv2 member"); 138 132 testStatus = false; 139 }140 141 // Test psSpline1DEval()142 for (psS32 i=0;i<NumSplines;i++) {143 psF32 x = 0.5 + (float) i;144 psF32 y = psSpline1DEval(tmpSpline, x);145 if (CheckErrorF32(y, func(x))) {146 testStatus = false;147 diag("TEST ERROR: f(%f) is %f, should be %f", x, y, myFunc00(x));148 // XXX EAM : the truth value above should be 'func' not myFunc00149 }150 133 } 151 134 … … 196 179 psSpline1D *tmpSpline = NULL; 197 180 if (!xNull) { 198 tmpSpline = psSpline1DFitVector(xF64, yF64 );181 tmpSpline = psSpline1DFitVector(xF64, yF64, NAN, NAN); 199 182 } else { 200 tmpSpline = psSpline1DFitVector(NULL, yF64 );183 tmpSpline = psSpline1DFitVector(NULL, yF64, NAN, NAN); 201 184 } 202 185 if(tmpSpline == NULL) { … … 208 191 testStatus = false; 209 192 } 210 if(tmpSpline->spline == NULL) { 211 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline member."); 212 testStatus = false; 213 } 214 for (psS32 i = 0 ; i < NumSplines ; i++) { 215 if (tmpSpline->spline[i] == NULL) { 216 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline[%d] member.", i); 217 testStatus = false; 218 } 219 } 220 if (tmpSpline->knots == NULL) { 221 diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member"); 222 testStatus = false; 223 } 224 if (tmpSpline->p_psDeriv2 == NULL) { 225 diag("psSpline1DFitVector()returned a NULL psSpline1D->p_psDeriv2 member"); 193 if (tmpSpline->xKnots == NULL) { 194 diag("psSpline1DFitVector() returned a NULL psSpline1D->xKnots member"); 195 testStatus = false; 196 } 197 if (tmpSpline->yKnots == NULL) { 198 diag("psSpline1DFitVector() returned a NULL psSpline1D->yKnots member"); 199 testStatus = false; 200 } 201 if (tmpSpline->d2yKnots == NULL) { 202 diag("psSpline1DFitVector()returned a NULL psSpline1D->d2yKnots member"); 226 203 testStatus = false; 227 204 } … … 278 255 skip_start(tmpSpline == NULL, 4, "Skipping tests because psSpline1DAlloc() failed"); 279 256 ok(tmpSpline->n == 0, "psSpline1DAlloc() properly set the psSpline1D->n member"); 280 ok(tmpSpline-> spline == NULL, "psSpline1DAlloc() properly set the psSpline1D->splinemember");281 ok(tmpSpline-> knots == NULL, "psSpline1DAlloc() properly set the psSpline1D->knots member");282 ok(tmpSpline-> p_psDeriv2 == NULL, "psSpline1DAlloc() properly set the psSpline1D->p_psDeriv2member");257 ok(tmpSpline->xKnots == NULL, "psSpline1DAlloc() properly set the psSpline1D->xKnots member"); 258 ok(tmpSpline->yKnots == NULL, "psSpline1DAlloc() properly set the psSpline1D->yKnots member"); 259 ok(tmpSpline->d2yKnots == NULL, "psSpline1DAlloc() properly set the psSpline1D->d2yKnots member"); 283 260 psFree(tmpSpline); 284 261 skip_end(); … … 289 266 { 290 267 psMemId id = psMemGetId(); 291 psSpline1D *tmpSpline = psSpline1DFitVector(NULL, NULL );268 psSpline1D *tmpSpline = psSpline1DFitVector(NULL, NULL, NAN, NAN); 292 269 ok(tmpSpline == NULL, "psSpline1DFitVector() returns NULL with NULL arguments"); 293 270 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
Note:
See TracChangeset
for help on using the changeset viewer.
