IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 12:51:56 PM (22 years ago)
Author:
gusciora
Message:

Testing the plane transform and allocators and deallocators.

File:
1 edited

Legend:

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

    r2199 r2201  
    66*  @author GLG, MHPCC
    77*
    8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-10-26 21:57:32 $
     8*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-10-26 22:51:56 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1616
    1717static int test1( void );
     18static int test1b( void );
     19static int test1c( void );
    1820static int test2( void );
    1921static int test3( void );
     
    3032testDescription tests[] = {
    3133                              {test1, 0000, "psSphereTransformAlloc()", 0, false},
     34                              {test1b, 0000, "psPlaneTransformAlloc()", 0, false},
     35                              {test1c, 0000, "psPlaneDistortAlloc()", 0, false},
    3236                              {test2, 0000, "psPlaneTransformApply()", 0, false},
    3337                              {test3, 0000, "psPlaneDistortApply()", 0, false},
     
    111115
    112116    psFree(myST);
     117    return(testStatus);
     118}
     119
     120#define NW_TERMS 2
     121#define NX_TERMS 3
     122#define NY_TERMS 4
     123#define NZ_TERMS 5
     124int test1b( void )
     125{
     126    int testStatus = 0;
     127    psPlaneTransform *myPT = psPlaneTransformAlloc(NX_TERMS, NY_TERMS);
     128
     129    if (myPT->x->nX != NX_TERMS) {
     130        printf("ERROR: myPT->x->nX is %d, should be %d\n", myPT->x->nX, NX_TERMS);
     131        testStatus = 1;
     132    }
     133    if (myPT->y->nX != NX_TERMS) {
     134        printf("ERROR: myPT->y->nX is %d, should be %d\n", myPT->y->nX, NX_TERMS);
     135        testStatus = 1;
     136    }
     137
     138    if (myPT->x->nY != NY_TERMS) {
     139        printf("ERROR: myPT->x->nY is %d, should be %d\n", myPT->x->nY, NY_TERMS);
     140        testStatus = 1;
     141    }
     142    if (myPT->y->nY != NY_TERMS) {
     143        printf("ERROR: myPT->y->nY is %d, should be %d\n", myPT->y->nY, NY_TERMS);
     144        testStatus = 1;
     145    }
     146
     147    psFree(myPT);
     148    return(testStatus);
     149}
     150int test1c( void )
     151{
     152    int testStatus = 0;
     153    psPlaneDistort *myPD = psPlaneDistortAlloc(NW_TERMS, NX_TERMS, NY_TERMS, NZ_TERMS);
     154
     155    if (myPD->x->nW != NW_TERMS) {
     156        printf("ERROR: myPD->x->nW is %d, should be %d\n", myPD->x->nW, NW_TERMS);
     157        testStatus = 1;
     158    }
     159    if (myPD->y->nW != NW_TERMS) {
     160        printf("ERROR: myPD->y->nW is %d, should be %d\n", myPD->y->nW, NW_TERMS);
     161        testStatus = 1;
     162    }
     163
     164    if (myPD->x->nX != NX_TERMS) {
     165        printf("ERROR: myPD->x->nX is %d, should be %d\n", myPD->x->nX, NX_TERMS);
     166        testStatus = 1;
     167    }
     168    if (myPD->y->nX != NX_TERMS) {
     169        printf("ERROR: myPD->y->nX is %d, should be %d\n", myPD->y->nX, NX_TERMS);
     170        testStatus = 1;
     171    }
     172
     173    if (myPD->x->nY != NY_TERMS) {
     174        printf("ERROR: myPD->x->nY is %d, should be %d\n", myPD->x->nY, NY_TERMS);
     175        testStatus = 1;
     176    }
     177    if (myPD->y->nY != NY_TERMS) {
     178        printf("ERROR: myPD->y->nY is %d, should be %d\n", myPD->y->nY, NY_TERMS);
     179        testStatus = 1;
     180    }
     181
     182    if (myPD->x->nZ != NZ_TERMS) {
     183        printf("ERROR: myPD->x->nZ is %d, should be %d\n", myPD->x->nZ, NZ_TERMS);
     184        testStatus = 1;
     185    }
     186    if (myPD->y->nZ != NZ_TERMS) {
     187        printf("ERROR: myPD->y->nZ is %d, should be %d\n", myPD->y->nZ, NZ_TERMS);
     188        testStatus = 1;
     189    }
     190
     191    psFree(myPD);
    113192    return(testStatus);
    114193}
Note: See TracChangeset for help on using the changeset viewer.