IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6381


Ignore:
Timestamp:
Feb 8, 2006, 11:30:09 AM (20 years ago)
Author:
gusciora
Message:

Tests for psPlaneAlloc() psPlaneFree().

File:
1 edited

Legend:

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

    r6268 r6381  
    66*  @author GLG, MHPCC
    77*
    8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2006-01-31 23:24:21 $
     8*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2006-02-08 21:30:09 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1616static psS32 testPlaneTransformAlloc(void);
    1717static psS32 testPlaneDistortAlloc(void);
     18static psS32 testPlaneAlloc(void);
    1819static psS32 testPlaneTransformApply(void);
    1920static psS32 testPlaneDistortApply(void);
     
    2324                              {testPlaneTransformAlloc, 826, "psPlaneTransformAlloc()", 0, false},
    2425                              {testPlaneDistortAlloc, 827, "psPlaneDistortAlloc()", 0, false},
     26                              {testPlaneAlloc, -1, "psPlaneAlloc()", 0, false},
    2527                              {testPlaneTransformApply, 831, "psPlaneTransformApply()", 0, false},
    2628                              {testPlaneDistortApply, 832, "psPlaneDistortApply()", 0, false},
     
    4143#define ORDER_Z 4
    4244#define ORDER_T 5
     45
     46psS32 testPlaneAlloc( void )
     47{
     48    // Allocate psPlane.
     49    psPlane *myP = psPlaneAlloc();
     50
     51    // Verify returned value is not NULL
     52    if(myP == NULL) {
     53        psError(PS_ERR_UNKNOWN, true, "psPlaneAlloc() returned NULL not expected.");
     54        return 1;
     55    }
     56
     57    // Verify returned transform has members set properly
     58    if (!isnan(myP->x)) {
     59        psError(PS_ERR_UNKNOWN,true,"myP->x is %d, should be %d", myP->x, NAN);
     60        return 2;
     61    }
     62
     63    if (!isnan(myP->y)) {
     64        psError(PS_ERR_UNKNOWN,true,"myP->y is %d, should be %d", myP->y, NAN);
     65        return 3;
     66    }
     67
     68    if (!isnan(myP->xErr)) {
     69        psError(PS_ERR_UNKNOWN,true,"myP->xErr is %d, should be %d", myP->xErr, NAN);
     70        return 4;
     71    }
     72
     73    if (!isnan(myP->yErr)) {
     74        psError(PS_ERR_UNKNOWN,true,"myP->yErr is %d, should be %d", myP->yErr, NAN);
     75        return 5;
     76    }
     77
     78    // Free psPlane
     79    psFree(myP);
     80
     81    return 0;
     82}
    4383
    4484psS32 testPlaneTransformAlloc( void )
Note: See TracChangeset for help on using the changeset viewer.