IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3367


Ignore:
Timestamp:
Mar 2, 2005, 1:00:17 PM (21 years ago)
Author:
evanalst
Message:

Update test case psPlaneDistortAlloc test cases.

Location:
trunk/psLib/test/astronomy
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astronomy/tst_psCoord.c

    r3366 r3367  
    66*  @author GLG, MHPCC
    77*
    8 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-03-02 21:03:20 $
     8*  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-03-02 23:00:17 $
    1010*
    1111*  XXX: THe psProject() and psDeproject() functions do not work fully.  They
     
    2323static psS32 testSphereTransformAlloc( void );
    2424static psS32 testPlaneTransformAlloc( void );
    25 static psS32 test1c( void );
     25static psS32 testPlaneDistortAlloc( void );
    2626static psS32 test2( void );
    2727static psS32 test3( void );
     
    4545                              {testSphereTransformAlloc, 819, "psSphereTransformAlloc()", 0, false},
    4646                              {testPlaneTransformAlloc, 826, "psPlaneTransformAlloc()", 0, false},
    47                               {test1c, 0000, "psPlaneDistortAlloc()", 0, false},
     47                              {testPlaneDistortAlloc, 827, "psPlaneDistortAlloc()", 0, false},
    4848                              {test2, 0000, "psPlaneTransformApply()", 0, false},
    4949                              {test3, 0000, "psPlaneDistortApply()", 0, false},
     
    148148psS32 testPlaneTransformAlloc( void )
    149149{
    150     //    psS32 testStatus = 0;
    151150    // Allocate psPlaneTransform with known x and y terms
    152151    psPlaneTransform *myPT = psPlaneTransformAlloc(NX_TERMS, NY_TERMS);
     
    205204
    206205
    207 psS32 test1c( void )
    208 {
    209     psS32 testStatus = 0;
     206psS32 testPlaneDistortAlloc( void )
     207{
     208    // Invoke function with known parameters
    210209    psPlaneDistort *myPD = psPlaneDistortAlloc(NW_TERMS, NX_TERMS, NY_TERMS, NZ_TERMS);
    211210
     211    // Verify NULL is not returned
     212    if(myPD == NULL) {
     213        psError(PS_ERR_UNKNOWN,true,"Return of NULL not expected");
     214        return 1;
     215    }
     216    // Verify the terms are properly set after allocation
    212217    if (myPD->x->nW != NW_TERMS) {
    213         printf("ERROR: myPD->x->nW is %d, should be %d\n", myPD->x->nW, NW_TERMS);
    214         testStatus = 1;
     218        psError(PS_ERR_UNKNOWN,true,"myPD->x->nW is %d, should be %d",
     219                myPD->x->nW, NW_TERMS);
     220        return 2;
    215221    }
    216222    if (myPD->y->nW != NW_TERMS) {
    217         printf("ERROR: myPD->y->nW is %d, should be %d\n", myPD->y->nW, NW_TERMS);
    218         testStatus = 1;
    219     }
    220 
     223        psError(PS_ERR_UNKNOWN,true,"myPD->y->nW is %d, should be %d",
     224                myPD->y->nW, NW_TERMS);
     225        return 3;
     226    }
    221227    if (myPD->x->nX != NX_TERMS) {
    222         printf("ERROR: myPD->x->nX is %d, should be %d\n", myPD->x->nX, NX_TERMS);
    223         testStatus = 1;
     228        psError(PS_ERR_UNKNOWN,true,"myPD->x->nX is %d, should be %d",
     229                myPD->x->nX, NX_TERMS);
     230        return 4;
    224231    }
    225232    if (myPD->y->nX != NX_TERMS) {
    226         printf("ERROR: myPD->y->nX is %d, should be %d\n", myPD->y->nX, NX_TERMS);
    227         testStatus = 1;
    228     }
    229 
     233        psError(PS_ERR_UNKNOWN,true,"myPD->y->nX is %d, should be %d",
     234                myPD->y->nX, NX_TERMS);
     235        return 5;
     236    }
    230237    if (myPD->x->nY != NY_TERMS) {
    231         printf("ERROR: myPD->x->nY is %d, should be %d\n", myPD->x->nY, NY_TERMS);
    232         testStatus = 1;
     238        psError(PS_ERR_UNKNOWN,true,"myPD->x->nY is %d, should be %d",
     239                myPD->x->nY, NY_TERMS);
     240        return 6;
    233241    }
    234242    if (myPD->y->nY != NY_TERMS) {
    235         printf("ERROR: myPD->y->nY is %d, should be %d\n", myPD->y->nY, NY_TERMS);
    236         testStatus = 1;
    237     }
    238 
     243        psError(PS_ERR_UNKNOWN,true,"myPD->y->nY is %d, should be %d",
     244                myPD->y->nY, NY_TERMS);
     245        return 7;
     246    }
    239247    if (myPD->x->nZ != NZ_TERMS) {
    240         printf("ERROR: myPD->x->nZ is %d, should be %d\n", myPD->x->nZ, NZ_TERMS);
    241         testStatus = 1;
     248        psError(PS_ERR_UNKNOWN,true,"myPD->x->nZ is %d, should be %d",
     249                myPD->x->nZ, NZ_TERMS);
     250        return 8;
    242251    }
    243252    if (myPD->y->nZ != NZ_TERMS) {
    244         printf("ERROR: myPD->y->nZ is %d, should be %d\n", myPD->y->nZ, NZ_TERMS);
    245         testStatus = 1;
    246     }
    247 
     253        psError(PS_ERR_UNKNOWN,true,"myPD->y->nZ is %d, should be %d",
     254                myPD->y->nZ, NZ_TERMS);
     255        return 9;
     256    }
     257    // Free psPlaneTransform
    248258    psFree(myPD);
    249259
    250     printf("-------------------------------------------------------------------\n");
    251     printf("Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.\n");
     260    // Invoke function with negative x term parameter
     261    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative x term");
    252262    myPD = psPlaneDistortAlloc(-1.0, 1.0, 1.0, 1.0);
    253263    if (myPD != NULL) {
    254         printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n");
    255         testStatus = false;
    256         myPD = NULL;
    257     }
    258 
    259     printf("-------------------------------------------------------------------\n");
    260     printf("Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.\n");
     264        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
     265        return 10;
     266    }
     267
     268    // Invoke function with negative y term parameter
     269    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative y term");
    261270    myPD = psPlaneDistortAlloc(1.0, -1.0, 1.0, 1.0);
    262271    if (myPD != NULL) {
    263         printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n");
    264         testStatus = false;
    265         myPD = NULL;
    266     }
    267 
    268     printf("-------------------------------------------------------------------\n");
    269     printf("Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.\n");
     272        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
     273        return 11;
     274    }
     275
     276    // Invoke function with negative z term parameter
     277    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative z term");
    270278    myPD = psPlaneDistortAlloc(1.0, 1.0, -1.0, 1.0);
    271279    if (myPD != NULL) {
    272         printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n");
    273         testStatus = false;
    274         myPD = NULL;
    275     }
    276 
    277     printf("-------------------------------------------------------------------\n");
    278     printf("Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.\n");
     280        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
     281        return 12;
     282    }
     283
     284    // Invoke function with negative w term parameter
     285    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative w term");
    279286    myPD = psPlaneDistortAlloc(1.0, 1.0, 1.0, -1.0);
    280287    if (myPD != NULL) {
    281         printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n");
    282         testStatus = false;
    283         myPD = NULL;
    284     }
    285     printf("-------------------------------------------------------------------\n");
    286 
    287     return(testStatus);
     288        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
     289    }
     290
     291    return 0;
    288292}
    289293
  • trunk/psLib/test/astronomy/verified/tst_psCoord.stderr

    r3366 r3367  
    3131\**********************************************************************************/
    3232
     33<DATE><TIME>|<HOST>|I|testPlaneDistortAlloc
     34    Following should generate an error message for negative x term
    3335<DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO)
    3436    Error: n1 is less than 0.
     37<DATE><TIME>|<HOST>|I|testPlaneDistortAlloc
     38    Following should generate an error message for negative y term
    3539<DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO)
    3640    Error: n2 is less than 0.
     41<DATE><TIME>|<HOST>|I|testPlaneDistortAlloc
     42    Following should generate an error message for negative z term
    3743<DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO)
    3844    Error: n3 is less than 0.
     45<DATE><TIME>|<HOST>|I|testPlaneDistortAlloc
     46    Following should generate an error message for negative w term
    3947<DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO)
    4048    Error: n4 is less than 0.
  • trunk/psLib/test/astronomy/verified/tst_psCoord.stdout

    r3366 r3367  
    1 -------------------------------------------------------------------
    2 Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.
    3 -------------------------------------------------------------------
    4 Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.
    5 -------------------------------------------------------------------
    6 Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.
    7 -------------------------------------------------------------------
    8 Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.
    9 -------------------------------------------------------------------
    101-------------------------------------------------------------------
    112Calling psPlaneTransformApply() with NULL psPlaneTransform.  Should generate error, return NULL.
Note: See TracChangeset for help on using the changeset viewer.