Changeset 953
- Timestamp:
- Jun 9, 2004, 11:20:53 AM (22 years ago)
- Location:
- trunk/psLib/test
- Files:
-
- 3 edited
-
collections/tst_psList.c (modified) (14 diffs)
-
collections/verified/tst_psList.stderr (modified) (3 diffs)
-
image/tst_psImage.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psList.c
r950 r953 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06-09 2 0:56:23 $8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-09 21:20:53 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 int testListAlloc(void) 48 48 { 49 int currentId = psMemGetId();50 49 psList* list; 51 50 int ref; … … 108 107 psListFree(list,PS_FREE); 109 108 110 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {111 psError(__func__,"Memory Leaks Detected");112 return 64;113 }114 psMemCheckCorruption(1);115 116 109 return 0; 117 110 } … … 119 112 int testListAdd(void) 120 113 { 121 int currentId = psMemGetId();122 114 psList* list = NULL; 123 115 int* data = NULL; … … 289 281 290 282 psListFree(list, PS_FREE); 291 292 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {293 psError(__func__,"Memory Leaks Detected");294 return 64;295 }296 psMemCheckCorruption(1);297 283 298 284 return 0; … … 323 309 int testListGet(void) 324 310 { 325 int currentId = psMemGetId();326 311 psList* list = NULL; 327 312 int* data; … … 418 403 psListFree(list,PS_FREE); 419 404 420 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {421 psError(__func__,"Memory Leaks Detected");422 return 64;423 }424 psMemCheckCorruption(1);425 426 405 return 0; 427 406 } … … 429 408 int testListRemove(void) 430 409 { 431 int currentId = psMemGetId();432 410 psList* list = NULL; 433 411 int* data; … … 658 636 psListFree(list,PS_FREE); 659 637 660 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {661 psError(__func__,"Memory Leaks Detected");662 return 64;663 }664 psMemCheckCorruption(1);665 666 638 return 0; 667 639 … … 671 643 { 672 644 673 int currentId = psMemGetId();674 645 psList* list = NULL; 675 646 psVector* vec = NULL; … … 720 691 psListFree(list,PS_FREE); 721 692 722 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {723 psError(__func__,"Memory Leaks Detected");724 return 64;725 }726 psMemCheckCorruption(1);727 728 693 // test vector -> dlist 729 694 … … 800 765 psListFree(list,PS_FREE); 801 766 802 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {803 psError(__func__,"Memory Leaks Detected");804 return 64;805 }806 psMemCheckCorruption(1);807 808 767 return 0; 809 768 } … … 811 770 int testListIterator(void) 812 771 { 813 int currentId = psMemGetId();814 772 psList* list = NULL; 815 773 int* data; … … 936 894 psListFree(list,PS_FREE); 937 895 938 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {939 psError(__func__,"Memory Leaks Detected");940 return 64;941 }942 psMemCheckCorruption(1);943 944 896 return 0; 945 897 } 898 899 int testListFree(void) 900 { 901 902 /* 903 Call psDlistAlloc to create a doubly linked list. Create several data items and add them to the list. 904 Verify items are within the list. Verify the data item's reference counter are incremented after adding 905 to the list. Call psDlistFree with NULL specified as the elemFree function. Verify the list is 906 deallocated but not the data items. Verify the data item's reference counters are decremented by one 907 compared to when added to the list. 908 */ 909 910 return 0; 911 } -
trunk/psLib/test/collections/verified/tst_psList.stderr
r934 r953 30 30 31 31 <DATE> <TIME> <HOST> |I|testListGet |Following should be an error 32 <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:2 74).32 <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:264). 33 33 34 34 ---> TESTPOINT PASSED (psList{489-testListGet} | tst_psList.c) … … 47 47 <DATE> <TIME> <HOST> |E|psListRemove |Couldn't position to given index (-2) to remove element from list. 48 48 <DATE> <TIME> <HOST> |I|testListRemove |Next message should be an error 49 <DATE> <TIME> <HOST> |E|psListRemove |Failed to find 0x0 on psList 0x6d7f 10 in psListRemove.49 <DATE> <TIME> <HOST> |E|psListRemove |Failed to find 0x0 on psList 0x6d7f30 in psListRemove. 50 50 <DATE> <TIME> <HOST> |I|testListRemove |Next message should be an error 51 <DATE> <TIME> <HOST> |E|psListRemove |Failed to find 0x6d88 20 on psList 0x6d7f10 in psListRemove.51 <DATE> <TIME> <HOST> |E|psListRemove |Failed to find 0x6d8840 on psList 0x6d7f30 in psListRemove. 52 52 53 53 ---> TESTPOINT PASSED (psList{490-testListRemove} | tst_psList.c) … … 70 70 <DATE> <TIME> <HOST> |I|testListIterator| psListSetIterator/psListGetNext/psListGetPrev shall move the list cursor to the specified location 71 71 <DATE> <TIME> <HOST> |I|testListIterator|Following should error with 'Unexpected null pointer' 72 <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:2 74).72 <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:264). 73 73 <DATE> <TIME> <HOST> |I|testListIterator|Following should error with 'Can't move to an unknown position.' 74 74 <DATE> <TIME> <HOST> |E|listSetIterator|Can't move to an unknown position. Not moving the iterator position. -
trunk/psLib/test/image/tst_psImage.c
r949 r953 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06-09 2 0:34:34$8 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-09 21:20:53 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 48 48 int testImageAlloc(void) 49 49 { 50 int currentId = psMemGetId();51 50 psImage* image = NULL; 52 51 unsigned int sizes = 6; … … 224 223 // children is freed. 225 224 psImageFree(image); 226 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {227 psError(__func__,"Memory Leaks Detected");228 return 64;229 }230 psMemCheckCorruption(1);231 232 225 } 233 226 } … … 235 228 // #548: Verify program execution doesn't stop, if the input psImage structure pointer is null. 236 229 psImageFree(NULL); 237 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {238 psError(__func__,"Memory Leaks Detected");239 return 64;240 }241 psMemCheckCorruption(1);242 230 243 231 // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with multiple … … 249 237 psImageFree(image); 250 238 251 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {252 psError(__func__,"Memory Leaks Detected");253 return 64;254 }255 psMemCheckCorruption(1);256 257 239 return 0; 258 240 } … … 261 243 int testImageSubset(void) 262 244 { 263 int currentId = psMemGetId();264 245 psImage preSubsetStruct; 265 246 psImage* original; … … 519 500 psImageFree(original); 520 501 521 // Verify no memory leaks or corruption are detected for a psImage structure522 // Verify no memory leaks or corruption are detected for a psImage structure523 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {524 psError(__func__,"Memory Leaks Detected");525 return 64;526 }527 psMemCheckCorruption(1);528 529 502 return 0; 530 503 } … … 537 510 unsigned int c = 128; 538 511 unsigned int r = 256; 539 int currentId = psMemGetId();540 512 541 513 img = psImageAlloc(c,r,PS_TYPE_F32); … … 627 599 psImageFree(img2); 628 600 629 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {630 psAbort(__func__,"Memory Leaks!");631 }632 psMemCheckCorruption(1);633 634 601 return 0; 635 602 } … … 642 609 psF32 min; 643 610 psF32 max; 644 int currentId = psMemGetId();645 611 int numClipped = 0; 646 612 int retVal; … … 740 706 } 741 707 742 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {743 psAbort(__func__,"Memory Leaks!");744 }745 psMemCheckCorruption(1);746 747 708 return 0; 748 709 } … … 753 714 unsigned int c = 128; 754 715 unsigned int r = 256; 755 int currentId = psMemGetId();756 716 int numClipped = 0; 757 717 int retVal; … … 825 785 } 826 786 827 828 if (psMemCheckLeaks(currentId,NULL,stderr) != 0) {829 psAbort(__func__,"Memory Leaks!");830 }831 psMemCheckCorruption(1);832 833 787 return 0; 834 788 }
Note:
See TracChangeset
for help on using the changeset viewer.
