Changeset 1664
- Timestamp:
- Aug 31, 2004, 9:36:02 AM (22 years ago)
- Location:
- trunk/psLib/test/image
- Files:
-
- 2 edited
-
tst_psImage.c (modified) (4 diffs)
-
verified/tst_psImage.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImage.c
r1606 r1664 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08- 23 22:36:03$8 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-31 19:36:02 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 63 63 0,1,100,1,150,100 64 64 }; 65 unsigned int types = 1 2;65 unsigned int types = 13; 66 66 psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64, 67 67 PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_U32, PS_TYPE_U64, 68 PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64 }; 68 PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64, 69 PS_TYPE_PTR }; 69 70 70 71 psLogMsg(__func__,PS_LOG_INFO,"#546 - psImageAlloc shall allocate memory for a psImage structure"); … … 74 75 75 76 for (unsigned int i=0;i<sizes;i++) { 77 78 if (numRows[i] == 0 || numCols[i] == 0) { 79 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error."); 80 } 76 81 77 82 image = psImageAlloc(numCols[i],numRows[i],type[t]); … … 206 211 } 207 212 } 213 } 214 break; 215 case PS_TYPE_PTR: { 216 unsigned int rows = numRows[i]; 217 unsigned int cols = numCols[i]; 218 psImage* temp = psImageAlloc(1,1,PS_TYPE_F32); 219 220 for (int r=0;r<rows;r++) { 221 for (int c=0;c<cols;c++) { 222 image->data.PTR[r][c] = psMemIncrRefCounter(temp); 223 } 224 } 225 for (int r=0;r<rows;r++) { 226 for (int c=0;c<cols;c++) { 227 if (image->data.PTR[r][c] != temp) { 228 psError(__func__, "Could not set pixel in pointer image at (%d,%d): %x %x", 229 c,r,image->data.PTR[r][c],temp); 230 psFree(image); 231 psFree(temp); 232 return 8; 233 } 234 } 235 } 236 psFree(temp); 208 237 } 209 238 break; -
trunk/psLib/test/image/verified/tst_psImage.stderr
r1606 r1664 7 7 <DATE><TIME>|<HOST>|I| testImageAlloc|#546 - psImageAlloc shall allocate memory for a psImage structure 8 8 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 101h 9 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 9 10 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 10 11 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 102h 12 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 11 13 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 12 14 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 104h 15 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 13 16 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 14 17 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 108h 18 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 15 19 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 16 20 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 301h 21 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 17 22 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 18 23 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 302h 24 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 19 25 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 20 26 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 304h 27 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 21 28 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 22 29 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 308h 30 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 23 31 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 24 32 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 404h 33 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 25 34 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 26 35 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 408h 36 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 27 37 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 28 38 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 808h 39 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 29 40 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 30 41 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 810h 42 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 43 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 44 <DATE><TIME>|<HOST>|I| testImageAlloc|Testing psImage with type 0h 45 <DATE><TIME>|<HOST>|I| testImageAlloc|Following should be an error. 31 46 <DATE><TIME>|<HOST>|E| psImageAlloc|Invalid value for number of rows or columns (numRows=0, numCols=0). 32 47
Note:
See TracChangeset
for help on using the changeset viewer.
