Changeset 1073 for trunk/psLib/test/image
- Timestamp:
- Jun 23, 2004, 1:00:17 PM (22 years ago)
- Location:
- trunk/psLib/test/image
- Files:
-
- 7 edited
-
tst_psImage.c (modified) (22 diffs)
-
tst_psImageFFT.c (modified) (6 diffs)
-
tst_psImageIO.c (modified) (6 diffs)
-
tst_psImageStats00.c (modified) (3 diffs)
-
tst_psImageStats01.c (modified) (2 diffs)
-
tst_psImageStats02.c (modified) (1 diff)
-
verified/tst_psImageStats02.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImage.c
r1033 r1073 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06- 14 23:03:43$8 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-23 23:00:15 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 75 75 psError(__func__,"psImageAlloc returned NULL for type %x, size %dx%d.", 76 76 type[t], numCols[i], numRows[i]); 77 ps ImageFree(image);77 psFree(image); 78 78 return 1; 79 79 } … … 82 82 psError(__func__,"psImageAlloc allocated wrong dimen/type (%d/%d), should be " 83 83 "PS_IMAGE_DIMEN/%d", image->type.dimen, image->type.type, type[t]); 84 ps ImageFree(image);84 psFree(image); 85 85 return 2; 86 86 } … … 89 89 psError(__func__,"psImageAlloc allocated wrong size %dx%d, should be %dx%d (type = %d)", 90 90 image->numCols, image->numRows, numCols[i], numRows[i],type[t]); 91 ps ImageFree(image);91 psFree(image); 92 92 return 3; 93 93 } … … 96 96 psError(__func__,"psImageAlloc returned row0/col0 of %d/%d. Should be 0/0.", 97 97 image->row0, image->row0); 98 ps ImageFree(image);98 psFree(image); 99 99 return 4; 100 100 } … … 102 102 if (image->parent != NULL) { 103 103 psError(__func__,"psImageAlloc returned non-NULL parent"); 104 ps ImageFree(image);104 psFree(image); 105 105 return 5; 106 106 } … … 108 108 if (image->nChildren != 0) { 109 109 psError(__func__,"psImageAlloc returned non-zero number of children"); 110 ps ImageFree(image);110 psFree(image); 111 111 return 6; 112 112 } … … 114 114 if (image->children != NULL) { 115 115 psError(__func__,"psImageAlloc returned non-NULL children vector"); 116 ps ImageFree(image);116 psFree(image); 117 117 return 7; 118 118 } … … 132 132 if (image->data.U16[r][c] != 2*c+r) { 133 133 psError(__func__,"Could not set all pixels in uint16 image at (%d,%d)",c,r); 134 ps ImageFree(image);134 psFree(image); 135 135 return 8; 136 136 } … … 152 152 if (fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON) { 153 153 psError(__func__,"Could not set all pixels in float image at (%d,%d)",c,r); 154 ps ImageFree(image);154 psFree(image); 155 155 return 8; 156 156 } … … 172 172 if (fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON) { 173 173 psError(__func__,"Could not set all pixels in double image at (%d,%d)",c,r); 174 ps ImageFree(image);174 psFree(image); 175 175 return 8; 176 176 } … … 193 193 fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON ) { 194 194 psError(__func__,"Could not set all pixels in complex image at (%d,%d)",c,r); 195 ps ImageFree(image);195 psFree(image); 196 196 return 8; 197 197 } … … 215 215 psError(__func__,"Could not set all pixels in image (type=%d) at (%d,%d)", 216 216 type[t],c,r); 217 ps ImageFree(image);217 psFree(image); 218 218 return 8; 219 219 } … … 225 225 // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with no 226 226 // children is freed. 227 ps ImageFree(image);227 psFree(image); 228 228 } 229 229 } 230 230 231 231 // #548: Verify program execution doesn't stop, if the input psImage structure pointer is null. 232 ps ImageFree(NULL);232 psFree(NULL); 233 233 234 234 // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with multiple … … 238 238 psImageSubset(NULL,image,50,50,20,20); 239 239 240 ps ImageFree(image);240 psFree(image); 241 241 242 242 return 0; … … 501 501 } 502 502 503 ps ImageFree(original);503 psFree(original); 504 504 505 505 return 0; … … 599 599 } 600 600 601 ps ImageFree(img);602 ps ImageFree(img2);601 psFree(img); 602 psFree(img2); 603 603 604 604 return 0; … … 678 678 return 2; \ 679 679 } \ 680 ps ImageFree(img);680 psFree(img); 681 681 682 682 #define testImageClipByComplexType(datatype) \ … … 718 718 return 2; \ 719 719 } \ 720 ps ImageFree(img);720 psFree(img); 721 721 722 722 psLogMsg(__func__,PS_LOG_INFO,"Testing clipping of F64 imagery"); … … 824 824 return 2; \ 825 825 } \ 826 ps ImageFree(img);826 psFree(img); 827 827 828 828 testImageClipNaNByType(F32); … … 906 906 } \ 907 907 } \ 908 ps ImageFree(img); \909 ps ImageFree(img2);908 psFree(img); \ 909 psFree(img2); 910 910 911 911 #define testOverlayType(DATATYPE) \ … … 1016 1016 } 1017 1017 1018 ps ImageFree(img);1019 ps ImageFree(img2);1018 psFree(img); 1019 psFree(img2); 1020 1020 1021 1021 return 0; -
trunk/psLib/test/image/tst_psImageFFT.c
r1014 r1073 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06- 12 19:46:04$8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-23 23:00:17 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 116 116 } 117 117 118 ps ImageFree(img);119 ps ImageFree(img2);120 ps ImageFree(img3);118 psFree(img); 119 psFree(img2); 120 psFree(img3); 121 121 122 122 return 0; … … 181 181 } 182 182 183 ps ImageFree(img);184 ps ImageFree(img2);185 ps ImageFree(img3);183 psFree(img); 184 psFree(img2); 185 psFree(img3); 186 186 187 187 return 0; … … 265 265 } 266 266 267 ps ImageFree(img);268 ps ImageFree(img2);269 ps ImageFree(img3);267 psFree(img); 268 psFree(img2); 269 psFree(img3); 270 270 271 271 return 0; … … 311 311 } 312 312 313 ps ImageFree(img);314 ps ImageFree(img2);313 psFree(img); 314 psFree(img2); 315 315 316 316 return 0; … … 359 359 } 360 360 361 ps ImageFree(img);362 ps ImageFree(img2);363 364 return 0; 365 } 361 psFree(img); 362 psFree(img2); 363 364 return 0; 365 } -
trunk/psLib/test/image/tst_psImageIO.c
r1001 r1073 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06- 11 19:18:41$8 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-23 23:00:17 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 107 107 return 4; \ 108 108 } \ 109 ps ImageFree(img); \109 psFree(img); \ 110 110 img_ref = img = psImageAlloc(2,2,PS_TYPE_F32); \ 111 ps ImageFree(img3); \111 psFree(img3); \ 112 112 img3 = NULL; \ 113 113 img = psImageReadSection(img,readM0,readN0,readM,readN,0,NULL,0,filename); \ … … 139 139 } \ 140 140 } \ 141 ps ImageFree(img); \141 psFree(img); \ 142 142 img = NULL; \ 143 ps ImageFree(img3); \143 psFree(img3); \ 144 144 img3 = NULL; \ 145 145 img3 = psImageReadSection(img3,readM0,readN0,readM,readN,0,NULL,1,filename); \ … … 167 167 } \ 168 168 } \ 169 ps ImageFree(img); \170 ps ImageFree(img2); \171 ps ImageFree(img3); \172 ps ImageFree(img4); \169 psFree(img); \ 170 psFree(img2); \ 171 psFree(img3); \ 172 psFree(img4); \ 173 173 } 174 174 … … 302 302 return 15; 303 303 } 304 ps ImageFree(img);305 ps ImageFree(img2);304 psFree(img); 305 psFree(img2); 306 306 307 307 // Did it really overwrite the pixel values? Let's read it in and see. … … 322 322 } 323 323 324 ps ImageFree(img);324 psFree(img); 325 325 326 326 return 0; -
trunk/psLib/test/image/tst_psImageStats00.c
r1041 r1073 96 96 myHist->nums->data.S32[i]); 97 97 } 98 ps HistogramFree(myHist);98 psFree(myHist); 99 99 100 100 psMemCheckCorruption(1); … … 133 133 "psImageStats functions", 134 134 "Deallocate the psHistogram/psImage structure."); 135 ps HistogramFree(myHist);136 ps ImageFree(tmpImage);137 ps ImageFree(tmpMask);135 psFree(myHist); 136 psFree(tmpImage); 137 psFree(tmpMask); 138 138 139 139 psMemCheckCorruption(1); … … 167 167 168 168 psMemCheckCorruption(1); 169 ps HistogramFree(myHist);170 ps ImageFree(tmpImage);169 psFree(myHist); 170 psFree(tmpImage); 171 171 psMemCheckCorruption(1); 172 172 memLeaks = psMemCheckLeaks(currentId,NULL,NULL); -
trunk/psLib/test/image/tst_psImageStats01.c
r904 r1073 123 123 "psImageStats functions", 124 124 "Deallocate the psStats/psImage structure."); 125 ps StatsFree(myStats);126 ps ImageFree(tmpImage);127 ps ImageFree(tmpMask);125 psFree(myStats); 126 psFree(tmpImage); 127 psFree(tmpMask); 128 128 129 129 psMemCheckCorruption(1); … … 165 165 // 166 166 167 ps StatsFree(myStats);168 ps ImageFree(tmpImage);169 ps ImageFree(tmpMask);167 psFree(myStats); 168 psFree(tmpImage); 169 psFree(tmpMask); 170 170 171 171 psMemCheckCorruption(1); -
trunk/psLib/test/image/tst_psImageStats02.c
r1072 r1073 102 102 "psImageStats functions", 103 103 "Deallocate the psStats/psImage structure."); 104 ps StatsFree(myStats);105 ps ImageFree(tmpImage);106 ps ImageFree(outImage);107 ps Polynomial2DFree(my2DPoly);104 psFree(myStats); 105 psFree(tmpImage); 106 psFree(outImage); 107 psFree(my2DPoly); 108 108 109 109 psMemCheckCorruption(1); -
trunk/psLib/test/image/verified/tst_psImageStats02.stdout
r1034 r1073 5 5 \**********************************************************************************/ 6 6 7 SUM(Cheby(0) * Cheby(0)) is 3.000000 8 SUM(Cheby(0) * Cheby(1)) is -0.000000 9 SUM(Cheby(0) * Cheby(2)) is 0.000000 10 SUM(Cheby(1) * Cheby(0)) is -0.000000 11 SUM(Cheby(1) * Cheby(1)) is 1.500000 12 SUM(Cheby(1) * Cheby(2)) is 0.000000 13 SUM(Cheby(2) * Cheby(0)) is 0.000000 14 SUM(Cheby(2) * Cheby(1)) is 0.000000 15 SUM(Cheby(2) * Cheby(2)) is 1.500000 16 Cheby Polynomial (0, 0) coefficient is 6.000000 17 Cheby Polynomial (0, 1) coefficient is 1.154701 18 Cheby Polynomial (0, 2) coefficient is 0.000000 19 Cheby Polynomial (1, 0) coefficient is 5.773502 20 Cheby Polynomial (1, 1) coefficient is -0.000000 21 Cheby Polynomial (1, 2) coefficient is -0.000000 22 Cheby Polynomial (2, 0) coefficient is 0.000000 23 Cheby Polynomial (2, 1) coefficient is 0.000000 24 Cheby Polynomial (2, 2) coefficient is 0.000000 7 25 8 26 ---> TESTPOINT PASSED (psImageStats functions{Calculate Chebyshev Polynomials, no mask} | tst_psImageStats02.c)
Note:
See TracChangeset
for help on using the changeset viewer.
