IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 3, 2004, 3:05:00 PM (22 years ago)
Author:
desonia
Message:

changed the psError signature to match SDRS. Also made misc. cleanups as
I was combing the files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/image/tst_psImageIO.c

    r2204 r2273  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-27 00:57:33 $
     8 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-11-04 01:05:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9797        remove(filename); \
    9898        if (! psImageWriteSection(img3,0,0,1,NULL,0,filename)) { \
    99             psError(__func__,"Failed to write test image %s",filename); \
     99            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
    100100            return 1; \
    101101        } \
    102102        if (! psImageWriteSection(img,0,0,0,NULL,0,filename)) { \
    103             psError(__func__,"Failed to write test image %s",filename); \
     103            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
    104104            return 2; \
    105105        } \
    106106        if (! psImageWriteSection(img,0,0,1,NULL,1,filename)) { \
    107             psError(__func__,"Failed to write test image %s",filename); \
     107            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
    108108            return 3; \
    109109        } \
    110110        if (! psImageWriteSection(img3,0,0,0,NULL,1,filename)) { \
    111             psError(__func__,"Failed to write test image %s",filename); \
     111            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
    112112            return 4; \
    113113        } \
     
    119119        img = psImageReadSection(img,readM0,readN0,readM,readN,0,NULL,0,filename); \
    120120        /*        if (img_ref != img) { */ \
    121         /*            psError(__func__,"psImageReadSection didn't recycle the psImage?"); */ \
     121        /*            psError(PS_ERR_UNKNOWN, true,"psImageReadSection didn't recycle the psImage?"); */ \
    122122        /*            return 5; */ \
    123123        /*        } */ \
    124124        img3 = psImageReadSection(img3,readM0,readN0,readM,readN,1,NULL,0,filename); \
    125125        if (img3 == NULL) { \
    126             psError(__func__,"Failed to read test image %s",filename); \
     126            psError(PS_ERR_UNKNOWN, true,"Failed to read test image %s",filename); \
    127127            return 6; \
    128128        } \
     
    134134            for (psU32 col = readM0; col < readM; col++) { \
    135135                if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \
    136                     psError(__func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
     136                    psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
    137137                            col,row,(psF32)imgRow[col-readM0],(psF32)img2Row[col],filename); \
    138138                    return 7; \
    139139                } \
    140140                if (fabsf(img3Row[col-readM0]-img4Row[col]) > FLT_EPSILON) { \
    141                     psError(__func__,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \
     141                    psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \
    142142                            col,row,(psF32)img3Row[col-readM0],(psF32)img4Row[col],filename); \
    143143                    return 8; \
     
    152152        img = psImageReadSection(img,readM0,readN0,readM,readN,1,NULL,1,filename); \
    153153        if (img == NULL) { \
    154             psError(__func__,"Failed to read test image %s",filename); \
     154            psError(PS_ERR_UNKNOWN, true,"Failed to read test image %s",filename); \
    155155            return 9; \
    156156        } \
     
    162162            for (psU32 col = readM0; col < readM; col++) { \
    163163                if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \
    164                     psError(__func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
     164                    psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
    165165                            col,row,(psF32)imgRow[col-readM0],(psF32)img2Row[col],filename); \
    166166                    return 10; \
    167167                } \
    168168                if (fabsf(img3Row[col-readM0]-img4Row[col]) > FLT_EPSILON) { \
    169                     psError(__func__,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \
     169                    psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \
    170170                            col,row,(psF32)img3Row[col-readM0],(psF32)img4Row[col],filename); \
    171171                    return 11; \
     
    204204    image = psImageReadSection(image,0,0,M,N,0,NULL,0,"foobar.fits");
    205205    if (image != NULL) {
    206         psError(__func__,"Image returned though filename did not exist.");
     206        psError(PS_ERR_UNKNOWN, true,"Image returned though filename did not exist.");
    207207        return 12;
    208208    }
     
    220220    image = psImageReadSection(image,0,0,M,N,0,NULL,0,NULL);
    221221    if (image != NULL) {
    222         psError(__func__,"Image returned though filename was NULL.");
     222        psError(PS_ERR_UNKNOWN, true,"Image returned though filename was NULL.");
    223223        return 13;
    224224    }
     
    233233    image = psImageReadSection(image,0,0,M,N,0,NULL,4,"tmpImages/MxN_F32.fits");
    234234    if (image != NULL) {
    235         psError(__func__,"Image returned though extnum was invalid.");
     235        psError(PS_ERR_UNKNOWN, true,"Image returned though extnum was invalid.");
    236236        return 14;
    237237    }
     
    239239    image = psImageReadSection(image,0,0,M,N,0,"bogus",0,"tmpImages/MxN_F32.fits");
    240240    if (image != NULL) {
    241         psError(__func__,"Image returned though extnum was invalid.");
     241        psError(PS_ERR_UNKNOWN, true,"Image returned though extnum was invalid.");
    242242        return 15;
    243243    }
     
    302302        ;
    303303    if (! psImageWriteSection(img,0,0,0,NULL,0,"tmpImages/writeTest.fits")) {
    304         psError(__func__,"Couldn't write writeTest.fits.");
     304        psError(PS_ERR_UNKNOWN, true,"Couldn't write writeTest.fits.");
    305305        return 14;
    306306    }
    307307    if (! psImageWriteSection(img2,0,0,0,NULL,0,"tmpImages/writeTest.fits")) {
    308         psError(__func__,"Couldn't overwrite writeTest.fits.");
     308        psError(PS_ERR_UNKNOWN, true,"Couldn't overwrite writeTest.fits.");
    309309        return 15;
    310310    }
     
    315315    img = psImageReadSection(NULL,0,0,m,n,0,NULL,0,"tmpImages/writeTest.fits");
    316316    if (img == NULL) {
    317         psError(__func__,"Could not read in writeTest.fits.");
     317        psError(PS_ERR_UNKNOWN, true,"Could not read in writeTest.fits.");
    318318        return 16;
    319319    }
     
    322322        for (psU32 col=0;col<m;col++) {
    323323            if (fabsf(imgRow[col] - (row+2*col)) > FLT_EPSILON) {
    324                 psError(__func__,"The image values were not overwritten at %d,%d (%.2f vs %.2f)",
     324                psError(PS_ERR_UNKNOWN, true,"The image values were not overwritten at %d,%d (%.2f vs %.2f)",
    325325                        col,row,imgRow[col],(row+2*col));
    326326                return 17;
     
    337337    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message because input image is null.");
    338338    if ( psImageWriteSection(NULL,0,0,0,NULL,0,"tmpImages/writeTest.fits")) {
    339         psError(__func__,"psImageWriteSection did not return false when input image is NULL.");
     339        psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false when input image is NULL.");
    340340        return 20;
    341341    }
     
    347347    GENIMAGE(img,32,32,S8,row+2*col);
    348348    if ( psImageWriteSection(img,0,0,0,NULL,0,"tmpImages/writeTest.fits")) {
    349         psError(__func__,"psImageWriteSection did not return false when input image type invalid.");
     349        psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false when input image type invalid.");
    350350        return 21;
    351351    }
     
    358358    GENIMAGE(img,32,32,U8,row+2*col);
    359359    if ( psImageWriteSection(img,0,0,0,NULL,0,"panstarrs/writeFits.fits")) {
    360         psError(__func__,"psImageWriteSection did not return false for invalid path name.");
     360        psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false for invalid path name.");
    361361        return 22;
    362362    }
     
    370370    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for passing invalid FITS file.");
    371371    if ( psImageWriteSection(img,0,0,0,NULL,0,"tmpImages/writeInvalidFile.fits")) {
    372         psError(__func__,"psImageWriteSection did not return false for invalid FITS file.");
     372        psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false for invalid FITS file.");
    373373        return 22;
    374374    }
     
    381381    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid extension name.");
    382382    if ( psImageWriteSection(img,0,0,0,"ext2",0,"tmpImages/writeTest.fits")) {
    383         psError(__func__,"psImageWriteSection did not return false for invalid extension name.");
     383        psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false for invalid extension name.");
    384384        return 23;
    385385    }
     
    390390    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid extension number.");
    391391    if ( psImageWriteSection(img,0,0,0,NULL,99,"tmpImages/writeTest.fits")) {
    392         psError(__func__,"psImageWriteSection did not return false for invalid extension number.");
     392        psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false for invalid extension number.");
    393393        return 24;
    394394    }
Note: See TracChangeset for help on using the changeset viewer.