Changeset 4457 for trunk/psLib/test/collections
- Timestamp:
- Jul 5, 2005, 5:04:35 PM (21 years ago)
- Location:
- trunk/psLib/test/collections
- Files:
-
- 5 edited
-
tst_psArray.c (modified) (6 diffs)
-
tst_psHash00.c (modified) (1 diff)
-
tst_psList.c (modified) (23 diffs)
-
tst_psMetadataIO.c (modified) (6 diffs)
-
tst_psMetadata_01.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psArray.c
r4308 r4457 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $20 * @date $Date: 2005-0 6-17 23:44:22$19 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2005-07-06 03:04:35 $ 21 21 * 22 22 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 103 103 } 104 104 } 105 fprintf(stderr,"array size = % d\n", psArr->nalloc);105 fprintf(stderr,"array size = %ld\n", psArr->nalloc); 106 106 if (psArr->nalloc != 5) { 107 107 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 108 108 return 3; 109 109 } 110 fprintf(stderr,"array population = % d\n", psArr->n);110 fprintf(stderr,"array population = %ld\n", psArr->n); 111 111 if (psArr->n != 5) { 112 112 psError(PS_ERR_UNKNOWN, true,"Array population wrong"); … … 137 137 } 138 138 } 139 fprintf(stderr,"array size = % d\n", psArr->nalloc);139 fprintf(stderr,"array size = %ld\n", psArr->nalloc); 140 140 if (psArr->nalloc != 10) { 141 141 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 142 142 return 6; 143 143 } 144 fprintf(stderr,"array population = % d\n", psArr->n);144 fprintf(stderr,"array population = %ld\n", psArr->n); 145 145 if (psArr->n != 10) { 146 146 psError(PS_ERR_UNKNOWN, true,"Array Population wrong"); … … 160 160 } 161 161 } 162 fprintf(stderr,"array size = % d\n", psArr->nalloc);162 fprintf(stderr,"array size = %ld\n", psArr->nalloc); 163 163 if (psArr->nalloc != 3) { 164 164 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 165 165 return 9; 166 166 } 167 fprintf(stderr,"array population = % d\n", psArr->n);167 fprintf(stderr,"array population = %ld\n", psArr->n); 168 168 if (psArr->n != 3) { 169 169 psError(PS_ERR_UNKNOWN, true,"Array Population wrong"); … … 189 189 return 100; 190 190 } 191 fprintf(stderr,"Array size after removal = % d\n",psArr->n);191 fprintf(stderr,"Array size after removal = %ld\n",psArr->n); 192 192 if ( psArr->n != 2 ) { 193 193 psError(PS_ERR_UNKNOWN, true, "Items in array not decremented after removal"); … … 274 274 } 275 275 } 276 fprintf(stderr,"array size = % d\n", psArr->nalloc);276 fprintf(stderr,"array size = %ld\n", psArr->nalloc); 277 277 if (psArr->nalloc != 10) { 278 278 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 279 279 return 3; 280 280 } 281 fprintf(stderr,"array population = % d\n", psArr->n);281 fprintf(stderr,"array population = %ld\n", psArr->n); 282 282 if (psArr->n != 10) { 283 283 psError(PS_ERR_UNKNOWN, true,"Array population wrong"); -
trunk/psLib/test/collections/tst_psHash00.c
r3682 r4457 26 26 } 27 27 28 if (myHashTable->n bucket!= NUM_HASH_TABLE_BUCKETS) {28 if (myHashTable->n != NUM_HASH_TABLE_BUCKETS) { 29 29 fprintf(stderr, "%s: myHashTable->nbucket not set properly.\n", 30 30 __func__); -
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; -
trunk/psLib/test/collections/tst_psMetadataIO.c
r4209 r4457 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-0 6-10 18:09:12$15 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-07-06 03:04:35 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 263 263 // Search list for another entry with same key name 264 264 // Check if last entry 265 if(iter->index != metadataItemList-> size) {265 if(iter->index != metadataItemList->n) { 266 266 // Set search iterator to index 267 267 if(!psListIteratorSet(searchIter,iter->index) ) { … … 422 422 423 423 // Verify the number of items in metadata 424 if(md->list-> size!= expectedItems) {424 if(md->list->n != expectedItems) { 425 425 psError(PS_ERR_UNKNOWN,true,"File: %s : Number of items = %d not as expected %d", 426 configFile,md->list-> size, expectedItems);426 configFile,md->list->n, expectedItems); 427 427 returnValue = false; 428 428 } … … 795 795 if(metaCounter == 0) { 796 796 // Check if number of items is as expected 797 if(entryChild->data.md->list-> size!= testConfig1ValueMetaItems1) {797 if(entryChild->data.md->list->n != testConfig1ValueMetaItems1) { 798 798 psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 1 items %d not as expected %d", 799 testConfig1,entryChild->data.md->list-> size,testConfig1ValueMetaItems1);799 testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems1); 800 800 return i*10+6; 801 801 } … … 824 824 } else if(metaCounter == 1) { 825 825 // Check if number of items is as expected 826 if(entryChild->data.md->list-> size!= testConfig1ValueMetaItems2) {826 if(entryChild->data.md->list->n != testConfig1ValueMetaItems2) { 827 827 psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 2 items %d not as expected %d", 828 testConfig1,entryChild->data.md->list-> size,testConfig1ValueMetaItems2);828 testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems2); 829 829 return i*10+6; 830 830 } … … 853 853 } else if(metaCounter == 2) { 854 854 // Check if number of items is as expected 855 if(entryChild->data.md->list-> size!= testConfig1ValueMetaItems3) {855 if(entryChild->data.md->list->n != testConfig1ValueMetaItems3) { 856 856 psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 items %d not as expected %d", 857 testConfig1,entryChild->data.md->list-> size,testConfig1ValueMetaItems3);857 testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems3); 858 858 return i*10+6; 859 859 } -
trunk/psLib/test/collections/tst_psMetadata_01.c
r3779 r4457 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $21 * @date $Date: 2005-0 4-28 02:45:12$20 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-07-06 03:04:35 $ 22 22 * 23 23 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 60 60 psS32 i; 61 61 psHashBucket* ptr = NULL; 62 for(i=0; i<mdTable->n bucket; i++) {62 for(i=0; i<mdTable->n; i++) { 63 63 ptr = mdTable->buckets[i]; 64 64 while (ptr != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.
