IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2956


Ignore:
Timestamp:
Jan 11, 2005, 10:47:39 AM (22 years ago)
Author:
evanalst
Message:

Add addition test case to check for pixel above max and image value checks.

Location:
trunk/psModules/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/tst_pmNonLinear.c

    r2955 r2956  
    1616 *  @author GLG, MHPCC
    1717 *
    18  *  @version $Revision: 1.12 $ $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 $
    2020 *
    2121 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    243243        outBig->data.F32[i] = (float) (2 * i);
    244244        if (i < tableSize-1) {
    245             inSmall->data.F32[i] = (float) (2 * i);
     245            inSmall->data.F32[i] = (float) i;
    246246            outSmall->data.F32[i] = (float) (2 * i);
    247247        }
     
    315315        testStatus = false;
    316316    }
     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    }
    317327
    318328    test03Init(myReadout);
     
    324334        testStatus = false;
    325335    }
     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    }
    326346
    327347    test03Init(myReadout);
     
    333353        testStatus = false;
    334354    }
     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    }
    335365
    336366    test03Init(myReadout);
     
    342372        testStatus = false;
    343373    }
     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    }
    344384
    345385    test03Init(myReadout);
     
    350390        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
    351391        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        }
    352402    }
    353403
     
    360410        testStatus = false;
    361411    }
     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    }
    362422
    363423    printf("------------------------------------------------------------\n");
     
    370430        testStatus = false;
    371431    }
    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    }
    373474
    374475    psFree(myReadout);
  • trunk/psModules/test/verified/tst_pmNonLinear.stderr

    r2942 r2956  
    6464<DATE><TIME>|<HOST>|W|pmNonLinearityLookup
    6565    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.
    6670
    6771---> TESTPOINT PASSED (Test Point Driver{pmNonLinearityLookup(): error/warning conditions} | tst_pmNonLinear.c)
  • trunk/psModules/test/verified/tst_pmNonLinear.stdout

    r2945 r2956  
    107107------------------------------------------------------------
    108108Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.
     109------------------------------------------------------------
     110Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.
    109111
    110112---> TESTPOINT PASSED (pmNonLinear{Testing bad input parameter conditions.} | tst_pmNonLinear.c)
Note: See TracChangeset for help on using the changeset viewer.