Changeset 2273 for trunk/psLib/test/image/tst_psImage.c
- Timestamp:
- Nov 3, 2004, 3:05:00 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/image/tst_psImage.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImage.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.29 $ $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 … … 71 71 continue; 72 72 } 73 psError( __func__,"psImageAlloc returned NULL for type %x, size %dx%d.",73 psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned NULL for type %x, size %dx%d.", 74 74 type[t], numCols[i], numRows[i]); 75 75 psFree(image); … … 78 78 79 79 if (image->type.dimen != PS_DIMEN_IMAGE || image->type.type != type[t]) { 80 psError( __func__,"psImageAlloc allocated wrong dimen/type (%d/%d), should be "80 psError(PS_ERR_UNKNOWN, true,"psImageAlloc allocated wrong dimen/type (%d/%d), should be " 81 81 "PS_IMAGE_DIMEN/%d", image->type.dimen, image->type.type, type[t]); 82 82 psFree(image); … … 85 85 86 86 if (image->numCols != numCols[i] || image->numRows != numRows[i]) { 87 psError( __func__,"psImageAlloc allocated wrong size %dx%d, should be %dx%d (type = %d)",87 psError(PS_ERR_UNKNOWN, true,"psImageAlloc allocated wrong size %dx%d, should be %dx%d (type = %d)", 88 88 image->numCols, image->numRows, numCols[i], numRows[i],type[t]); 89 89 psFree(image); … … 92 92 93 93 if (image->col0 != 0 || image->row0 != 0) { 94 psError( __func__,"psImageAlloc returned row0/col0 of %d/%d. Should be 0/0.",94 psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned row0/col0 of %d/%d. Should be 0/0.", 95 95 image->row0, image->row0); 96 96 psFree(image); … … 99 99 100 100 if (image->parent != NULL) { 101 psError( __func__,"psImageAlloc returned non-NULL parent");101 psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned non-NULL parent"); 102 102 psFree(image); 103 103 return 5; … … 105 105 106 106 if (image->children != NULL) { 107 psError( __func__,"psImageAlloc returned non-NULL children array");107 psError(PS_ERR_UNKNOWN, true,"psImageAlloc returned non-NULL children array"); 108 108 psFree(image); 109 109 return 7; … … 123 123 for (psS32 c=0;c<cols;c++) { 124 124 if (image->data.U16[r][c] != 2*c+r) { 125 psError( __func__,"Could not set all pixels in uint16 image at (%d,%d)",c,r);125 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in uint16 image at (%d,%d)",c,r); 126 126 psFree(image); 127 127 return 8; … … 143 143 for (psS32 c=0;c<cols;c++) { 144 144 if (fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON) { 145 psError( __func__,"Could not set all pixels in float image at (%d,%d)",c,r);145 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in float image at (%d,%d)",c,r); 146 146 psFree(image); 147 147 return 8; … … 163 163 for (psS32 c=0;c<cols;c++) { 164 164 if (fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON) { 165 psError( __func__,"Could not set all pixels in double image at (%d,%d)",c,r);165 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in double image at (%d,%d)",c,r); 166 166 psFree(image); 167 167 return 8; … … 184 184 if (fabsf(crealf(image->data.C32[r][c]) - r) > FLT_EPSILON || 185 185 fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON ) { 186 psError( __func__,"Could not set all pixels in complex image at (%d,%d)",c,r);186 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in complex image at (%d,%d)",c,r); 187 187 psFree(image); 188 188 return 8; … … 205 205 for (psS32 c=0;c<cols;c++) { 206 206 if (image->data.PTR[r][c] != temp) { 207 psError( __func__, "Could not set pixel in pointer image at (%d,%d): %x %x",207 psError(PS_ERR_UNKNOWN, true, "Could not set pixel in pointer image at (%d,%d): %x %x", 208 208 c,r,image->data.PTR[r][c],temp); 209 209 psFree(image); … … 229 229 for (psS32 c=0;c<cols;c++) { 230 230 if (image->data.U8[r][c] != (uint8_t)(r + c)) { 231 psError( __func__,"Could not set all pixels in image (type=%d) at (%d,%d)",231 psError(PS_ERR_UNKNOWN, true,"Could not set all pixels in image (type=%d) at (%d,%d)", 232 232 type[t],c,r); 233 233 psFree(image); … … 281 281 // Verify the returned psImage structure pointer is equal to the input parameter output. 282 282 if (img2 != img3) { 283 psError( __func__,"the image given for recycled wasn't");283 psError(PS_ERR_UNKNOWN, true,"the image given for recycled wasn't"); 284 284 return 1; 285 285 } … … 289 289 img4 = psImageCopy(NULL,img,PS_TYPE_F32); 290 290 if (img4 == NULL) { 291 psError( __func__,"output image doesn't exist");291 psError(PS_ERR_UNKNOWN, true,"output image doesn't exist"); 292 292 return 4; 293 293 } 294 294 if (img4->type.type != img->type.type) { 295 psError( __func__,"output image is not the same type as input image");295 psError(PS_ERR_UNKNOWN, true,"output image is not the same type as input image"); 296 296 return 4; 297 297 } … … 301 301 for (unsigned col=0;col<c;col++) { 302 302 if( imgInRow[col] != imgOutRow[col] ) { 303 psError( __func__,"Input image not equal to output image at %d,%d!",303 psError(PS_ERR_UNKNOWN, true,"Input image not equal to output image at %d,%d!", 304 304 col, row); 305 305 return 4; … … 321 321 img2 = psImageCopy(img2,img,PS_TYPE_##OUT); \ 322 322 if (img2 == NULL) { \ 323 psError( __func__,"psImageCopy failed to copy U8."); \323 psError(PS_ERR_UNKNOWN, true,"psImageCopy failed to copy U8."); \ 324 324 return 2; \ 325 325 } \ … … 329 329 for (psU32 col=0;col<c;col++) { \ 330 330 if (abs(imgRow[col] - (ps##IN)(row+col)) > 0.5) { \ 331 psError( __func__,"Input image was changed at %d,%d!", \331 psError(PS_ERR_UNKNOWN, true,"Input image was changed at %d,%d!", \ 332 332 col,row); \ 333 333 return 2; \ 334 334 } \ 335 335 if (abs(img2Row[col] - (ps##OUT)(imgRow[col])) > 0.5) { \ 336 psError( __func__,"returned psImage values after copy don't match at %d,%d " \336 psError(PS_ERR_UNKNOWN, true,"returned psImage values after copy don't match at %d,%d " \ 337 337 "(%d vs %d)",\ 338 338 col,row,img2Row[col], (ps##OUT)(imgRow[col])); \ … … 382 382 img3 = psImageCopy(NULL,NULL,PS_TYPE_F32); 383 383 if (img3 != NULL) { 384 psError( __func__,"psImageCopy didn't return NULL when input image was NULL.");384 psError(PS_ERR_UNKNOWN, true,"psImageCopy didn't return NULL when input image was NULL."); 385 385 return 3; 386 386 }
Note:
See TracChangeset
for help on using the changeset viewer.
