Changeset 5587 for trunk/psModules/test/imsubtract/tst_pmSubtractBias.c
- Timestamp:
- Nov 23, 2005, 1:54:30 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/imsubtract/tst_pmSubtractBias.c
r5552 r5587 25 25 * XXX: Memory leaks are not being detected. 26 26 * 27 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $28 * @date $Date: 2005-11- 19 00:55:18$27 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 28 * @date $Date: 2005-11-23 23:54:30 $ 29 29 * 30 30 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 52 52 }; 53 53 54 psS32 currentId = 0; 55 psS32 memLeaks = 0; // XXX: remove 54 56 55 57 int main(int argc, char* argv[]) … … 67 69 psTraceSetLevel("psSpline1DEval", 0); 68 70 psTraceSetLevel("psSpline1DEvalVector", 0); 71 72 psS32 currentId = psMemGetId(); // XXX: remove 73 psS32 memLeaks = 0; // XXX: remove 74 if (0) { 75 PRINT_MEMLEAKS(0); 76 } 69 77 70 78 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); … … 661 669 } 662 670 oAverage/= (psF32) numOverscans; 663 664 665 if (fit == PM_FIT_NONE) { 666 myReadout = pmSubtractBias(myReadout, NULL, PM_FIT_NONE, overscanaxis, 667 stat, nBin, NULL, NULL); 668 } else if (fit == PM_FIT_POLYNOMIAL) { 669 myReadout = pmSubtractBias(myReadout, myPoly, PM_FIT_POLYNOMIAL, overscanaxis, 670 stat, nBin, NULL, NULL); 671 } else if (fit == PM_FIT_SPLINE) { 672 // mySpline = psSpline1DAlloc(); 673 myReadout = pmSubtractBias(myReadout, mySpline, PM_FIT_SPLINE, overscanaxis, 674 stat, nBin, NULL, NULL); 675 } 676 677 for (i=0;i<imageNumRows;i++) { 678 for (j=0;j<imageNumCols;j++) { 679 expect = ((float) (i + j)) - oAverage; 680 actual = myReadout->image->data.F32[i][j]; 681 if (FLT_EPSILON < fabs(expect - actual)) { 682 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 683 testStatus = 1; 684 } else { 685 //printf("COOL: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 671 if (0) { 672 if (fit == PM_FIT_NONE) { 673 myReadout = pmSubtractBias(myReadout, NULL, PM_FIT_NONE, overscanaxis, 674 stat, nBin, NULL, NULL); 675 } else if (fit == PM_FIT_POLYNOMIAL) { 676 myReadout = pmSubtractBias(myReadout, myPoly, PM_FIT_POLYNOMIAL, overscanaxis, 677 stat, nBin, NULL, NULL); 678 } else if (fit == PM_FIT_SPLINE) { 679 // mySpline = psSpline1DAlloc(); 680 myReadout = pmSubtractBias(myReadout, mySpline, PM_FIT_SPLINE, overscanaxis, 681 stat, nBin, NULL, NULL); 682 } 683 if (myReadout == NULL ) { 684 printf("TEST ERROR: pmSubtractBias() returned NULL.\n"); 685 testStatus = 1; 686 } else { 687 for (i=0;i<imageNumRows;i++) { 688 for (j=0;j<imageNumCols;j++) { 689 expect = ((float) (i + j)) - oAverage; 690 actual = myReadout->image->data.F32[i][j]; 691 if (FLT_EPSILON < fabs(expect - actual)) { 692 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 693 testStatus = 1; 694 } else { 695 //printf("GOOD: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 696 } 697 } 686 698 } 687 699 } 688 700 } 689 // XXX: Figure out memory deallocation 701 702 // HEY 690 703 psFree(fpa); 691 // psFree(chip);692 // psFree(cell);693 /*694 psListElem *tmpElem = (psListElem *) myReadout->bias->head;695 while (NULL != tmpElem) {696 psFree((psImage *) tmpElem->data);697 tmpElem = tmpElem->next;698 }699 psFree(myReadout);700 */701 psFree(camera);702 704 psFree(stat); 703 705 psFree(myPoly); … … 1126 1128 } 1127 1129 1128 1129 // This code will
Note:
See TracChangeset
for help on using the changeset viewer.
