Changeset 2273 for trunk/psLib/test/image/tst_psImageIO.c
- Timestamp:
- Nov 3, 2004, 3:05:00 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImageIO.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImageIO.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-11-04 01:05:00 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 97 97 remove(filename); \ 98 98 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); \ 100 100 return 1; \ 101 101 } \ 102 102 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); \ 104 104 return 2; \ 105 105 } \ 106 106 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); \ 108 108 return 3; \ 109 109 } \ 110 110 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); \ 112 112 return 4; \ 113 113 } \ … … 119 119 img = psImageReadSection(img,readM0,readN0,readM,readN,0,NULL,0,filename); \ 120 120 /* 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?"); */ \ 122 122 /* return 5; */ \ 123 123 /* } */ \ 124 124 img3 = psImageReadSection(img3,readM0,readN0,readM,readN,1,NULL,0,filename); \ 125 125 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); \ 127 127 return 6; \ 128 128 } \ … … 134 134 for (psU32 col = readM0; col < readM; col++) { \ 135 135 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", \ 137 137 col,row,(psF32)imgRow[col-readM0],(psF32)img2Row[col],filename); \ 138 138 return 7; \ 139 139 } \ 140 140 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", \ 142 142 col,row,(psF32)img3Row[col-readM0],(psF32)img4Row[col],filename); \ 143 143 return 8; \ … … 152 152 img = psImageReadSection(img,readM0,readN0,readM,readN,1,NULL,1,filename); \ 153 153 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); \ 155 155 return 9; \ 156 156 } \ … … 162 162 for (psU32 col = readM0; col < readM; col++) { \ 163 163 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", \ 165 165 col,row,(psF32)imgRow[col-readM0],(psF32)img2Row[col],filename); \ 166 166 return 10; \ 167 167 } \ 168 168 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", \ 170 170 col,row,(psF32)img3Row[col-readM0],(psF32)img4Row[col],filename); \ 171 171 return 11; \ … … 204 204 image = psImageReadSection(image,0,0,M,N,0,NULL,0,"foobar.fits"); 205 205 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."); 207 207 return 12; 208 208 } … … 220 220 image = psImageReadSection(image,0,0,M,N,0,NULL,0,NULL); 221 221 if (image != NULL) { 222 psError( __func__,"Image returned though filename was NULL.");222 psError(PS_ERR_UNKNOWN, true,"Image returned though filename was NULL."); 223 223 return 13; 224 224 } … … 233 233 image = psImageReadSection(image,0,0,M,N,0,NULL,4,"tmpImages/MxN_F32.fits"); 234 234 if (image != NULL) { 235 psError( __func__,"Image returned though extnum was invalid.");235 psError(PS_ERR_UNKNOWN, true,"Image returned though extnum was invalid."); 236 236 return 14; 237 237 } … … 239 239 image = psImageReadSection(image,0,0,M,N,0,"bogus",0,"tmpImages/MxN_F32.fits"); 240 240 if (image != NULL) { 241 psError( __func__,"Image returned though extnum was invalid.");241 psError(PS_ERR_UNKNOWN, true,"Image returned though extnum was invalid."); 242 242 return 15; 243 243 } … … 302 302 ; 303 303 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."); 305 305 return 14; 306 306 } 307 307 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."); 309 309 return 15; 310 310 } … … 315 315 img = psImageReadSection(NULL,0,0,m,n,0,NULL,0,"tmpImages/writeTest.fits"); 316 316 if (img == NULL) { 317 psError( __func__,"Could not read in writeTest.fits.");317 psError(PS_ERR_UNKNOWN, true,"Could not read in writeTest.fits."); 318 318 return 16; 319 319 } … … 322 322 for (psU32 col=0;col<m;col++) { 323 323 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)", 325 325 col,row,imgRow[col],(row+2*col)); 326 326 return 17; … … 337 337 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message because input image is null."); 338 338 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."); 340 340 return 20; 341 341 } … … 347 347 GENIMAGE(img,32,32,S8,row+2*col); 348 348 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."); 350 350 return 21; 351 351 } … … 358 358 GENIMAGE(img,32,32,U8,row+2*col); 359 359 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."); 361 361 return 22; 362 362 } … … 370 370 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for passing invalid FITS file."); 371 371 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."); 373 373 return 22; 374 374 } … … 381 381 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid extension name."); 382 382 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."); 384 384 return 23; 385 385 } … … 390 390 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error for invalid extension number."); 391 391 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."); 393 393 return 24; 394 394 }
Note:
See TracChangeset
for help on using the changeset viewer.
