IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6529


Ignore:
Timestamp:
Mar 6, 2006, 12:53:47 PM (20 years ago)
Author:
gusciora
Message:

This fixes a problem with psMemCheckPtr on staticly allocated data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/astrom/tst_pmAstrometry01.c

    r6511 r6529  
    55*  @author GLG, MHPCC
    66*
    7 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2006-03-04 01:01:33 $
     7*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2006-03-06 22:53:47 $
    99*
    1010* XXX: Add tests were the coordinate does not transform to any legitimate cell
     
    248248    psPlane cellCoord;
    249249    psPlane testCoord;
    250     psSphere skyCoord;
     250    psSphere *skyCoord = psSphereAlloc();
     251    // XXX: This code causes a seg fault.
     252    //    psSphere skyTmp;
     253    //    psMemCheckType(PS_DATA_SPHERE, &skyTmp);
    251254    psPlane tpCoord;
    252255    psS32 testStatus = 0;
     
    340343                    if (VERBOSE) {
    341344                        printf("------------------ (%.2f, %.2f) ------------------\n", fpaCoord.x, fpaCoord.y);
     345                        printf("(chip, cell, x, y) is (%d, %d, %d, %d)\n", chip, cell, x, y);
    342346                    }
    343347                    pmChip* tmpChip = pmChipInFPA(&fpaCoord, myFPA);
     
    405409                        //
    406410                        if (1) {
    407                             psSphere *rc = pmCoordTPToSky(&skyCoord, &testCoord, myFPA->projection);
     411                            psSphere *rc = pmCoordTPToSky(skyCoord, &testCoord, myFPA->projection);
    408412                            if (rc == NULL) {
    409413                                printf("pmCoordTPToSky() failed.\n");
    410414                            } else {
    411                                 psPlane *rc = pmCoordSkyToTP(&tpCoord, &skyCoord, myFPA->projection);
     415                                psPlane *rc = pmCoordSkyToTP(&tpCoord, skyCoord, myFPA->projection);
    412416                                if (rc == NULL) {
    413417                                    printf("pmCoordSkyToTP() failed.\n");
     
    422426                                    }
    423427                                    if (VERBOSE) {
    424                                         printf("(%.2f %.2f) -> (%.2f %.2f) -> (%.2f %.2f)\n", testCoord.x, testCoord.y, skyCoord.r, skyCoord.d, tpCoord.x, tpCoord.y);
     428                                        printf("(%.2f %.2f) -> (%.2f %.2f) -> (%.2f %.2f)\n", testCoord.x, testCoord.y, skyCoord->r, skyCoord->d, tpCoord.x, tpCoord.y);
    425429                                    }
    426430                                }
     
    433437                        if (1) {
    434438                            psPlane tmpCellCoord;
    435                             psSphere *rc = pmCoordCellToSky(&skyCoord, &cellCoord, 0.0, 0.0, myCell);
     439                            psSphere *rc = pmCoordCellToSky(skyCoord, &cellCoord, 0.0, 0.0, myCell);
    436440                            if (rc == NULL) {
    437441                                printf("pmCoordCellToSky() failed.\n");
    438442                            } else {
    439                                 psPlane *rc = pmCoordSkyToCell(&tmpCellCoord, &skyCoord, 0.0, 0.0, myCell);
     443                                psPlane *rc = pmCoordSkyToCell(&tmpCellCoord, skyCoord, 0.0, 0.0, myCell);
    440444                                if (rc == NULL) {
    441445                                    printf("pmCoordSkyToCell() failed.\n");
     
    450454                                    }
    451455                                    if (VERBOSE) {
    452                                         printf("(%.2f %.2f) -> (%.2f %.2f) -> (%.2f %.2f)\n", testCoord.x, testCoord.y, skyCoord.r, skyCoord.d, tmpCellCoord.x, tmpCellCoord.y);
     456                                        printf("(%.2f %.2f) -> (%.2f %.2f) -> (%.2f %.2f)\n", testCoord.x, testCoord.y, skyCoord->r, skyCoord->d, tmpCellCoord.x, tmpCellCoord.y);
    453457                                    }
    454458                                }
     
    464468                        if ((NUM_CHIPS == 1) && (NUM_CELLS == 1)) {
    465469                            psPlane tmpCellCoord;
    466                             psSphere *rc = pmCoordCellToSkyQuick(&skyCoord, &cellCoord, myCell);
     470                            psSphere *rc = pmCoordCellToSkyQuick(skyCoord, &cellCoord, myCell);
    467471                            if (rc == NULL) {
    468472                                printf("pmCoordCellToSkyQuick() failed.\n");
    469473                            } else {
    470                                 psPlane *rc = pmCoordSkyToCellQuick(&tmpCellCoord, &skyCoord, myCell);
     474                                psPlane *rc = pmCoordSkyToCellQuick(&tmpCellCoord, skyCoord, myCell);
    471475                                if (rc == NULL) {
    472476                                    printf("pmCoordSkyToCellQuick() failed.\n");
     
    481485                                    }
    482486                                    if (VERBOSE) {
    483                                         printf("(%.2f %.2f) -> (%.2f %.2f) -> (%.2f %.2f)\n", testCoord.x, testCoord.y, skyCoord.r, skyCoord.d, tmpCellCoord.x, tmpCellCoord.y);
     487                                        printf("(%.2f %.2f) -> (%.2f %.2f) -> (%.2f %.2f)\n", testCoord.x, testCoord.y, skyCoord->r, skyCoord->d, tmpCellCoord.x, tmpCellCoord.y);
    484488                                    }
    485489                                }
     
    512516    }
    513517    psFree(myFPA);
     518    psFree(skyCoord);
    514519
    515520    return(testStatus);
Note: See TracChangeset for help on using the changeset viewer.