Changeset 2956
- Timestamp:
- Jan 11, 2005, 10:47:39 AM (22 years ago)
- Location:
- trunk/psModules/test
- Files:
-
- 3 edited
-
tst_pmNonLinear.c (modified) (9 diffs)
-
verified/tst_pmNonLinear.stderr (modified) (1 diff)
-
verified/tst_pmNonLinear.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/tst_pmNonLinear.c
r2955 r2956 16 16 * @author GLG, MHPCC 17 17 * 18 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $19 * @date $Date: 2005-01-11 19:38:24$18 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2005-01-11 20:47:39 $ 20 20 * 21 21 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 243 243 outBig->data.F32[i] = (float) (2 * i); 244 244 if (i < tableSize-1) { 245 inSmall->data.F32[i] = (float) (2 * i);245 inSmall->data.F32[i] = (float) i; 246 246 outSmall->data.F32[i] = (float) (2 * i); 247 247 } … … 315 315 testStatus = false; 316 316 } 317 for (i=0;i<NUM_ROWS;i++) { 318 for (j=0;j<NUM_COLS;j++) { 319 psF32 expect = (float) (2 * (i + j)); 320 psF32 actual = rc->image->data.F32[i][j]; 321 if (FLT_EPSILON < fabs(expect - actual)) { 322 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 323 testStatus = false; 324 } 325 } 326 } 317 327 318 328 test03Init(myReadout); … … 324 334 testStatus = false; 325 335 } 336 for (i=0;i<NUM_ROWS;i++) { 337 for (j=0;j<NUM_COLS;j++) { 338 psF32 expect = (float) (2 * (i + j)); 339 psF32 actual = rc->image->data.F32[i][j]; 340 if (FLT_EPSILON < fabs(expect - actual)) { 341 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 342 testStatus = false; 343 } 344 } 345 } 326 346 327 347 test03Init(myReadout); … … 333 353 testStatus = false; 334 354 } 355 for (i=0;i<NUM_ROWS;i++) { 356 for (j=0;j<NUM_COLS;j++) { 357 psF32 expect = (float) (2 * (i + j)); 358 psF32 actual = rc->image->data.F32[i][j]; 359 if (FLT_EPSILON < fabs(expect - actual)) { 360 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 361 testStatus = false; 362 } 363 } 364 } 335 365 336 366 test03Init(myReadout); … … 342 372 testStatus = false; 343 373 } 374 for (i=0;i<NUM_ROWS;i++) { 375 for (j=0;j<NUM_COLS;j++) { 376 psF32 expect = (float) (2 * (i + j)); 377 psF32 actual = rc->image->data.F32[i][j]; 378 if (FLT_EPSILON < fabs(expect - actual)) { 379 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 380 testStatus = false; 381 } 382 } 383 } 344 384 345 385 test03Init(myReadout); … … 350 390 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n"); 351 391 testStatus = false; 392 } 393 for (i=0;i<NUM_ROWS;i++) { 394 for (j=0;j<NUM_COLS;j++) { 395 psF32 expect = (float) (2 * (i + j)); 396 psF32 actual = rc->image->data.F32[i][j]; 397 if (FLT_EPSILON < fabs(expect - actual)) { 398 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 399 testStatus = false; 400 } 401 } 352 402 } 353 403 … … 360 410 testStatus = false; 361 411 } 412 for (i=0;i<NUM_ROWS;i++) { 413 for (j=0;j<NUM_COLS;j++) { 414 psF32 expect = (float) ((i + j)); 415 psF32 actual = rc->image->data.F32[i][j]; 416 if (FLT_EPSILON < fabs(expect - actual)) { 417 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 418 testStatus = false; 419 } 420 } 421 } 362 422 363 423 printf("------------------------------------------------------------\n"); … … 370 430 testStatus = false; 371 431 } 372 432 for (i=0;i<NUM_ROWS;i++) { 433 for (j=0;j<NUM_COLS;j++) { 434 psF32 expect = (float) (2 * (i + j)); 435 psF32 actual = rc->image->data.F32[i][j]; 436 if(i==0 && j==0) { 437 if(actual != 0.0) { 438 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n",i,j,actual,0.0); 439 } 440 } else { 441 if (FLT_EPSILON < fabs(expect - actual)) { 442 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 443 testStatus = false; 444 } 445 } 446 } 447 } 448 449 printf("------------------------------------------------------------\n"); 450 printf("Calling pmNonLinearityLookup() with one pixels outside inFlux range. Should generate warnings.\n"); 451 test03Init(myReadout); 452 myReadout->image->data.F32[NUM_ROWS-1][NUM_COLS-1] = 100; 453 rc = pmNonLinearityLookup(myReadout, in, out); 454 if (rc == NULL) { 455 printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n"); 456 testStatus = false; 457 } 458 for (i=0;i<NUM_ROWS;i++) { 459 for (j=0;j<NUM_COLS;j++) { 460 psF32 expect = (float) (2 * (i + j)); 461 psF32 actual = rc->image->data.F32[i][j]; 462 if(i==(NUM_ROWS-1) && j==(NUM_COLS-1)) { 463 if(actual != (tableSize-1)*2) { 464 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n",i,j,actual,(tableSize-1)*2); 465 } 466 } else { 467 if (FLT_EPSILON < fabs(expect - actual)) { 468 printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect); 469 testStatus = false; 470 } 471 } 472 } 473 } 373 474 374 475 psFree(myReadout); -
trunk/psModules/test/verified/tst_pmNonLinear.stderr
r2942 r2956 64 64 <DATE><TIME>|<HOST>|W|pmNonLinearityLookup 65 65 WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table. 66 <DATE><TIME>|<HOST>|W|vectorBinDisectF32 67 vectorBinDisectF32(): ordinate 100.000000 is outside vector range (0.000000 - 23.000000). 68 <DATE><TIME>|<HOST>|W|pmNonLinearityLookup 69 WARNING: pmNonLinear.c: pmNonLinearityLookup(): 1 pixels outside table. 66 70 67 71 ---> TESTPOINT PASSED (Test Point Driver{pmNonLinearityLookup(): error/warning conditions} | tst_pmNonLinear.c) -
trunk/psModules/test/verified/tst_pmNonLinear.stdout
r2945 r2956 107 107 ------------------------------------------------------------ 108 108 Calling pmNonLinearityLookup() with one pixels outside inFlux range. Should generate warnings. 109 ------------------------------------------------------------ 110 Calling pmNonLinearityLookup() with one pixels outside inFlux range. Should generate warnings. 109 111 110 112 ---> TESTPOINT PASSED (pmNonLinear{Testing bad input parameter conditions.} | tst_pmNonLinear.c)
Note:
See TracChangeset
for help on using the changeset viewer.
