IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 5, 2005, 1:25:25 PM (22 years ago)
Author:
gusciora
Message:

Added tests to for various input parameters being NULL, or of incorrect
length.

File:
1 edited

Legend:

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

    r2856 r2915  
    77 *  @author GLG, MHPCC
    88 *
    9  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-12-30 21:35:04 $
     9 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-01-05 23:25:25 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6565        for (j=0;j<numCols;j++) {
    6666            if (ERROR_TOLERANCE < fabs(myReadout->image->data.F32[i][j])) {
    67                 printf("ERROR: image[%d][%d] is %f, should be 0.0\n", i, j, myReadout->image->data.F32[i][j]);
     67                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j, myReadout->image->data.F32[i][j]);
    6868                testStatus = 1;
    6969            }
     
    113113        for (j=0;j<numCols;j++) {
    114114            if (errorTolerance < fabs(myReadout->image->data.F32[i][j] - trueImage->data.F32[i][j])) {
    115                 printf("ERROR: image[%d][%d] is %f, should be %f\n", i, j,
     115                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j,
    116116                       myReadout->image->data.F32[i][j], trueImage->data.F32[i][j]);
    117117                testStatus = 1;
     
    201201    rc = pmSubtractSky(NULL, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
    202202    if (rc != NULL) {
    203         printf("ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
     203        printf("TEST ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
    204204        testStatus = false;
    205205    }
     
    210210    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
    211211    if (rc != NULL) {
    212         printf("ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
     212        printf("TEST ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
    213213        testStatus = false;
    214214    }
     
    220220    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
    221221    if (rc != NULL) {
    222         printf("ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
    223         testStatus = false;
    224     }
    225     myReadout->image = tmpImageF32;
    226 
    227     printf("----------------------------------------------------------------\n");
    228     printf("Calling pmSubtractSky() with NULL fitSpec.  Should return image, no ERROR, no WARNING.\n\n");
     222        printf("TEST ERROR: pmSubtractSky() returned a non-NULL psReadout\n");
     223        testStatus = false;
     224    }
     225    myReadout->image = tmpImageF32;
     226
     227    printf("----------------------------------------------------------------\n");
     228    printf("Calling pmSubtractSky() with NULL fitSpec.  Should return image, no TEST ERROR, no WARNING.\n\n");
    229229    rc = pmSubtractSky(myReadout, NULL, PM_FIT_POLYNOMIAL, 1, myStats, 2.0);
    230230    if (rc != myReadout) {
    231         printf("ERROR: pmSubtractSky() returned something other than psReadout\n");
    232         testStatus = false;
    233     }
    234 
    235     printf("----------------------------------------------------------------\n");
    236     printf("Calling pmSubtractSky() with PM_FIT_NONE fit.  Should return image, no ERROR, no WARNING.\n\n");
     231        printf("TEST ERROR: pmSubtractSky() returned something other than psReadout\n");
     232        testStatus = false;
     233    }
     234
     235    printf("----------------------------------------------------------------\n");
     236    printf("Calling pmSubtractSky() with PM_FIT_NONE fit.  Should return image, no TEST ERROR, no WARNING.\n\n");
    237237    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_NONE, 1, myStats, 2.0);
    238238    if (rc != myReadout) {
    239         printf("ERROR: pmSubtractSky() returned something other than psReadout\n");
    240         testStatus = false;
    241     }
    242 
    243     printf("----------------------------------------------------------------\n");
    244     printf("Calling pmSubtractSky() with PM_FIT_SPLINE fit.  Should return image, no ERROR, no WARNING.\n\n");
     239        printf("TEST ERROR: pmSubtractSky() returned something other than psReadout\n");
     240        testStatus = false;
     241    }
     242
     243    printf("----------------------------------------------------------------\n");
     244    printf("Calling pmSubtractSky() with PM_FIT_SPLINE fit.  Should return image, no TEST ERROR, no WARNING.\n\n");
    245245    rc = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_SPLINE, 1, myStats, 2.0);
    246246    if (rc != myReadout) {
    247         printf("ERROR: pmSubtractSky() returned something other than psReadout\n");
     247        printf("TEST ERROR: pmSubtractSky() returned something other than psReadout\n");
    248248        testStatus = false;
    249249    }
     
    255255        for (j=0;j<NUM_COLS_SMALL;j++) {
    256256            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
    257                 printf("ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
     257                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
    258258                       rc->image->data.F32[i][j]);
    259259                testStatus = false;
     
    270270        for (j=0;j<NUM_COLS_SMALL;j++) {
    271271            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
    272                 printf("ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
     272                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
    273273                       rc->image->data.F32[i][j]);
    274274                testStatus = false;
     
    286286        for (j=0;j<NUM_COLS_SMALL;j++) {
    287287            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
    288                 printf("ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
     288                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
    289289                       rc->image->data.F32[i][j]);
    290290                testStatus = false;
     
    300300        for (j=0;j<NUM_COLS_SMALL;j++) {
    301301            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
    302                 printf("ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
     302                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
    303303                       rc->image->data.F32[i][j]);
    304304                testStatus = false;
     
    313313        for (j=0;j<NUM_COLS_SMALL;j++) {
    314314            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
    315                 printf("ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
     315                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
    316316                       rc->image->data.F32[i][j]);
    317317                testStatus = false;
     
    326326        for (j=0;j<NUM_COLS_SMALL;j++) {
    327327            if (ERROR_TOLERANCE < fabs(rc->image->data.F32[i][j])) {
    328                 printf("ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
     328                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j,
    329329                       rc->image->data.F32[i][j]);
    330330                testStatus = false;
     
    337337    rc = pmSubtractSky(myReadout, (void *) myPoly, 54321, 1, myStats, -1.0);
    338338    if (rc != myReadout) {
    339         printf("ERROR: pmSubtractSky() returned something other than psReadout\n");
     339        printf("TEST ERROR: pmSubtractSky() returned something other than psReadout\n");
    340340        testStatus = false;
    341341    }
Note: See TracChangeset for help on using the changeset viewer.