Changeset 2138 for trunk/psModules/test/tst_pmMaskBadPixels.c
- Timestamp:
- Oct 14, 2004, 1:52:09 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psModules/test/tst_pmMaskBadPixels.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/tst_pmMaskBadPixels.c
r1888 r2138 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $20 * @date $Date: 2004- 09-24 23:42:28$19 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-10-14 23:52:09 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 56 56 57 57 58 static int testMaskBadPixels(void); 58 static int testMaskBadPixels1(void); 59 static int testMaskBadPixels2(void); 60 static int testMaskBadPixels3(void); 61 static int testMaskBadPixels4(void); 62 static int testMaskBadPixels5(void); 63 static int testMaskBadPixels6(void); 64 static int testMaskBadPixels7(void); 65 static int testMaskBadPixels8(void); 66 static int testMaskBadPixels9(void); 67 static int testMaskBadPixels10(void); 68 static int testMaskBadPixels11(void); 59 69 60 70 61 71 testDescription tests[] = { 62 {testMaskBadPixels, 885, "pmMaskBadPixels", 0, false}, 72 {testMaskBadPixels1, 885, "pmMaskBadPixels - Create mask based on maskVal argument", 0, false}, 73 {testMaskBadPixels2, 885, "pmMaskBadPixels - Create mask based on saturation argument", 0, false}, 74 {testMaskBadPixels3, 885, "pmMaskBadPixels - Create mask based on growVal and grow arguments", 0, false}, 75 {testMaskBadPixels4, 885, "pmMaskBadPixels - Auto create mask based on maskVal argument", 0, false}, 76 {testMaskBadPixels5, 885, "pmMaskBadPixels - Attempt to use null mask", 0, false}, 77 {testMaskBadPixels6, 885, "pmMaskBadPixels - Attempt tp use null input image", 0, false}, 78 {testMaskBadPixels7, 885, "pmMaskBadPixels - Attempt to use input image bigger than mask", 0, false}, 79 {testMaskBadPixels8, 885, "pmMaskBadPixels - Attempt to use input image mask bigger than mask", 0, false}, 80 {testMaskBadPixels9, 885, "pmMaskBadPixels - Attempt to use offset greater than input image", 0, false}, 81 {testMaskBadPixels10, 885, "pmMaskBadPixels - Attempt to use complex input image", 0, false}, 82 {testMaskBadPixels11, 885, "pmMaskBadPixels - Attempt to use non-mask type mask image", 0, false}, 63 83 {NULL} 64 84 }; … … 71 91 72 92 73 int testMaskBadPixels( void ) 74 { 75 76 93 int testMaskBadPixels1( void ) 94 { 77 95 // Test A - Create mask based on maskVal argument 78 printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test A - Create mask based on maskVal argument");79 96 CREATE_AND_SET_IMAGE(inImage1,F64,0,50,50); 80 97 CREATE_AND_SET_IMAGE(mask1,U8,0,50,50) … … 87 104 psFree(inReadout); 88 105 psFree(inImage1); 89 printFooter(stdout, "pmMaskBadPixels", "Test A - Create mask based on maskVal argument", true); 90 printf("\n\n\n"); 91 92 106 107 return 0; 108 } 109 110 int testMaskBadPixels2( void ) 111 { 93 112 // Test B - Create mask based on saturation argument 94 printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test B - Create mask based on saturation argument");95 113 CREATE_AND_SET_IMAGE(inImage2,F64,150.0,50,50); 96 114 CREATE_AND_SET_IMAGE(mask2,U8,0,50,50) … … 102 120 psFree(inReadout2); 103 121 psFree(inImage2); 104 printFooter(stdout, "pmMaskBadPixels", "Test B - Create mask based on saturation argument", true); 105 printf("\n\n\n"); 106 107 122 123 return 0; 124 } 125 126 int testMaskBadPixels3( void ) 127 { 108 128 // Test C - Create mask based on growVal and grow arguments 109 printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test C - Create mask based on growVal and grow arguments");110 129 CREATE_AND_SET_IMAGE(inImage3,F64,50.0,50,50); 111 130 CREATE_AND_SET_IMAGE(mask3,U8,0,50,50) … … 120 139 psFree(inReadout3); 121 140 psFree(inImage3); 122 printFooter(stdout, "pmMaskBadPixels", "Test C - Create mask based on growVal and grow arguments", true); 123 printf("\n\n\n"); 124 125 141 142 return 0; 143 } 144 145 int testMaskBadPixels4( void ) 146 { 126 147 // Test D - Auto Create mask based on maskVal argument 127 printPositiveTestHeader(stdout, "pmMaskBadPixels", "Test D - Auto create mask based on maskVal argument");128 148 CREATE_AND_SET_IMAGE(inImage4,F64,50.0,50,50); 129 149 CREATE_AND_SET_IMAGE(mask4,U8,0,50,50) … … 138 158 psFree(inReadout4); 139 159 psFree(inImage4); 140 printFooter(stdout, "pmMaskBadPixels", "Test D - Auto create mask based on maskVal argument", true); 141 printf("\n\n\n"); 142 143 160 161 return 0; 162 } 163 164 int testMaskBadPixels5( void ) 165 { 144 166 // Test E - Attempt to use null mask 145 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test E - Attempt to use null mask",146 "Null not allowed for mask image", 0);147 167 CREATE_AND_SET_IMAGE(inImage5,F64,50.0,50,50); 148 168 psReadout *inReadout5 = psReadoutAlloc(0, 0, inImage5); 149 pmMaskBadPixels(inReadout 4, NULL, 0, 100.0, 1, 10);169 pmMaskBadPixels(inReadout5, NULL, 0, 100.0, 1, 10); 150 170 psFree(inReadout5); 151 171 psFree(inImage5); 152 printFooter(stdout, "pmMaskBadPixels", "Test E - Attempt to use null mask", true); 153 printf("\n\n\n"); 154 155 172 173 return 0; 174 } 175 176 int testMaskBadPixels6( void ) 177 { 156 178 // Test F - Attempt tp use null input image 157 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test F - Attempt tp use null input image",158 "Null not allowed for input image", 0);159 160 179 CREATE_AND_SET_IMAGE(mask6,U8,0,50,50) 161 180 psReadout *inReadout6 = psReadoutAlloc(0, 0, NULL); … … 163 182 pmMaskBadPixels(inReadout6, mask6, 0, 100.0, 1, 10); 164 183 psFree(inReadout6); 165 printFooter(stdout, "pmMaskBadPixels", "Test F - Attempt tp use null input image", true); 166 printf("\n\n\n"); 167 168 184 185 return 0; 186 } 187 188 int testMaskBadPixels7( void ) 189 { 169 190 // Test G - Attempt to use input image bigger than mask 170 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test G - Attempt to use input image bigger than mask",171 "Input image size exceeds that of mask image", 0);172 191 CREATE_AND_SET_IMAGE(inImage7,F64,0.0,60,60); 173 192 CREATE_AND_SET_IMAGE(mask7,U8,0,50,50) 174 193 CREATE_AND_SET_IMAGE(mask7i,U8,0,50,50) 175 194 psReadout *inReadout7 = psReadoutAlloc(0, 0, inImage7); 176 inReadout 4->mask = mask7i;177 pmMaskBadPixels(inReadout 4, mask7, 0, 100.0, 1, 10);195 inReadout7->mask = mask7i; 196 pmMaskBadPixels(inReadout7, mask7, 0, 100.0, 1, 10); 178 197 psFree(mask7); 179 198 psFree(inReadout7); 180 199 psFree(inImage7); 181 printFooter(stdout, "pmMaskBadPixels", "Test G - Attempt to use input image bigger than mask", true); 182 printf("\n\n\n"); 183 184 200 201 return 0; 202 } 203 204 int testMaskBadPixels8( void ) 205 { 185 206 // Test H - Attempt to use input image mask bigger than mask 186 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test H - Attempt to use input image mask bigger than mask",187 "Input image mask size exceeds that of mask image", 0);188 207 CREATE_AND_SET_IMAGE(inImage8,F64,0.0,50,50); 189 208 CREATE_AND_SET_IMAGE(mask8,U8,0,50,50) … … 195 214 psFree(inReadout8); 196 215 psFree(inImage8); 197 printFooter(stdout, "pmMaskBadPixels", "Test H - Attempt to use input image mask bigger than mask", true); 198 printf("\n\n\n"); 199 200 216 217 return 0; 218 } 219 220 int testMaskBadPixels9( void ) 221 { 201 222 // Test I - Attempt to use offset greater than input image 202 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test I - Attempt to use offset greater than input image",203 "Total offset >= input image size", 0);204 223 CREATE_AND_SET_IMAGE(inImage9,F64,0.0,50,50); 205 224 CREATE_AND_SET_IMAGE(mask9,U8,0,50,50) … … 207 226 psReadout *inReadout9 = psReadoutAlloc(0, 0, inImage9); 208 227 inReadout9->mask = mask9i; 209 *(int*)&inReadout ->col0 = 150;210 *(int*)&inReadout ->row0 = 150;228 *(int*)&inReadout9->col0 = 150; 229 *(int*)&inReadout9->row0 = 150; 211 230 pmMaskBadPixels(inReadout9, mask9, 0, 100.0, 1, 10); 212 231 psFree(mask9); 213 232 psFree(inReadout9); 214 233 psFree(inImage9); 215 printFooter(stdout, "pmMaskBadPixels", "Test I - Attempt to use offset greater than input image", true); 216 printf("\n\n\n"); 217 218 234 235 return 0; 236 } 237 238 int testMaskBadPixels10( void ) 239 { 219 240 // Test J - Attempt to use complex input image 220 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test J - Attempt to use complex input image",221 "Complex types not allowed for input image", 0);222 241 CREATE_AND_SET_IMAGE(inImage10,C64,50.0,50,50); 223 242 CREATE_AND_SET_IMAGE(mask10,U8,0,50,50) … … 229 248 psFree(inReadout10); 230 249 psFree(inImage10); 231 printFooter(stdout, "pmMaskBadPixels", "Test J - Attempt to use complex input image", true); 232 printf("\n\n\n"); 233 234 250 251 return 0; 252 } 253 254 int testMaskBadPixels11( void ) 255 { 235 256 // Test K - Attempt to use non-mask type mask image 236 printNegativeTestHeader(stdout,"pmMaskBadPixels", "Test K - Attempt to use non-mask type mask image",237 "Mask must be PS_TYPE_MASK type", 0);238 257 CREATE_AND_SET_IMAGE(inImage11,F64,50.0,50,50); 239 258 CREATE_AND_SET_IMAGE(mask11,F64,0,50,50) 240 259 CREATE_AND_SET_IMAGE(mask11i,U8,0,50,50) 241 psReadout *inReadout11 = psReadoutAlloc(0, 0, inImage1 0);260 psReadout *inReadout11 = psReadoutAlloc(0, 0, inImage11); 242 261 inReadout11->mask = mask11i; 243 262 pmMaskBadPixels(inReadout11, mask11, 0, 100.0, 1, 10); … … 245 264 psFree(inReadout11); 246 265 psFree(inImage11); 247 printFooter(stdout, "pmMaskBadPixels", "Test K - Attempt to use non-mask type mask image", true); 248 printf("\n\n\n"); 249 250 return 0; 251 } 266 267 return 0; 268 } 269
Note:
See TracChangeset
for help on using the changeset viewer.
