Changeset 1920 for trunk/psLib/test/image
- Timestamp:
- Sep 28, 2004, 1:26:49 PM (22 years ago)
- Location:
- trunk/psLib/test/image
- Files:
-
- 4 edited
-
tst_psImage.c (modified) (19 diffs)
-
verified/tst_psImage.stderr (modified) (5 diffs)
-
verified/tst_psImageExtraction.stderr (modified) (1 diff)
-
verified/tst_psImageManip.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/image/tst_psImage.c
r1682 r1920 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-09- 02 21:17:03$8 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-09-28 23:26:49 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 27 27 testDescription tests[] = { 28 { 29 testImageAlloc,546,"psImageAlloc",0,false 30 }, 31 { 32 testImageAlloc,548,"psImageFree",0,true 33 }, 34 { 35 testImageSubset,547,"psImageSubset",0,false 36 }, 37 { 38 testImageSubset,550,"psImageSubset",0,true 39 }, 40 { 41 testImageCopy,551,"psImageCopy",0,false 42 }, 43 { 44 NULL 45 } 28 {testImageAlloc,546,"psImageAlloc",0,false}, 29 {testImageAlloc,548,"psImageFree",0,true}, 30 {testImageSubset,547,"psImageSubset",0,false}, 31 {testImageSubset,550,"psImageSubset",0,true}, 32 {testImageCopy,551,"psImageCopy",0,false}, 33 {NULL} 46 34 }; 47 35 … … 119 107 } 120 108 121 if (image->nChildren != 0) {122 psError(__func__,"psImageAlloc returned non-zero number of children");123 psFree(image);124 return 6;125 }126 127 109 if (image->children != NULL) { 128 psError(__func__,"psImageAlloc returned non-NULL children vector");110 psError(__func__,"psImageAlloc returned non-NULL children array"); 129 111 psFree(image); 130 112 return 7; … … 259 241 } 260 242 } 261 262 // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with no263 // children is freed.264 243 psFree(image); 265 244 } 266 245 } 267 246 268 // #548: Verify program execution doesn't stop, if the input psImage structure pointer is null.269 psFree(NULL);270 271 247 // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with multiple 272 // children is freed.248 // children is freed. 273 249 image = psImageAlloc(100,100,PS_TYPE_F32); 274 psImageSubset(image,50, 50,0,0);275 psImageSubset(image, 50,50,20,20);250 psImageSubset(image,50,0,70,20); 251 psImageSubset(image,70,20,90,40); 276 252 277 253 psFree(image); … … 300 276 memcpy(&preSubsetStruct,original,sizeof(psImage)); 301 277 302 subset2 = psImageSubset(original,c/2,r/2,c/4,r/4); 303 304 subset3 = psImageSubset(original,c/2,r/2,0,0); 278 subset2 = psImageSubset(original,c/4,r/4,c/4+c/2,r/4+r/2); 279 280 subset3 = psImageSubset(original,0,0,c/2,r/2); 281 282 psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure members nrow and ncol are equal to " 283 "the input parameter nrow and ncol respectively."); 284 285 if (subset2->numCols != c/2 || subset2->numRows != r/2) { 286 psError(__func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).", 287 subset2->numCols, subset2->numRows, c/2,r/2); 288 return 1; 289 } 290 291 if (subset3->numCols != c/2 || subset3->numRows != r/2) { 292 psError(__func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).", 293 subset3->numCols, subset3->numRows, c/2,r/2); 294 return 2; 295 } 305 296 306 297 psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure contains expected values in the " … … 322 313 } 323 314 324 psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure members nrow and ncol are equal to "325 "the input parameter nrow and ncol respectively.");326 327 if (subset3->numCols != c/2 || subset3->numRows != r/2) {328 psError(__func__,"psImageSubset output size was not proper(%dx%d, should be %dx%d).",329 subset3->numCols, subset3->numRows, c/2,r/2);330 return 5;331 }332 333 315 psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure member type is equal to the input " 334 316 "psImage structure member type."); … … 367 349 } 368 350 369 psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure member Nchildren is equal to "370 "zero.");371 372 if (subset2->nChildren != 0 || subset3->nChildren != 0) {373 psError(__func__,"psImageSubset didn't set nChildren to zero.");374 return 11;375 }376 377 351 psLogMsg(__func__,PS_LOG_INFO,"Verify the returned psImage structure member children is null."); 378 352 … … 386 360 "out at parent[Nchildren-1]."); 387 361 388 if (original-> nChildren != preSubsetStruct.nChildren+2) {389 psError(__func__,"psImageSubset didn't increment n Children by one per subset.");362 if (original->children == NULL || original->children->n != 2) { 363 psError(__func__,"psImageSubset didn't increment number of children by one per subset."); 390 364 return 12; 391 365 } 392 if (original->children [0] != subset2 || original->children[1] != subset3) {366 if (original->children->data[0] != subset2 || original->children->data[1] != subset3) { 393 367 psError(__func__,"psImageSubset didn't properly store the children pointers."); 394 368 return 13; … … 400 374 401 375 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 402 subset1 = psImageSubset(NULL, c/2,r/2,0,0);376 subset1 = psImageSubset(NULL,0,0,c/2,r/2); 403 377 if (subset1 != NULL) { 404 378 psError(__func__,"psImageSubset didn't return NULL when input image was NULL."); … … 412 386 memcpy(&preSubsetStruct,original,sizeof(psImage)); 413 387 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 414 subset1 = psImageSubset(original, c/2,0,0,0);388 subset1 = psImageSubset(original,0,r/2,c/2,r/2); 415 389 if (subset1 != NULL) { 416 390 psError(__func__,"psImageSubset didn't return NULL when numRows=0."); … … 418 392 } 419 393 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 420 subset1 = psImageSubset(original, 0,r/2,0,0);394 subset1 = psImageSubset(original,c/2,0,c/2,r/2); 421 395 if (subset1 != NULL) { 422 396 psError(__func__,"psImageSubset didn't return NULL when numCols=0."); … … 434 408 435 409 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 436 subset1 = psImageSubset(original, c/2,r/2,c,0);410 subset1 = psImageSubset(original,0,0,c/2,r*2); 437 411 if (subset1 != NULL) { 438 412 psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of " … … 441 415 } 442 416 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 443 subset1 = psImageSubset(original, c/2,r/2,0,r);417 subset1 = psImageSubset(original,0,0,c*2,r/2); 444 418 if (subset1 != NULL) { 445 419 psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of " … … 448 422 } 449 423 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 450 subset1 = psImageSubset(original, c/2,r/2,-1,0);424 subset1 = psImageSubset(original,-1,0,c/2,r/2); 451 425 if (subset1 != NULL) { 452 426 psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of " … … 455 429 } 456 430 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 457 subset1 = psImageSubset(original, c/2,r/2,0,-1);431 subset1 = psImageSubset(original,0,-1,c/2,r/2); 458 432 if (subset1 != NULL) { 459 433 psError(__func__,"psImageSubset didn't return NULL when subset origin was outside of " … … 468 442 469 443 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 470 subset1 = psImageSubset(original, c/2,r/2,c/2,0);444 subset1 = psImageSubset(original,0,0,c/2,r+1); 471 445 if (subset1 != NULL) { 472 446 psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via rows)."); … … 474 448 } 475 449 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 476 subset1 = psImageSubset(original, c/2,r/2,0,r/2);450 subset1 = psImageSubset(original,0,0,c+1,r/2); 477 451 if (subset1 != NULL) { 478 452 psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via cols)."); … … 480 454 } 481 455 psLogMsg(__func__,PS_LOG_INFO,"An error should follow..."); 482 subset1 = psImageSubset(original, c/2,r/2,c/2,r/2);456 subset1 = psImageSubset(original,0,0,c+1,r+1); 483 457 if (subset1 != NULL) { 484 458 psError(__func__,"psImageSubset didn't return NULL when subset was outside of image (via row+cols)."); … … 494 468 495 469 // Verify the returned psImage structure member Nchildren is set to zero. 496 if (original-> nChildren !=0) {497 psError(__func__,"psImageFreeChildren didn't set n Children to zero.");470 if (original->children != NULL && original->children->n > 0) { 471 psError(__func__,"psImageFreeChildren didn't set number of children to zero."); 498 472 return 25; 499 }500 501 // Verify the returned psImage structure member children pointer is set to null.502 if (original->children != NULL) {503 psError(__func__,"psImageFreeChildren didn't set children ptr to NULL.");504 return 26;505 473 } 506 474 -
trunk/psLib/test/image/verified/tst_psImage.stderr
r1840 r1920 95 95 96 96 <DATE><TIME>|<HOST>|I|testImageSubset 97 Verify the returned psImage structure members nrow and ncol are equal to the input parameter nrow and ncol respectively. 98 <DATE><TIME>|<HOST>|I|testImageSubset 97 99 Verify the returned psImage structure contains expected values in the row member, if the input psImage structure image contains known values. 98 <DATE><TIME>|<HOST>|I|testImageSubset99 Verify the returned psImage structure members nrow and ncol are equal to the input parameter nrow and ncol respectively.100 100 <DATE><TIME>|<HOST>|I|testImageSubset 101 101 Verify the returned psImage structure member type is equal to the input psImage structure member type. … … 104 104 <DATE><TIME>|<HOST>|I|testImageSubset 105 105 Verify the returned psImage structure member parent is equal to the input psImage structure pointer image. 106 <DATE><TIME>|<HOST>|I|testImageSubset107 Verify the returned psImage structure member Nchildren is equal to zero.108 106 <DATE><TIME>|<HOST>|I|testImageSubset 109 107 Verify the returned psImage structure member children is null. … … 121 119 An error should follow... 122 120 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 123 Specified number of rows (64) or columns (0) is invalid.121 Specified subset range, [0:<LINENO>,128:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 124 122 <DATE><TIME>|<HOST>|I|testImageSubset 125 123 An error should follow... 126 124 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 127 Specified number of rows (0) or columns (128) is invalid.125 Specified subset range, [64:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 128 126 <DATE><TIME>|<HOST>|I|testImageSubset 129 127 Verify the returned psImage structure pointer is null and program execution doesn't stop, if the input parameters row0 and col0 are not within the range of values of psImage structure image. … … 131 129 An error should follow... 132 130 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 133 Specified subset range, [ 128:<LINENO>,0:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].131 Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 134 132 <DATE><TIME>|<HOST>|I|testImageSubset 135 133 An error should follow... 136 134 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 137 Specified subset range, [0:<LINENO>, 256:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].135 Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 138 136 <DATE><TIME>|<HOST>|I|testImageSubset 139 137 An error should follow... 140 138 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 141 Specified subset range, [-1:<LINENO>,0:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].139 Specified subset range, [-1:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 142 140 <DATE><TIME>|<HOST>|I|testImageSubset 143 141 An error should follow... 144 142 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 145 Specified subset range, [0:<LINENO>,-1:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].143 Specified subset range, [0:<LINENO>,-1:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 146 144 <DATE><TIME>|<HOST>|I|testImageSubset 147 145 Verify the returned psImage structure pointer is null and program execution doesn't stop if the input parameters nrow, ncol, row0 and col0 specify a range of data not within the input psImage structure image. Also verify the input psImage structure is not modified. … … 149 147 An error should follow... 150 148 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 151 Specified subset range, [ 64:<LINENO>,0:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].149 Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 152 150 <DATE><TIME>|<HOST>|I|testImageSubset 153 151 An error should follow... 154 152 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 155 Specified subset range, [0:<LINENO>, 128:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].153 Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 156 154 <DATE><TIME>|<HOST>|I|testImageSubset 157 155 An error should follow... 158 156 <DATE><TIME>|<HOST>|E|psLib.image.psImageSubset 159 Specified subset range, [ 64:<LINENO>,128:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].157 Specified subset range, [0:<LINENO>,0:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 160 158 <DATE><TIME>|<HOST>|I|testImageSubset 161 159 psImageFreeChildren shall deallocate any children images of a psImage structure -
trunk/psLib/test/image/verified/tst_psImageExtraction.stderr
r1840 r1920 24 24 Following should be an error. 25 25 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 26 Specified subset range, [2001:<LINENO>,2002:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].26 Specified subset range, [2001:<LINENO>,2002:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 27 27 <DATE><TIME>|<HOST>|I|testImageSlice 28 28 Following should be an error. 29 29 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 30 Specified subset range, [200:<LINENO>,201:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].30 Specified subset range, [200:<LINENO>,201:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 31 31 <DATE><TIME>|<HOST>|I|testImageSlice 32 32 Following should be an error. 33 33 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 34 Specified subset range, [200:<LINENO>,2200:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].34 Specified subset range, [200:<LINENO>,2200:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 35 35 <DATE><TIME>|<HOST>|I|testImageSlice 36 36 Following should be an error. 37 37 <DATE><TIME>|<HOST>|E|psLib.image.psImageSlice 38 Specified subset range, [200:<LINENO>,201:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].38 Specified subset range, [200:<LINENO>,201:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 39 39 <DATE><TIME>|<HOST>|I|testImageSlice 40 40 Following should be an error. -
trunk/psLib/test/image/verified/tst_psImageManip.stderr
r1915 r1920 125 125 Following should error as overlay isn't within image boundaries 126 126 <DATE><TIME>|<HOST>|E|psLib.image.psImageOverlaySection 127 Specified subset range, [32:<LINENO>,64:<LINENO>], lies outsidepsImage's boundaries, [0:<LINENO>,0:<LINENO>].127 Specified subset range, [32:<LINENO>,64:<LINENO>], is invalid or outside input psImage's boundaries, [0:<LINENO>,0:<LINENO>]. 128 128 <DATE><TIME>|<HOST>|I|testImageOverlay 129 129 Following should error as overlay is NULL
Note:
See TracChangeset
for help on using the changeset viewer.
