Changeset 4457 for trunk/psLib/test/collections/tst_psList.c
- Timestamp:
- Jul 5, 2005, 5:04:35 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/collections/tst_psList.c (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psList.c
r3682 r4457 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 4-07 20:27:41$8 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-07-06 03:04:35 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 77 77 return 2; 78 78 } 79 if (list-> size!= 0) {79 if (list->n != 0) { 80 80 psError(PS_ERR_UNKNOWN, true,"size of list wasn't zero for empty list."); 81 81 return 3; … … 101 101 } 102 102 103 if (list-> size!= 1) {103 if (list->n != 1) { 104 104 psError(PS_ERR_UNKNOWN, true,"size of list wasn't correctly set for new, one-element list."); 105 105 return 7; … … 310 310 list = psListAlloc(data); 311 311 psFree(data); 312 if (list-> size!= 1) {312 if (list->n != 1) { 313 313 psError(PS_ERR_UNKNOWN, true,"psListAlloc didn't create a list properly."); 314 314 return 2; … … 321 321 return 40; 322 322 } 323 if ( list-> size!= 1) {323 if ( list->n != 1) { 324 324 psError(PS_ERR_UNKNOWN, true,"psListAdd with a NULL data element changed the list size or returned success."); 325 325 return 3; … … 341 341 342 342 // verify that the size incremented 343 if (list-> size!= 2) {343 if (list->n != 2) { 344 344 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by one"); 345 345 return 4; … … 365 365 psFree(data); 366 366 // verify that the size incremented 367 if (list-> size!= 3) {367 if (list->n != 3) { 368 368 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by 1"); 369 369 return 6; … … 399 399 psFree(data); 400 400 // verify that the size wasn't incremented 401 if (list-> size!= 3) {401 if (list->n != 3) { 402 402 printListInt(list); 403 403 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to head when where was invalid."); … … 420 420 psFree(data); 421 421 // verify that the size incremented 422 if (list-> size!= 4 || *(psS32*)list->head->next->data != 5) {422 if (list->n != 4 || *(psS32*)list->head->next->data != 5) { 423 423 printListInt(list); 424 424 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #1."); … … 439 439 psFree(data); 440 440 // verify that the size incremented 441 if (list-> size!= 5 || *(psS32 *)list->head->next->next->next->data != 6) {441 if (list->n != 5 || *(psS32 *)list->head->next->next->next->data != 6) { 442 442 printListInt(list); 443 443 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #4."); … … 460 460 psFree(data); 461 461 // verify that the size incremented 462 if (list-> size!= 6 || *(psS32 *)list->tail->prev->prev->data != 7) {462 if (list->n != 6 || *(psS32 *)list->tail->prev->prev->data != 7) { 463 463 printListInt(list); 464 464 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #2."); … … 480 480 return 29; 481 481 } 482 if(list-> size!= 7 || *(psS32 *)list->tail->data != 8) {482 if(list->n != 7 || *(psS32 *)list->tail->data != 8) { 483 483 printListInt(list); 484 484 psError(PS_ERR_UNKNOWN,true,"psListAdd didn't place added item at tail."); … … 660 660 } 661 661 662 if (list-> size!= --items) {662 if (list->n != --items) { 663 663 printListInt(list); 664 664 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 682 682 } 683 683 684 if (list-> size!= --items) {684 if (list->n != --items) { 685 685 printListInt(list); 686 686 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 697 697 } 698 698 699 if (list-> size!= --items) {699 if (list->n != --items) { 700 700 printListInt(list); 701 701 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 721 721 } 722 722 723 if (list-> size!= --items) {723 if (list->n != --items) { 724 724 printListInt(list); 725 725 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 736 736 } 737 737 738 if (list-> size!= --items) {738 if (list->n != --items) { 739 739 printListInt(list); 740 740 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 756 756 } 757 757 758 if (list-> size!= --items) {758 if (list->n != --items) { 759 759 printListInt(list); 760 760 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items); … … 771 771 } 772 772 773 if (list-> size!= items) {773 if (list->n != items) { 774 774 printListInt(list); 775 775 psError(PS_ERR_UNKNOWN, true,"size not %d, as expected.",items); … … 791 791 } 792 792 793 if (list-> size!= 0) {793 if (list->n != 0) { 794 794 printListInt(list); 795 795 psError(PS_ERR_UNKNOWN, true,"Didn't remove all the elements."); … … 835 835 arr = psListToArray(list); 836 836 837 if (arr->n != 15 || list-> size!= 15) {837 if (arr->n != 15 || list->n != 15) { 838 838 psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size"); 839 839 return 1; … … 873 873 list = psArrayToList(arr); 874 874 875 if (arr->n != 15 || list-> size!= 15) {875 if (arr->n != 15 || list->n != 15) { 876 876 psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size"); 877 877 return 1; … … 1112 1112 (not needed, as psListAdd is tested elsewhere, but check anyway.) 1113 1113 */ 1114 if (list-> size!= 15) {1114 if (list->n != 15) { 1115 1115 psError(PS_ERR_UNKNOWN, true,"List wasn't populated as expected?"); 1116 1116 return 2;
Note:
See TracChangeset
for help on using the changeset viewer.
