Changeset 2829 for trunk/psModules/test/tst_pmReadoutCombine.c
- Timestamp:
- Dec 27, 2004, 10:14:29 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psModules/test/tst_pmReadoutCombine.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/tst_pmReadoutCombine.c
r2816 r2829 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-12-2 4 00:58:08$7 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-12-27 20:14:29 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 118 118 minOutRow, minOutCol, maxOutRow, maxOutCol); 119 119 120 output = pmReadoutCombine(output, list, params, zero, scale, true, 1.0, 0.0);120 output = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0); 121 121 psF32 NR = (psF32) NUM_READOUTS; 122 psF32 expectedPixel = ((((NR-1.0) * (NR/2.0)) / NR) + VEC_ZERO) * VEC_SCALE; 122 // psF32 expectedPixel = ((((NR-1.0) * (NR/2.0)) / NR) + VEC_ZERO) * VEC_SCALE; 123 psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + VEC_SCALE * (NR - 1)))) / NR; 124 123 125 VerifyTheOutput(output, expectedPixel); 124 126 … … 179 181 zero->data.F32[i] = 3.0; 180 182 zeroBig->data.F32[i] = 3.0; 183 zero->data.F32[i] = VEC_ZERO; 184 zeroBig->data.F32[i] = VEC_ZERO; 181 185 } 182 186 for (i=0;i<NUM_READOUTS;i++) { 183 187 scale->data.F32[i] = 6.0; 184 188 scaleBig->data.F32[i] = 6.0; 189 scale->data.F32[i] = VEC_SCALE; 190 scaleBig->data.F32[i] = VEC_SCALE; 185 191 } 186 192 … … 220 226 printf("----------------------------------------------------------------------------\n"); 221 227 printf("Calling pmReadoutCombine() with NULL zero vector.\n"); 222 rc = pmReadoutCombine(NULL, list, params, NULL, scale, true, 1.0, 0.0); 223 if (rc == NULL) { 224 //XXX: We should verify the output image here. 228 rc = pmReadoutCombine(NULL, list, params, NULL, scale, true, 0.0, 0.0); 229 if (rc != NULL) { 230 psF32 NR = (psF32) NUM_READOUTS; 231 psF32 expectedPixel = ((NR/2.0) * (0.0 + (0.0 + VEC_SCALE * (NR - 1)))) / NR; 232 if (false == VerifyTheOutput(rc, expectedPixel)) { 233 testStatus = false; 234 } 235 236 if (rc->type.type != scale->type.type) { 237 printf("ERROR: output readout->image has incorrect type.\n"); 238 testStatus = false; 239 } 240 psFree(rc); 241 } else { 225 242 printf("ERROR: pmReadoutCombine() returned NULL\n"); 226 243 testStatus = false; 227 } 228 if (rc->type.type != scale->type.type) { 229 printf("ERROR: output readout->image has incorrect type.\n"); 230 testStatus = false; 231 } 232 psFree(rc); 244 245 } 233 246 234 247 printf("----------------------------------------------------------------------------\n"); 235 248 printf("Calling pmReadoutCombine() with incorrect length zero vector (too small). Should generate error.\n"); 236 rc = pmReadoutCombine(NULL, list, params, zeroHalf, scale, true, 1.0, 0.0);249 rc = pmReadoutCombine(NULL, list, params, zeroHalf, scale, true, 0.0, 0.0); 237 250 if (rc != NULL) { 238 251 printf("ERROR: pmReadoutCombine() did not return NULL\n"); … … 242 255 printf("----------------------------------------------------------------------------\n"); 243 256 printf("Calling pmReadoutCombine() with incorrect type zero vector. Should generate error.\n"); 244 rc = pmReadoutCombine(NULL, list, params, zeroF64, scale, true, 1.0, 0.0);257 rc = pmReadoutCombine(NULL, list, params, zeroF64, scale, true, 0.0, 0.0); 245 258 if (rc != NULL) { 246 259 printf("ERROR: pmReadoutCombine() did not return NULL\n"); … … 250 263 printf("----------------------------------------------------------------------------\n"); 251 264 printf("Calling pmReadoutCombine() with incorrect length zero vector (too big). Should generate warning.\n"); 252 rc = pmReadoutCombine(output, list, params, zeroBig, scale, true, 1.0, 0.0); 253 if (rc != NULL) { 254 if (false == VerifyTheOutput(rc, 45.0)) { 265 rc = pmReadoutCombine(output, list, params, zeroBig, scale, true, 0.0, 0.0); 266 if (rc != NULL) { 267 psF32 NR = (psF32) NUM_READOUTS; 268 psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + VEC_SCALE * (NR - 1)))) / NR; 269 270 if (false == VerifyTheOutput(rc, expectedPixel)) { 255 271 testStatus = false; 256 272 } … … 264 280 printf("----------------------------------------------------------------------------\n"); 265 281 printf("Calling pmReadoutCombine() with NULL scale vector.\n"); 266 rc = pmReadoutCombine(output, list, params, zero, NULL, true, 1.0, 0.0); 267 if (rc == NULL) { 268 //XXX: We should verify the output image here. 282 rc = pmReadoutCombine(output, list, params, zero, NULL, true, 0.0, 0.0); 283 284 if (rc != NULL) { 285 psF32 NR = (psF32) NUM_READOUTS; 286 psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + 1.0 * (NR - 1)))) / NR; 287 if (false == VerifyTheOutput(rc, expectedPixel)) { 288 testStatus = false; 289 } 290 291 if (rc->type.type != scale->type.type) { 292 printf("ERROR: output readout->image has incorrect type.\n"); 293 testStatus = false; 294 } 295 psFree(rc); 296 } else { 269 297 printf("ERROR: pmReadoutCombine() returned NULL\n"); 270 298 testStatus = false; 271 } 272 psFree(rc);299 300 } 273 301 274 302 printf("----------------------------------------------------------------------------\n"); 275 303 printf("Calling pmReadoutCombine() with incorrect length scale vector (too small). Should generate error.\n"); 276 rc = pmReadoutCombine(output, list, params, zero, scaleHalf, true, 1.0, 0.0);304 rc = pmReadoutCombine(output, list, params, zero, scaleHalf, true, 0.0, 0.0); 277 305 if (rc != NULL) { 278 306 printf("ERROR: pmReadoutCombine() did not return NULL\n"); … … 282 310 printf("----------------------------------------------------------------------------\n"); 283 311 printf("Calling pmReadoutCombine() with incorrect type scale vector. Should generate error.\n"); 284 rc = pmReadoutCombine(output, list, params, zero, scaleF64, true, 1.0, 0.0);312 rc = pmReadoutCombine(output, list, params, zero, scaleF64, true, 0.0, 0.0); 285 313 if (rc != NULL) { 286 314 printf("ERROR: pmReadoutCombine() did not return NULL\n"); … … 290 318 printf("----------------------------------------------------------------------------\n"); 291 319 printf("Calling pmReadoutCombine() with incorrect length scale vector (too big). Should generate warning.\n"); 292 rc = pmReadoutCombine(output, list, params, zero, scaleBig, true, 1.0, 0.0); 293 if (rc != NULL) { 294 if (false == VerifyTheOutput(rc, 45.0)) { 320 rc = pmReadoutCombine(output, list, params, zero, scaleBig, true, 0.0, 0.0); 321 if (rc != NULL) { 322 psF32 NR = (psF32) NUM_READOUTS; 323 psF32 expectedPixel = ((NR/2.0) * (VEC_ZERO + (VEC_ZERO + VEC_SCALE * (NR - 1)))) / NR; 324 325 if (false == VerifyTheOutput(rc, expectedPixel)) { 295 326 testStatus = false; 296 327 } … … 305 336 printf("Calling pmReadoutCombine() insufficient size output image. Should generate error, return NULL.\n"); 306 337 output = psImageAlloc(1, 1, PS_TYPE_F32); 307 rc = pmReadoutCombine(output, list, params, zero, scale, true, 1.0, 0.0);338 rc = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0); 308 339 if (rc != NULL) { 309 340 printf("ERROR: pmReadoutCombine() did not return NULL\n"); … … 315 346 printf("----------------------------------------------------------------------------\n"); 316 347 printf("Calling pmReadoutCombine() with NULL input list. Should generate error, return NULL.\n"); 317 rc = pmReadoutCombine(output, NULL, params, zero, scale, true, 1.0, 0.0);348 rc = pmReadoutCombine(output, NULL, params, zero, scale, true, 0.0, 0.0); 318 349 if (rc != NULL) { 319 350 printf("ERROR: pmReadoutCombine() did not return NULL\n"); … … 323 354 printf("----------------------------------------------------------------------------\n"); 324 355 printf("Calling pmReadoutCombine() with NULL params. Should generate error, return NULL.\n"); 325 rc = pmReadoutCombine(output, list, NULL, zero, scale, true, 1.0, 0.0);356 rc = pmReadoutCombine(output, list, NULL, zero, scale, true, 0.0, 0.0); 326 357 if (rc != NULL) { 327 358 printf("ERROR: pmReadoutCombine() did not return NULL\n"); … … 332 363 psStatsOptions oldStatsOpts = params->stats->options |= PS_STAT_MIN; 333 364 printf("Calling pmReadoutCombine() with multiple stats->options. Should generate error, return NULL.\n"); 334 rc = pmReadoutCombine(output, list, params, zero, scale, true, 1.0, 0.0);365 rc = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0); 335 366 if (rc != NULL) { 336 367 printf("ERROR: pmReadoutCombine() did not return NULL\n"); … … 342 373 psStats *oldStats = params->stats; 343 374 printf("Calling pmReadoutCombine() with NULL param->stats. Should generate error, return NULL.\n"); 344 rc = pmReadoutCombine(output, list, params, zero, scale, true, 1.0, 0.0);375 rc = pmReadoutCombine(output, list, params, zero, scale, true, 0.0, 0.0); 345 376 if (rc != NULL) { 346 377 printf("ERROR: pmReadoutCombine() did not return NULL\n");
Note:
See TracChangeset
for help on using the changeset viewer.
