IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1952


Ignore:
Timestamp:
Oct 4, 2004, 3:05:09 PM (22 years ago)
Author:
evanalst
Message:

Add additional checks for invalid arguments.

Location:
trunk/psLib/test/image
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/image/tst_psImageStats02.c

    r1811 r1952  
    2626    psImage *outImage = NULL;
    2727    psPolynomial2D *my2DPoly = NULL;
     28    psPolynomial2D *null2DPoly = NULL;
    2829    int testStatus = true;
    2930    int memLeaks = 0;
     
    5455                             "Calculate Chebyshev Polynomials, no mask" );
    5556
    56     my2DPoly = psImageFitPolynomial( tmpImage, my2DPoly );
     57    my2DPoly = psImageFitPolynomial( my2DPoly, tmpImage );
    5758    for ( i = 0;i < CHEBY_X_DIM;i++ ) {
    5859        for ( j = 0;j < CHEBY_Y_DIM;j++ ) {
    5960            printf( "Cheby Polynomial (%d, %d) coefficient is %.2f\n", i, j, 0.0001f+my2DPoly->coeff[ i ][ j ] );
    6061        }
     62    }
     63
     64    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error message for NULL coeffs argument.");
     65    null2DPoly = psImageFitPolynomial( NULL, tmpImage );
     66    if ( null2DPoly != NULL ) {
     67        printf("ERROR: psImageFitPolynomial did not return NULL with invalid coeffs argument.");
     68    }
     69
     70    psLogMsg(__func__,PS_LOG_INFO,"Following should be a error message for NULL input argument.");
     71    null2DPoly = psImageFitPolynomial( null2DPoly, NULL );
     72    if ( null2DPoly != NULL ) {
     73        printf("ERROR: psImageFitPolynomial did not return NULL with null input image.");
    6174    }
    6275
Note: See TracChangeset for help on using the changeset viewer.