Changeset 5435 for trunk/psModules/test/detrend
- Timestamp:
- Oct 20, 2005, 1:06:24 PM (21 years ago)
- Location:
- trunk/psModules/test/detrend
- Files:
-
- 2 edited
-
tst_pmFlatField.c (modified) (18 diffs)
-
tst_pmNonLinear.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/detrend/tst_pmFlatField.c
r5169 r5435 21 21 * @author Ross Harman, MHPCC 22 22 * 23 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $24 * @date $Date: 2005- 09-28 20:42:52$23 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-10-20 23:06:24 $ 25 25 * 26 26 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 85 85 inReadout->row0 = 0; 86 86 inReadout->col0 = 0; 87 CREATE_AND_SET_IMAGE(inMask, U8, 0, 3,3); 88 inReadout->mask = inMask; 89 PRINT_MATRIX((inReadout->mask),U8,"Input mask:"); 87 90 PRINT_MATRIX(inImage,F64,"Input image:"); 88 89 CREATE_AND_SET_IMAGE(inMask,U8,0,3,3)90 pmReadout *inMaskReadout = pmReadoutAlloc(NULL);91 inMaskReadout->image = inMask;92 inMaskReadout->row0 = 0;93 inMaskReadout->col0 = 0;94 PRINT_MATRIX(inMask,U8,"Input mask:");95 91 96 92 CREATE_AND_SET_IMAGE(flatImage1,F64,2.0,3,3) … … 101 97 PRINT_MATRIX(flatImage1,F64,"Flat image:"); 102 98 103 if ( !pmFlatField(inReadout, inMaskReadout,flatReadout) ) {99 if ( !pmFlatField(inReadout, flatReadout) ) { 104 100 psError(PS_ERR_UNKNOWN,true,"Test A - Returned false should be true"); 105 101 return 1; … … 116 112 PRINT_MATRIX(flatImage2, F64, "Flat image:"); 117 113 flatReadout->image = flatImage2; 118 if ( !pmFlatField(inReadout, inMaskReadout,flatReadout) ) {114 if ( !pmFlatField(inReadout, flatReadout) ) { 119 115 psError(PS_ERR_UNKNOWN,true,"Test B - Returned false should be true"); 120 116 return 2; 121 117 } 122 PRINT_MATRIX(in MaskReadout->image, PS_TYPE_MASK_DATA, "Resulting mask:");118 PRINT_MATRIX(inReadout->mask, PS_TYPE_MASK_DATA, "Resulting mask:"); 123 119 PRINT_MATRIX(inImage,F64,"Resulting image:"); 124 120 printFooter(stdout, "pmFlatField", "Test B - Mask flat image data", true); … … 135 131 psFree(inReadout->mask); 136 132 inReadout->mask = mask1; 137 if ( !pmFlatField(inReadout, inMaskReadout,flatReadout) ) {133 if ( !pmFlatField(inReadout, flatReadout) ) { 138 134 psError(PS_ERR_UNKNOWN,true,"Test C - Returned false should be true"); 139 135 return 3; … … 149 145 printNegativeTestHeader(stdout,"pmFlatField", "Test D - Attempt to use null flat readout", 150 146 "Null not allowed for flat readout", 0); 151 if( pmFlatField(inReadout, inMaskReadout,NULL) ) {147 if( pmFlatField(inReadout, NULL) ) { 152 148 psError(PS_ERR_UNKNOWN,true,"Test D - Returned true should be false"); 153 149 return 4; … … 162 158 psImage *temp = inReadout->image; 163 159 inReadout->image = NULL; 164 if ( pmFlatField(inReadout, inMaskReadout,flatReadout) ) {160 if ( pmFlatField(inReadout, flatReadout) ) { 165 161 psError(PS_ERR_UNKNOWN,true,"Test E - Returned true should be false" ); 166 162 return 5; 167 163 } 168 inReadout->image = temp ;164 inReadout->image = temp ; 169 165 printFooter(stdout, "pmFlatField", "Test E - Attempt to use null input image", true); 170 166 printf("\n\n\n"); … … 176 172 temp = flatReadout->image; 177 173 flatReadout->image = NULL; 178 if ( pmFlatField(inReadout, inMaskReadout,flatReadout) ) {174 if ( pmFlatField(inReadout, flatReadout) ) { 179 175 psError(PS_ERR_UNKNOWN,true,"Test F - Returned true should be false" ); 180 176 return 6; … … 191 187 temp = flatReadout->image; 192 188 flatReadout->image = smallFlat; 193 if ( pmFlatField(inReadout, inMaskReadout,flatReadout) ) {189 if ( pmFlatField(inReadout, flatReadout) ) { 194 190 psError(PS_ERR_UNKNOWN,true,"Test G - Returned true should be false"); 195 191 return 7; … … 198 194 printFooter(stdout, "pmFlatField", "Test G - Attempt to use input image bigger than flat image", true); 199 195 printf("\n\n\n"); 200 201 196 202 197 // Test H - Attempt to use input image mask bigger than flat image … … 204 199 "Input image mask size exceeds that of flat image", 0); 205 200 CREATE_AND_SET_IMAGE(largeMask,F64,0.0,5,5); 206 temp = inReadout->mask; 207 inMaskReadout->image = largeMask; 208 if ( pmFlatField(inReadout, inMaskReadout, flatReadout) ) { 201 inReadout->mask = largeMask; 202 if ( pmFlatField(inReadout, flatReadout) ) { 209 203 psError(PS_ERR_UNKNOWN,true,"Test H - Returned true should be false"); 210 204 return 8; 211 205 } 212 inReadout->mask = temp;213 206 printFooter(stdout, "pmFlatField", "Test H - Attempt to use input image mask bigger than flat image", true); 214 207 printf("\n\n\n"); 215 208 inReadout->mask = mask1; 216 209 217 210 // Test I - Attempt to use offset greater than input image … … 220 213 *(int*)&inReadout->col0 = 50; 221 214 *(int*)&inReadout->row0 = 50; 222 if ( pmFlatField(inReadout, inMaskReadout,flatReadout) ) {215 if ( pmFlatField(inReadout, flatReadout) ) { 223 216 psError(PS_ERR_UNKNOWN,true,"Test I - Returned true should be false"); 224 217 return 9; … … 234 227 "Complex types not allowed for input image", 0); 235 228 *(psElemType* ) & inReadout->image->type.type = PS_TYPE_C64; 236 if ( pmFlatField(inReadout, inMaskReadout,flatReadout) ) {229 if ( pmFlatField(inReadout, flatReadout) ) { 237 230 psError(PS_ERR_UNKNOWN,true,"Test J - Returned true should be false"); 238 231 return 10; … … 247 240 "Complex types not allowed for flat image", 0); 248 241 *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_C64; 249 if ( pmFlatField(inReadout, inMaskReadout,flatReadout) ) {242 if ( pmFlatField(inReadout, flatReadout) ) { 250 243 psError(PS_ERR_UNKNOWN,true,"Test K - Returned ture should be false"); 251 244 return 11; … … 260 253 "Input and flat image types differ", 0); 261 254 *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_F32; 262 if ( pmFlatField(inReadout, inMaskReadout,flatReadout) ) {255 if ( pmFlatField(inReadout, flatReadout) ) { 263 256 psError(PS_ERR_UNKNOWN,true,"Test L - Returned true should be false"); 264 257 return 12; … … 273 266 "Mask must be PS_TYPE_MASK type", 0); 274 267 *(psElemType* ) & inReadout->mask->type.type = PS_TYPE_F32; 275 if ( pmFlatField(inReadout, inMaskReadout,flatReadout) ) {268 if ( pmFlatField(inReadout, flatReadout) ) { 276 269 psError(PS_ERR_UNKNOWN,true,"Test M - Returned true should be false"); 277 270 return 13; … … 283 276 284 277 // Free memory 285 psFree(inMask);286 psFree(largeMask);287 inMaskReadout->image = NULL;288 psFree(inMaskReadout);289 278 psFree(inReadout); 290 279 psFree(flatReadout); … … 293 282 //psFree(flatImage1); 294 283 psFree(smallFlat); 284 psFree(largeMask); 295 285 296 286 return 0; -
trunk/psModules/test/detrend/tst_pmNonLinear.c
r5169 r5435 1 /* *@file tst_pmNonLinear.c1 /* @file tst_pmNonLinear.c 2 2 * 3 3 * @brief Contains the tests for pmNonLinear.c: … … 16 16 * @author GLG, MHPCC 17 17 * 18 * @version $Revision: 1.1 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2005-09-28 20:42:52 $ 18 * XXX: Add tests in which the lookup file has incorrect number of entries, 19 * and where the data is outside the pmReadout range. 20 * 21 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2005-10-20 23:06:24 $ 20 23 * 21 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 37 40 }; 38 41 39 40 int main(int argc, char* argv[])41 {42 psLogSetFormat("HLNM");43 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);44 }45 46 42 #define NUM_ROWS 8 47 43 #define NUM_COLS 8 44 #define LOOKUP_FILENAME ".tmp_tst_pmNonLinearLookupFile" 45 int main(int argc, char* argv[]) 46 { 47 psLogSetFormat("HLNM"); 48 // 49 // We generate a lookup file for future tests. We should probably remove 50 // it when we're done. 51 // 52 FILE *fp = fopen(LOOKUP_FILENAME, "w"); 53 ; 54 for (psS32 i=0;i<PS_MAX(NUM_COLS, NUM_ROWS)*3;i++) { 55 fprintf(fp, "%f %f\n", (float) i, (float) (2 * i)); 56 } 57 fclose(fp); 58 59 // system("rm LOOKUP_FILENAME"); 60 return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv); 61 } 62 48 63 int doNonLinearityPolynomialTest(int numCols, int numRows) 49 64 { … … 105 120 float expect; 106 121 int testStatus = true; 107 int tableSize = PS_MAX(numCols, numRows)*2;108 122 psImage *myImage = psImageAlloc(numCols, numRows, PS_TYPE_F32); 109 123 pmReadout *myReadout = pmReadoutAlloc(NULL); 110 124 myReadout->image = myImage; 111 psVector *in = psVectorAlloc(tableSize, PS_TYPE_F32);112 psVector *out = psVectorAlloc(tableSize, PS_TYPE_F32);113 125 114 126 printPositiveTestHeader(stdout, "pmNonLinear", "doNonLinearityLookupTest"); … … 119 131 } 120 132 121 for (i=0;i<tableSize;i++) { 122 in->data.F32[i] = (float) i; 123 out->data.F32[i] = (float) (2 * i); 124 } 125 126 myReadout = pmNonLinearityLookup(myReadout, in, out); 133 myReadout = pmNonLinearityLookup(myReadout, LOOKUP_FILENAME); 127 134 for (i=0;i<numRows;i++) { 128 135 for (j=0;j<numCols;j++) { … … 136 143 } 137 144 138 139 psFree(myReadout); 140 psFree(in); 141 psFree(out); 145 psFree(myReadout); 142 146 printFooter(stdout, "pmNonLinear", "doNonLinearityLookupTest", true); 143 147 return(testStatus); … … 220 224 int test03() 221 225 { 222 int i; 223 int j; 224 int testStatus = true; 225 int tableSize = PS_MAX(NUM_COLS, NUM_ROWS)*3; 226 int testStatus = true; 226 227 psImage *myImage = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32); 227 228 pmReadout *myReadout = pmReadoutAlloc(NULL); 228 229 pmReadout *rc = NULL; 229 230 myReadout->image = myImage; 230 psVector *in = psVectorAlloc(tableSize, PS_TYPE_F32);231 psVector *inOne = psVectorAlloc(1, PS_TYPE_F32);232 psVector *inSmall = psVectorAlloc(tableSize-1, PS_TYPE_F32);233 psVector *inBig = psVectorAlloc(tableSize+1, PS_TYPE_F32);234 psVector *out = psVectorAlloc(tableSize, PS_TYPE_F32);235 psVector *outOne = psVectorAlloc(1, PS_TYPE_F32);236 psVector *outSmall = psVectorAlloc(tableSize-1, PS_TYPE_F32);237 psVector *outBig = psVectorAlloc(tableSize+1, PS_TYPE_F32);238 231 239 232 test03Init(myReadout); 240 for (i=0;i<tableSize;i++) {241 in->data.F32[i] = (float) i;242 out->data.F32[i] = (float) (2 * i);243 inBig->data.F32[i] = (float) i;244 outBig->data.F32[i] = (float) (2 * i);245 if (i < tableSize-1) {246 inSmall->data.F32[i] = (float) i;247 outSmall->data.F32[i] = (float) (2 * i);248 }249 }250 inBig->data.F32[tableSize] = (float) tableSize;251 outBig->data.F32[tableSize] = (float) (2 * tableSize);252 inOne->data.F32[0] = 0.0;253 outOne->data.F32[0] = 0.0;254 255 233 printf("------------------------------------------------------------\n"); 256 234 printf("Calling pmNonLinearityLookup() with NULL input pmReadout. Should generate error, return NULL.\n"); 257 rc = pmNonLinearityLookup(NULL, in, out);235 rc = pmNonLinearityLookup(NULL, LOOKUP_FILENAME); 258 236 if (rc != NULL) { 259 237 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); … … 265 243 psImage *tmpImage = myReadout->image; 266 244 myReadout->image = NULL; 267 rc = pmNonLinearityLookup(myReadout, in, out);245 rc = pmNonLinearityLookup(myReadout, LOOKUP_FILENAME); 268 246 if (rc != NULL) { 269 247 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); … … 273 251 274 252 printf("------------------------------------------------------------\n"); 275 printf("Calling pmNonLinearityLookup() with NULL inFlux psVector. Should generate error, return NULL.\n"); 276 rc = pmNonLinearityLookup(myReadout, NULL, out); 277 if (rc != NULL) { 278 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 279 testStatus = false; 280 } 281 282 printf("------------------------------------------------------------\n"); 283 printf("Calling pmNonLinearityLookup() with NULL outFlux psVector. Should generate error, return NULL.\n"); 284 rc = pmNonLinearityLookup(myReadout, in, NULL); 285 if (rc != NULL) { 286 printf("TEST ERROR: pmNonLinearityPolynomial() returned a non-NULL pmReadout\n"); 287 testStatus = false; 288 } 289 290 test03Init(myReadout); 291 printf("------------------------------------------------------------\n"); 292 printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors. Should generate warning.\n"); 293 rc = pmNonLinearityLookup(myReadout, in, outBig); 253 printf("Calling pmNonLinearityLookup() with non-existent lookup file.\n"); 254 rc = pmNonLinearityLookup(myReadout, "I_DONT_EXIST"); 294 255 if (rc == NULL) { 295 256 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 296 257 testStatus = false; 297 258 } 298 for (i=0;i<NUM_ROWS;i++) { 299 for (j=0;j<NUM_COLS;j++) { 300 psF32 expect = (float) (2 * (i + j)); 301 psF32 actual = rc->image->data.F32[i][j]; 302 if (FLT_EPSILON < fabs(expect - actual)) { 303 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 304 testStatus = false; 305 } 306 } 307 } 308 309 310 test03Init(myReadout); 311 printf("------------------------------------------------------------\n"); 312 printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors. Should generate warning.\n"); 313 rc = pmNonLinearityLookup(myReadout, in, outSmall); 314 if (rc == NULL) { 315 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 316 testStatus = false; 317 } 318 for (i=0;i<NUM_ROWS;i++) { 319 for (j=0;j<NUM_COLS;j++) { 320 psF32 expect = (float) (2 * (i + j)); 321 psF32 actual = rc->image->data.F32[i][j]; 322 if (FLT_EPSILON < fabs(expect - actual)) { 323 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 324 testStatus = false; 325 } 326 } 327 } 328 329 test03Init(myReadout); 330 printf("------------------------------------------------------------\n"); 331 printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors. Should generate warning.\n"); 332 rc = pmNonLinearityLookup(myReadout, inSmall, out); 333 if (rc == NULL) { 334 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 335 testStatus = false; 336 } 337 for (i=0;i<NUM_ROWS;i++) { 338 for (j=0;j<NUM_COLS;j++) { 339 psF32 expect = (float) (2 * (i + j)); 340 psF32 actual = rc->image->data.F32[i][j]; 341 if (FLT_EPSILON < fabs(expect - actual)) { 342 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 343 testStatus = false; 344 } 345 } 346 } 347 348 test03Init(myReadout); 349 printf("------------------------------------------------------------\n"); 350 printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors. Should generate warning.\n"); 351 rc = pmNonLinearityLookup(myReadout, inBig, out); 352 if (rc == NULL) { 353 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 354 testStatus = false; 355 } 356 for (i=0;i<NUM_ROWS;i++) { 357 for (j=0;j<NUM_COLS;j++) { 358 psF32 expect = (float) (2 * (i + j)); 359 psF32 actual = rc->image->data.F32[i][j]; 360 if (FLT_EPSILON < fabs(expect - actual)) { 361 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 362 testStatus = false; 363 } 364 } 365 } 366 367 test03Init(myReadout); 368 printf("------------------------------------------------------------\n"); 369 printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors. Should generate warning.\n"); 370 rc = pmNonLinearityLookup(myReadout, inSmall, outBig); 371 if (rc == NULL) { 372 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 373 testStatus = false; 374 } 375 for (i=0;i<NUM_ROWS;i++) { 376 for (j=0;j<NUM_COLS;j++) { 377 psF32 expect = (float) (2 * (i + j)); 378 psF32 actual = rc->image->data.F32[i][j]; 379 if (FLT_EPSILON < fabs(expect - actual)) { 380 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 381 testStatus = false; 382 } 383 } 384 } 385 386 test03Init(myReadout); 387 printf("------------------------------------------------------------\n"); 388 printf("Calling pmNonLinearityLookup() with size difference in inFlux/outFLux psVectors. Should generate warning.\n"); 389 rc = pmNonLinearityLookup(myReadout, inBig, outSmall); 390 if (rc == NULL) { 391 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 392 testStatus = false; 393 } 394 for (i=0;i<NUM_ROWS;i++) { 395 for (j=0;j<NUM_COLS;j++) { 396 psF32 expect = (float) (2 * (i + j)); 397 psF32 actual = rc->image->data.F32[i][j]; 398 if (FLT_EPSILON < fabs(expect - actual)) { 399 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 400 testStatus = false; 401 } 402 } 403 } 404 405 test03Init(myReadout); 406 printf("------------------------------------------------------------\n"); 407 printf("Calling pmNonLinearityLookup() with inFlux psVector size 1. Should generate error, return original pmReadout.\n"); 408 rc = pmNonLinearityLookup(myReadout, inOne, out); 409 if (rc != myReadout) { 410 printf("TEST ERROR: pmNonLinearityPolynomial() did not return the original pmReadout\n"); 411 testStatus = false; 412 } 413 for (i=0;i<NUM_ROWS;i++) { 414 for (j=0;j<NUM_COLS;j++) { 415 psF32 expect = (float) ((i + j)); 416 psF32 actual = rc->image->data.F32[i][j]; 417 if (FLT_EPSILON < fabs(expect - actual)) { 418 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 419 testStatus = false; 420 } 421 } 422 } 259 423 260 424 261 printf("------------------------------------------------------------\n"); 425 262 printf("Calling pmNonLinearityLookup() with one pixels outside inFlux range. Should generate warnings.\n"); 426 test03Init(myReadout); 427 myReadout->image->data.F32[0][0] = -1; 428 rc = pmNonLinearityLookup(myReadout, in, out); 429 if (rc == NULL) { 430 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 431 testStatus = false; 432 } 433 for (i=0;i<NUM_ROWS;i++) { 434 for (j=0;j<NUM_COLS;j++) { 435 psF32 expect = (float) (2 * (i + j)); 436 psF32 actual = rc->image->data.F32[i][j]; 437 if(i==0 && j==0) { 438 if(actual != 0.0) { 439 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n",i,j,actual,0.0); 440 } 441 } else { 442 if (FLT_EPSILON < fabs(expect - actual)) { 443 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 444 testStatus = false; 445 } 446 } 447 } 448 } 449 450 printf("------------------------------------------------------------\n"); 451 printf("Calling pmNonLinearityLookup() with one pixels outside inFlux range. Should generate warnings.\n"); 452 test03Init(myReadout); 453 myReadout->image->data.F32[NUM_ROWS-1][NUM_COLS-1] = 100; 454 rc = pmNonLinearityLookup(myReadout, in, out); 455 if (rc == NULL) { 456 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 457 testStatus = false; 458 } 459 for (i=0;i<NUM_ROWS;i++) { 460 for (j=0;j<NUM_COLS;j++) { 461 psF32 expect = (float) (2 * (i + j)); 462 psF32 actual = rc->image->data.F32[i][j]; 463 if(i==(NUM_ROWS-1) && j==(NUM_COLS-1)) { 464 if(actual != (tableSize-1)*2) { 465 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n",i,j,actual,(tableSize-1)*2.0); 466 } 467 } else { 468 if (FLT_EPSILON < fabs(expect - actual)) { 469 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 470 testStatus = false; 471 } 472 } 473 } 474 } 475 476 test03Init(myReadout); 477 printf("------------------------------------------------------------\n"); 478 printf("Calling pmNonLinearityLookup() with image values not in vector.\n"); 479 myReadout->image->data.F32[0][0] = 0.5; 480 rc = pmNonLinearityLookup(myReadout, in, out); 481 if (rc == NULL) { 482 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL pmReadout\n"); 483 testStatus = false; 484 } 485 for (i=0;i<NUM_ROWS;i++) { 486 for (j=0;j<NUM_COLS;j++) { 487 psF32 expect = (float) (2 * (i + j)); 488 if(i==0 && j==0) { 489 expect = 1.0; 490 } 491 psF32 actual = rc->image->data.F32[i][j]; 492 if (FLT_EPSILON < fabs(expect - actual)) { 493 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 494 testStatus = false; 495 } 496 } 497 } 498 499 psFree(myReadout); 500 psFree(in); 501 psFree(inOne); 502 psFree(inSmall); 503 psFree(inBig); 504 psFree(out); 505 psFree(outOne); 506 psFree(outSmall); 507 psFree(outBig); 263 264 psFree(myReadout); 508 265 509 266 printFooter(stdout, "pmNonLinear", "Testing bad input parameter conditions.", true);
Note:
See TracChangeset
for help on using the changeset viewer.
