IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 18, 2005, 11:23:21 AM (21 years ago)
Author:
gusciora
Message:

....

File:
1 edited

Legend:

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

    r5294 r5549  
    66*  @author GLG, MHPCC
    77*
    8 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-10-12 21:02:20 $
     8*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-11-18 21:23:21 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3535}
    3636
    37 #define NX_TERMS 2
    38 #define NY_TERMS 3
    39 #define NZ_TERMS 4
    40 #define NT_TERMS 5
     37#define ORDER_X 2
     38#define ORDER_Y 3
     39#define ORDER_Z 4
     40#define ORDER_T 5
    4141
    4242psS32 testPlaneTransformAlloc( void )
    4343{
    4444    // Allocate psPlaneTransform with known x and y terms
    45     psPlaneTransform *myPT = psPlaneTransformAlloc(NX_TERMS, NY_TERMS);
     45    psPlaneTransform *myPT = psPlaneTransformAlloc(ORDER_X, ORDER_Y);
    4646
    4747    // Verify returned value is not NULL
     
    5252
    5353    // Verify returned transform has members set properly
    54     if ((1 + myPT->x->nX) != NX_TERMS) {
     54    if (myPT->x->nX != ORDER_X) {
    5555        psError(PS_ERR_UNKNOWN,true,"myPT->x->nX is %d, should be %d",
    56                 myPT->x->nX, NX_TERMS-1);
     56                myPT->x->nX, ORDER_X);
    5757        return 2;
    5858    }
    59     if ((1 + myPT->y->nX) != NX_TERMS) {
     59    if (myPT->y->nX != ORDER_X) {
    6060        psError(PS_ERR_UNKNOWN,true,"myPT->y->nX is %d, should be %d",
    61                 myPT->y->nX, NX_TERMS-1);
     61                myPT->y->nX, ORDER_X);
    6262        return 3;
    6363    }
    64     if ((1 + myPT->x->nY) != NY_TERMS) {
     64    if (myPT->x->nY != ORDER_Y) {
    6565        psError(PS_ERR_UNKNOWN,true,"myPT->x->nY is %d, should be %d",
    66                 myPT->x->nY, NY_TERMS-1);
     66                myPT->x->nY, ORDER_Y);
    6767        return 4;
    6868    }
    69     if ((1 + myPT->y->nY) != NY_TERMS) {
     69    if (myPT->y->nY != ORDER_Y) {
    7070        psError(PS_ERR_UNKNOWN,true,"myPT->y->nY is %d, should be %d",
    71                 myPT->y->nY, NY_TERMS-1);
     71                myPT->y->nY, ORDER_Y);
    7272        return 5;
    7373    }
     
    7676    psFree(myPT);
    7777
    78     // Attempt to specify negative x terms and verify NULL returned and errror message generated
    79     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative x terms");
    80     myPT = psPlaneTransformAlloc(-1.0, 1.0);
     78    // Attempt to specify negative x order and verify NULL returned and errror message generated
     79    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative x order");
     80    myPT = psPlaneTransformAlloc(-1, 1);
    8181    if (myPT != NULL) {
    8282        psError(PS_ERR_UNKNOWN,true,"psPlaneTransformAlloc() did not return NULL.");
     
    8484    }
    8585
    86     // Attempt to specify negative y terms and verify NULL returned and error message generated
    87     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative y terms");
    88     myPT = psPlaneTransformAlloc(1.0, -1.0);
     86    // Attempt to specify negative y order and verify NULL returned and error message generated
     87    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative y order");
     88    myPT = psPlaneTransformAlloc(1, -1);
    8989    if (myPT != NULL) {
    9090        psError(PS_ERR_UNKNOWN,true,"psPlaneTransformAlloc() did not return NULL.");
     
    101101{
    102102    // Invoke function with known parameters
    103     psPlaneDistort *myPD = psPlaneDistortAlloc(NX_TERMS, NY_TERMS, NZ_TERMS, NT_TERMS);
     103    psPlaneDistort *myPD = psPlaneDistortAlloc(ORDER_X, ORDER_Y, ORDER_Z, ORDER_T);
    104104
    105105    // Verify NULL is not returned
     
    109109    }
    110110    // Verify the terms are properly set after allocation
    111     if ((1 + myPD->x->nX) != NX_TERMS) {
     111    if (myPD->x->nX != ORDER_X) {
    112112        psError(PS_ERR_UNKNOWN,true,"myPD->x->nX is %d, should be %d",
    113                 myPD->x->nX, NX_TERMS-1);
     113                myPD->x->nX, ORDER_X);
    114114        return 2;
    115115    }
    116     if ((1 + myPD->y->nX) != NX_TERMS) {
     116    if (myPD->y->nX != ORDER_X) {
    117117        psError(PS_ERR_UNKNOWN,true,"myPD->y->nX is %d, should be %d",
    118                 myPD->y->nX, NX_TERMS-1);
     118                myPD->y->nX, ORDER_X);
    119119        return 3;
    120120    }
    121     if ((1 + myPD->x->nY) != NY_TERMS) {
     121    if (myPD->x->nY != ORDER_Y) {
    122122        psError(PS_ERR_UNKNOWN,true,"myPD->x->nY is %d, should be %d",
    123                 myPD->x->nY, NY_TERMS-1);
     123                myPD->x->nY, ORDER_Y);
    124124        return 4;
    125125    }
    126     if ((1 + myPD->y->nY) != NY_TERMS) {
     126    if (myPD->y->nY != ORDER_Y) {
    127127        psError(PS_ERR_UNKNOWN,true,"myPD->y->nY is %d, should be %d",
    128                 myPD->y->nY, NY_TERMS-1);
     128                myPD->y->nY, ORDER_Y);
    129129        return 5;
    130130    }
    131     if ((1 + myPD->x->nZ) != NZ_TERMS) {
     131    if (myPD->x->nZ != ORDER_Z) {
    132132        psError(PS_ERR_UNKNOWN,true,"myPD->x->nZ is %d, should be %d",
    133                 myPD->x->nX, NZ_TERMS-1);
     133                myPD->x->nZ, ORDER_Z);
    134134        return 6;
    135135    }
    136     if ((1 + myPD->y->nZ) != NZ_TERMS) {
     136    if (myPD->y->nZ != ORDER_Z) {
    137137        psError(PS_ERR_UNKNOWN,true,"myPD->y->nZ is %d, should be %d",
    138                 myPD->y->nZ, NZ_TERMS-1);
     138                myPD->y->nZ, ORDER_Z);
    139139        return 7;
    140140    }
    141     if ((1 + myPD->x->nT) != NT_TERMS) {
     141    if (myPD->x->nT != ORDER_T) {
    142142        psError(PS_ERR_UNKNOWN,true,"myPD->x->nT is %d, should be %d",
    143                 myPD->x->nT, NT_TERMS-1);
     143                myPD->x->nT, ORDER_T);
    144144        return 8;
    145145    }
    146     if ((1 + myPD->y->nT) != NT_TERMS) {
     146    if (myPD->y->nT != ORDER_T) {
    147147        psError(PS_ERR_UNKNOWN,true,"myPD->y->nT is %d, should be %d",
    148                 myPD->y->nT, NT_TERMS-1);
     148                myPD->y->nT, ORDER_T);
    149149        return 9;
    150150    }
     
    152152    psFree(myPD);
    153153
    154     // Invoke function with negative x term parameter
    155     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative x term");
    156     myPD = psPlaneDistortAlloc(-1.0, 1.0, 1.0, 1.0);
     154    // Invoke function with negative x order parameter
     155    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative x order");
     156    myPD = psPlaneDistortAlloc(-1, 1, 1, 1);
    157157    if (myPD != NULL) {
    158158        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
     
    160160    }
    161161
    162     // Invoke function with negative y term parameter
    163     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative y term");
    164     myPD = psPlaneDistortAlloc(1.0, -1.0, 1.0, 1.0);
     162    // Invoke function with negative y order parameter
     163    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative y order");
     164    myPD = psPlaneDistortAlloc(1, -1, 1, 1);
    165165    if (myPD != NULL) {
    166166        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
     
    168168    }
    169169
    170     // Invoke function with negative z term parameter
    171     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative z term");
    172     myPD = psPlaneDistortAlloc(1.0, 1.0, -1.0, 1.0);
     170    // Invoke function with negative z order parameter
     171    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative z order");
     172    myPD = psPlaneDistortAlloc(1, 1, -1, 1);
    173173    if (myPD != NULL) {
    174174        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
     
    176176    }
    177177
    178     // Invoke function with negative w term parameter
    179     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative w term");
    180     myPD = psPlaneDistortAlloc(1.0, 1.0, 1.0, -1.0);
     178    // Invoke function with negative t order parameter
     179    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative w order");
     180    myPD = psPlaneDistortAlloc(1, 1, 1, -1);
    181181    if (myPD != NULL) {
    182182        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
Note: See TracChangeset for help on using the changeset viewer.