IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2961


Ignore:
Timestamp:
Jan 11, 2005, 1:39:41 PM (22 years ago)
Author:
evanalst
Message:

Add addition test case to verify linear interpolation between values.

Location:
trunk/psModules/test
Files:
2 edited

Legend:

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

    r2956 r2961  
    1616 *  @author GLG, MHPCC
    1717 *
    18  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    19  *  @date $Date: 2005-01-11 20:47:39 $
     18 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     19 *  @date $Date: 2005-01-11 23:39:41 $
    2020 *
    2121 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    462462            if(i==(NUM_ROWS-1) && j==(NUM_COLS-1)) {
    463463                if(actual != (tableSize-1)*2) {
    464                     printf("TEST ERROR: image[%d][%d] is %f, should be %f\n",i,j,actual,(tableSize-1)*2);
     464                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n",i,j,actual,(tableSize-1)*2.0);
    465465                }
    466466            } else {
     
    469469                    testStatus = false;
    470470                }
     471            }
     472        }
     473    }
     474
     475    test03Init(myReadout);
     476    printf("------------------------------------------------------------\n");
     477    printf("Calling pmNonLinearityLookup() with image values not in vector.\n");
     478    myReadout->image->data.F32[0][0] = 0.5;
     479    rc = pmNonLinearityLookup(myReadout, in, out);
     480    if (rc == NULL) {
     481        printf("TEST ERROR: pmNonLinearityPolynomial() returned a NULL psReadout\n");
     482        testStatus = false;
     483    }
     484    for (i=0;i<NUM_ROWS;i++) {
     485        for (j=0;j<NUM_COLS;j++) {
     486            psF32 expect = (float) (2 * (i + j));
     487            if(i==0 && j==0) {
     488                expect = 1.0;
     489            }
     490            psF32 actual = rc->image->data.F32[i][j];
     491            if (FLT_EPSILON < fabs(expect - actual)) {
     492                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j, actual, expect);
     493                testStatus = false;
    471494            }
    472495        }
  • trunk/psModules/test/verified/tst_pmNonLinear.stdout

    r2956 r2961  
    109109------------------------------------------------------------
    110110Calling pmNonLinearityLookup() with one pixels outside inFlux range.  Should generate warnings.
     111------------------------------------------------------------
     112Calling pmNonLinearityLookup() with image values not in vector.
    111113
    112114---> TESTPOINT PASSED (pmNonLinear{Testing bad input parameter conditions.} | tst_pmNonLinear.c)
Note: See TracChangeset for help on using the changeset viewer.