Changeset 5546 for trunk/psLib/test/math
- Timestamp:
- Nov 18, 2005, 10:04:38 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/math/tst_psSpline1D.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math/tst_psSpline1D.c
r5183 r5546 13 13 * @author GLG, MHPCC 14 14 * 15 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $16 * @date $Date: 2005- 09-29 20:25:54$15 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-11-18 20:04:38 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 126 126 127 127 /********************************************************************************* 128 psSplineEvalTest_sub00(): We test the psVectorFitSpline1D, psSpline1DEval() functions with a very 129 simple x->y mapping (defined by myFunc00() below). We do this for both F32 130 and F64 versions of the input x and y vectors. 128 psSplineEvalTest_sub(): We psVectorFitSpline1D with NULL arguments. psSpline1DEval() 129 ********************************************************************************/ 130 psS32 psSplineEvalTest_sub(psS32 NumSplines) 131 { 132 psS32 testStatus = true; 133 psS32 memLeaks=0; 134 psS32 currentId = psMemGetId(); 135 136 printf("\n"); 137 printf("Calling psVectorFitSpline1D() with NULL y-vector. Should generate error.\n"); 138 psSpline1D *tmpSpline = psVectorFitSpline1D(NULL, NULL); 139 if (tmpSpline != NULL) { 140 printf("TEST ERROR: psVectorFitSpline1D() did not return NULL.\n"); 141 testStatus = false; 142 psFree(tmpSpline); 143 } 144 145 psMemCheckCorruption(1); 146 memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false); 147 if (0 != memLeaks) { 148 psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks); 149 } 150 151 return (testStatus); 152 } 153 154 155 /********************************************************************************* 156 psSplineEvalTest_sub00(): We test the psVectorFitSpline1D, psSpline1DEval() 157 functions with a very simple x->y mapping (defined by myFunc00() below). We 158 do this for both F32 and F64 versions of the input x and y vectors. 131 159 ********************************************************************************/ 132 160 psF32 myFunc00(psF32 x) … … 149 177 150 178 printf("\n"); 151 printf("Calling psVectorFitSpline1D() with NULL y-vector. Should generate error.\n");152 tmpSpline = psVectorFitSpline1D(NULL, NULL);153 if (tmpSpline != NULL) {154 printf("TEST ERROR: psVectorFitSpline1D() did not return NULL.\n");155 testStatus = false;156 psFree(tmpSpline);157 }158 159 printf("\n");160 179 printf("psSplineEvalTest_sub00(): We test the psVectorFitSpline1D, psSpline1DEval() functions with a very\n"); 161 180 printf("simple x->y mapping (defined by myFunc00()). We do this for both F32\n"); 162 181 printf("and F64 versions of the input x and y vectors.\n"); 182 printf(" Number of splines: %d\n", NumSplines); 163 183 /****************************************************************************/ 164 184 /* PS_TYPE_F32, PS_TYPE_F32 test */ 165 185 /****************************************************************************/ 186 printf("Performing the F32 test....\n"); 166 187 xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 167 188 xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); … … 239 260 /* PS_TYPE_F64, PS_TYPE_F64 test */ 240 261 /****************************************************************************/ 262 printf("Performing the F64 test....\n"); 241 263 xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 242 264 xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); … … 314 336 315 337 /********************************************************************************* 316 psSplineEvalTest_sub00b(): We test the psVectorFitSpline1D, psSpline1DEval() functions with a317 more complicated x->y mapping (defined by myFunc00b() below). We do this for 318 both F32 and F64 versions of the input x and y vectors.338 psSplineEvalTest_sub00b(): We test the psVectorFitSpline1D, psSpline1DEval() 339 functions with a more complicated x->y mapping (defined by myFunc00b() below). 340 We do this for both F32 and F64 versions of the input x and y vectors. 319 341 ********************************************************************************/ 320 342 #define A 4.0 … … 333 355 printf("more complicated x->y mapping (defined by myFunc00b()). We do this for\n"); 334 356 printf("both F32 and F64 versions of the input x and y vectors.\n"); 357 printf(" Number of splines: %d\n", NumSplines); 335 358 psS32 testStatus = true; 336 359 psS32 memLeaks=0; … … 347 370 /* PS_TYPE_F32, PS_TYPE_F32 test */ 348 371 /****************************************************************************/ 372 printf("Performing the F32 test....\n"); 349 373 xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 350 374 xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); … … 421 445 /* PS_TYPE_F64, PS_TYPE_F64 test */ 422 446 /****************************************************************************/ 447 printf("Performing the F64 test....\n"); 423 448 xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 424 449 xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); … … 496 521 497 522 523 /********************************************************************************* 524 psSplineEvalTest_sub00b(): This is similar to psSplineEvalTest_sub00b() 525 except that the x vector is NULL. 526 ********************************************************************************/ 498 527 psS32 psSplineEvalTest_sub00c(psS32 NumSplines) 499 528 { … … 501 530 printf("psSplineEvalTest_sub00c(): This is similar to psSplineEvalTest_sub00b()\n"); 502 531 printf("except that the x vector is NULL.\n"); 532 printf(" Number of splines: %d\n", NumSplines); 503 533 psS32 testStatus = true; 504 534 psS32 memLeaks=0; … … 515 545 /* PS_TYPE_F32, PS_TYPE_F32 test */ 516 546 /****************************************************************************/ 547 printf("Performing the F32 test....\n"); 517 548 xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 518 549 xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); … … 589 620 /* PS_TYPE_F64, PS_TYPE_F64 test */ 590 621 /****************************************************************************/ 622 printf("Performing the F64 test....\n"); 591 623 xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 592 624 xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); … … 678 710 psTraceSetLevel("psSpline1DEvalVector", 0); 679 711 680 return(psSplineEvalTest_sub00(95) & psSplineEvalTest_sub00b(95) & psSplineEvalTest_sub00c(95)); 712 psS32 testStatus = psSplineEvalTest_sub(10); 713 714 // HEY 715 testStatus |= psSplineEvalTest_sub00(0); 716 testStatus |= psSplineEvalTest_sub00b(0); 717 testStatus |= psSplineEvalTest_sub00c(0); 718 719 testStatus |= psSplineEvalTest_sub00(1); 720 testStatus |= psSplineEvalTest_sub00b(1); 721 testStatus |= psSplineEvalTest_sub00c(1); 722 723 testStatus |= psSplineEvalTest_sub00(95); 724 testStatus |= psSplineEvalTest_sub00b(95); 725 testStatus |= psSplineEvalTest_sub00c(95); 726 727 return(testStatus); 681 728 } 682 729 … … 695 742 /* PS_TYPE_F32, PS_TYPE_F32 test */ 696 743 /****************************************************************************/ 744 printf("Performing the F32 test....\n"); 697 745 xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 698 746 yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); … … 806 854 807 855 856 // This code will
Note:
See TracChangeset
for help on using the changeset viewer.
