Changeset 3066
- Timestamp:
- Jan 19, 2005, 3:48:38 PM (22 years ago)
- Location:
- trunk/psLib/test/collections
- Files:
-
- 2 edited
-
tst_psList.c (modified) (8 diffs)
-
verified/tst_psList.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psList.c
r3063 r3066 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-01-20 0 0:30:05$8 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-01-20 01:48:38 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 623 623 624 624 // 2. which is PS_LIST_HEAD (remove first element of list) 625 data = psListGet(list,PS_LIST_HEAD); 625 psS32* data1 = (psS32 *)psListGet(list,PS_LIST_HEAD); 626 psMemIncrRefCounter(data1); 627 // Test requirement SDR-172, SDR-173 626 628 if ( (! psListRemove(list,PS_LIST_HEAD)) || 627 629 (psListGet(list,PS_LIST_HEAD) == data) ) { … … 636 638 return 1; 637 639 } 640 // Test requirement SDR-176 641 if (psMemGetRefCounter(data1) != 1) { 642 psError(PS_ERR_UNKNOWN, true,"psListRemove didn't decrement the data reference count."); 643 return 20; 644 } 645 psMemDecrRefCounter(data1); 638 646 639 647 // 3. which is PS_LIST_TAIL (remove last element of list) 640 648 data = psListGet(list,PS_LIST_TAIL); 649 // Test requirement SDR-173 641 650 if ( (! psListRemove(list,PS_LIST_TAIL)) || 642 651 (psListGet(list,PS_LIST_TAIL) == data) ) { … … 662 671 // 7. which is PS_LIST_UNKNOWN and data=[head,tail,other list items] 663 672 data = psListGet(list,PS_LIST_HEAD); 673 // Test requirement SDR-762 664 674 if ( (! psListRemoveData(list,data)) || 665 675 (psListGet(list,PS_LIST_HEAD) == data) ) { … … 675 685 } 676 686 677 data = psListGet(list,PS_LIST_TAIL); 678 if ( (!psListRemoveData(list,data)) || 679 (psListGet(list,PS_LIST_TAIL) == data) ) { 687 psS32* data2 = psListGet(list,PS_LIST_TAIL); 688 psMemIncrRefCounter(data2); 689 if ( (!psListRemoveData(list,data2)) || 690 (psListGet(list,PS_LIST_TAIL) == data2) ) { 680 691 printListInt(list); 681 692 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_UNKNOWN @ PS_LIST_TAIL"); … … 688 699 return 1; 689 700 } 701 // Test requirement SDR-176 702 if (psMemGetRefCounter(data2) != 1) { 703 psError(PS_ERR_UNKNOWN, true,"psListRemoveData didn't decrement the data reference count."); 704 return 20; 705 } 706 psMemDecrRefCounter(data2); 690 707 691 708 data = psListGet(list,1); … … 705 722 // 8. data!=NULL and data!=any element in list 706 723 psLogMsg(__func__,PS_LOG_INFO,"Next message should be an error"); 724 // Test requirement SDR-764 707 725 if ( psListRemoveData(list,data) ) { 708 726 printListInt(list); … … 735 753 psError(PS_ERR_UNKNOWN, true,"Didn't remove all the elements."); 736 754 return 1; 755 } 756 757 psLogMsg(__func__,PS_LOG_INFO,"NULL list in psListRemoveData should generate error message."); 758 if(psListRemoveData(NULL,data)) { 759 psError(PS_ERR_UNKNOWN,true,"psListRemoveData should have generated an error with NULL list"); 760 return 2; 737 761 } 738 762 -
trunk/psLib/test/collections/verified/tst_psList.stderr
r3064 r3066 72 72 <DATE><TIME>|<HOST>|E|psListRemoveData (psList.c:<LINENO>) 73 73 Specified data item is not found in the psList. 74 <DATE><TIME>|<HOST>|I|testListRemove 75 NULL list in psListRemoveData should generate error message. 76 <DATE><TIME>|<HOST>|E|psListRemoveData (psList.c:<LINENO>) 77 Specified psList reference is NULL. 74 78 75 79 ---> TESTPOINT PASSED (psList{psListRemove} | tst_psList.c)
Note:
See TracChangeset
for help on using the changeset viewer.
