Changeset 1606 for trunk/psLib/test/image
- Timestamp:
- Aug 23, 2004, 12:36:04 PM (22 years ago)
- Location:
- trunk/psLib/test/image
- Files:
-
- 3 edited
-
tst_psImage.c (modified) (14 diffs)
-
tst_psImageFFT.c (modified) (5 diffs)
-
verified/tst_psImage.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImage.c
r1406 r1606 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08- 06 22:34:06$8 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-23 22:36:03 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 50 psLogSetLevel(PS_LOG_INFO); 51 51 52 if (! runTestSuite(stderr,"psImage",tests,argc,argv)) { 53 psError(__FILE__,"One or more tests failed"); 54 return 1; 55 } 56 return 0; 52 return ! runTestSuite(stderr,"psImage",tests,argc,argv); 57 53 } 58 54 … … 247 243 // children isfreed. 248 244 image = psImageAlloc(100,100,PS_TYPE_F32); 249 psImageSubset( NULL,image,50,50,0,0);250 psImageSubset( NULL,image,50,50,20,20);245 psImageSubset(image,50,50,0,0); 246 psImageSubset(image,50,50,20,20); 251 247 252 248 psFree(image); … … 273 269 } 274 270 275 psLogMsg(__func__,PS_LOG_INFO,"memcpy(&preSubsetStruct,original,sizeof(psImage));");276 271 memcpy(&preSubsetStruct,original,sizeof(psImage)); 277 272 278 psLogMsg(__func__,PS_LOG_INFO,"subset1 = psImageAlloc(c/4,r/4,PS_TYPE_U8);"); 279 subset1 = psImageAlloc(c/4,r/4,PS_TYPE_U8); 280 281 psLogMsg(__func__,PS_LOG_INFO,"subset2 = psImageSubset(subset1,original,c/2,r/2,c/4,r/4);"); 282 subset2 = psImageSubset(subset1,original,c/2,r/2,c/4,r/4); 283 284 psLogMsg(__func__,PS_LOG_INFO,"subset3 = psImageSubset(NULL,original,c/2,r/2,0,0);"); 285 subset3 = psImageSubset(NULL,original,c/2,r/2,0,0); 286 287 psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure is equal to the input psImage " 288 "structure parameter out, if input parameter out is specified."); 289 290 if (subset1 != subset2 || subset2 == NULL) { 291 psError(__func__,"psImageSubset didn't recycle the psImage given"); 292 return 1; 293 } 294 295 psLogMsg(__func__,PS_LOG_INFO,"Verify a new psImage structure is created, if input parameter out is set " 296 "to null."); 297 298 if (subset3 == NULL) { 299 psError(__func__,"psImageSubset output was NULL for subset3."); 300 return 2; 301 } 273 subset2 = psImageSubset(original,c/2,r/2,c/4,r/4); 274 275 subset3 = psImageSubset(original,c/2,r/2,0,0); 302 276 303 277 psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure contains expected values in the " … … 397 371 398 372 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 399 subset1 = psImageSubset(NULL, NULL,c/2,r/2,0,0);373 subset1 = psImageSubset(NULL,c/2,r/2,0,0); 400 374 if (subset1 != NULL) { 401 375 psError(__func__,"psImageSubset didn't return NULL when input image was NULL."); … … 409 383 memcpy(&preSubsetStruct,original,sizeof(psImage)); 410 384 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 411 subset1 = psImageSubset( NULL,original,c/2,0,0,0);385 subset1 = psImageSubset(original,c/2,0,0,0); 412 386 if (subset1 != NULL) { 413 387 psError(__func__,"psImageSubset didn't return NULL when numRows=0."); … … 415 389 } 416 390 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 417 subset1 = psImageSubset( NULL,original,0,r/2,0,0);391 subset1 = psImageSubset(original,0,r/2,0,0); 418 392 if (subset1 != NULL) { 419 393 psError(__func__,"psImageSubset didn't return NULL when numCols=0."); … … 431 405 432 406 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 433 subset1 = psImageSubset( NULL,original,c/2,r/2,c,0);407 subset1 = psImageSubset(original,c/2,r/2,c,0); 434 408 if (subset1 != NULL) { 435 409 psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of " … … 438 412 } 439 413 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 440 subset1 = psImageSubset( NULL,original,c/2,r/2,0,r);414 subset1 = psImageSubset(original,c/2,r/2,0,r); 441 415 if (subset1 != NULL) { 442 416 psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of " … … 445 419 } 446 420 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 447 subset1 = psImageSubset( NULL,original,c/2,r/2,-1,0);421 subset1 = psImageSubset(original,c/2,r/2,-1,0); 448 422 if (subset1 != NULL) { 449 423 psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of " … … 452 426 } 453 427 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 454 subset1 = psImageSubset( NULL,original,c/2,r/2,0,-1);428 subset1 = psImageSubset(original,c/2,r/2,0,-1); 455 429 if (subset1 != NULL) { 456 430 psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of " … … 465 439 466 440 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 467 subset1 = psImageSubset( NULL,original,c/2,r/2,c/2,0);441 subset1 = psImageSubset(original,c/2,r/2,c/2,0); 468 442 if (subset1 != NULL) { 469 443 psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via rows)."); … … 471 445 } 472 446 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 473 subset1 = psImageSubset( NULL,original,c/2,r/2,0,r/2);447 subset1 = psImageSubset(original,c/2,r/2,0,r/2); 474 448 if (subset1 != NULL) { 475 449 psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via cols)."); … … 477 451 } 478 452 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 479 subset1 = psImageSubset( NULL,original,c/2,r/2,c/2,r/2);453 subset1 = psImageSubset(original,c/2,r/2,c/2,r/2); 480 454 if (subset1 != NULL) { 481 455 psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via row+cols)."); -
trunk/psLib/test/image/tst_psImageFFT.c
r1406 r1606 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08- 06 22:34:06$8 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-23 22:36:03 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 58 58 psLogSetLevel(PS_LOG_INFO); 59 59 60 if (! runTestSuite(stderr,"psFFT",tests,argc,argv) ) { 61 psAbort(__FILE__,"One or more tests failed"); 62 } 63 return 0; 60 return (! runTestSuite(stderr,"psFFT",tests,argc,argv) ); 64 61 } 65 62 … … 84 81 85 82 // 2. perform a forward transform 86 img2 = psImageFFT( NULL,img,PS_FFT_FORWARD);83 img2 = psImageFFT(img2,img,PS_FFT_FORWARD); 87 84 if (img2->type.type != PS_TYPE_C32) { 88 85 psError(__func__,"FFT didn't produce complex values?"); … … 109 106 } 110 107 108 111 109 // 4. perform a reverse transform 112 img3 = psImageFFT(NULL,img2,PS_FFT_REVERSE); 110 img3 = psImageFFT(img3,img2,PS_FFT_REVERSE); 111 113 112 if (img3->type.type != PS_TYPE_C32) { 114 113 psError(__func__,"FFT didn't produce complex values?"); … … 122 121 psF32 pixel = creal(img3Row[col])/m/n; 123 122 if (fabsf(pixel-imgRow[col]) > 0.1) { 124 psError(__func__,"Reverse FFT didn't gi me original image back (%d,%d %.2f vs %.2f)",123 psError(__func__,"Reverse FFT didn't give original image back (%d,%d %.2f vs %.2f)", 125 124 col,row,pixel,imgRow[col]); 126 125 return 5; -
trunk/psLib/test/image/verified/tst_psImage.stderr
r1404 r1606 39 39 \**********************************************************************************/ 40 40 41 <DATE><TIME>|<HOST>|I|testImageSubset|memcpy(&preSubsetStruct,original,sizeof(psImage));42 <DATE><TIME>|<HOST>|I|testImageSubset|subset1 = psImageAlloc(c/4,r/4,PS_TYPE_U8);43 <DATE><TIME>|<HOST>|I|testImageSubset|subset2 = psImageSubset(subset1,original,c/2,r/2,c/4,r/4);44 <DATE><TIME>|<HOST>|I|testImageSubset|subset3 = psImageSubset(NULL,original,c/2,r/2,0,0);45 <DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure is equal to the input psImage structure parameter out, if input parameter out is specified.46 <DATE><TIME>|<HOST>|I|testImageSubset|Verify a new psImage structure is created, if input parameter out is set to null.47 41 <DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure contains expected values in the row member, if the input psImage structure image contains known values. 48 42 <DATE><TIME>|<HOST>|I|testImageSubset|Verify the returned psImage structure members nrow and ncol are equal to the input parameter nrow and ncol respectively.
Note:
See TracChangeset
for help on using the changeset viewer.
