Changeset 2204 for trunk/psLib/test/collections
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- Location:
- trunk/psLib/test/collections
- Files:
-
- 20 edited
-
tst_psArray.c (modified) (9 diffs)
-
tst_psBitSet.c (modified) (23 diffs)
-
tst_psHash00.c (modified) (1 diff)
-
tst_psHash01.c (modified) (2 diffs)
-
tst_psHash02.c (modified) (3 diffs)
-
tst_psHash03.c (modified) (5 diffs)
-
tst_psHash04.c (modified) (2 diffs)
-
tst_psList.c (modified) (49 diffs)
-
tst_psMetadataIO.c (modified) (7 diffs)
-
tst_psMetadata_01.c (modified) (4 diffs)
-
tst_psMetadata_02.c (modified) (3 diffs)
-
tst_psMetadata_03.c (modified) (3 diffs)
-
tst_psMetadata_04.c (modified) (3 diffs)
-
tst_psMetadata_05.c (modified) (3 diffs)
-
tst_psMetadata_06.c (modified) (3 diffs)
-
tst_psVector.c (modified) (6 diffs)
-
tst_psVectorSort_01.c (modified) (6 diffs)
-
tst_psVectorSort_02.c (modified) (5 diffs)
-
tst_psVectorSort_03.c (modified) (5 diffs)
-
tst_psVectorSort_04.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psArray.c
r1920 r2204 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2004- 09-28 23:26:49$14 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-10-27 00:57:33 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 typedef struct 27 27 { 28 intx;28 psS32 x; 29 29 float y; 30 30 } … … 32 32 33 33 34 int main(intargc,35 char* argv[])34 psS32 main(psS32 argc, 35 char* argv[]) 36 36 { 37 37 // Create array of pointers … … 51 51 // Test B - Add data to void pointer array 52 52 printPositiveTestHeader(stdout, "psArray", "Add data to void pointer array"); 53 for( inti = 0; i < 5; i++) {53 for(psS32 i = 0; i < 5; i++) { 54 54 testStruct *ts = psAlloc(sizeof(testStruct)); 55 55 ts->x = 10*i; … … 60 60 } 61 61 62 for( inti = 0; i < 5; i++) {62 for(psS32 i = 0; i < 5; i++) { 63 63 testStruct *ts = (testStruct*)psArr->data[i]; 64 64 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); … … 85 85 psArr = psArrayRealloc(psArr,10); 86 86 printf("Adding more elements to void pointer array...\n"); 87 for( inti = 5; i < 10; i++) {87 for(psS32 i = 5; i < 10; i++) { 88 88 testStruct *ts = psAlloc(sizeof(testStruct)); 89 89 ts->x = 10*i; … … 94 94 psMemIncrRefCounter(ts); 95 95 } 96 for( inti = 0; i < 10; i++) {96 for(psS32 i = 0; i < 10; i++) { 97 97 testStruct *ts = (testStruct*)psArr->data[i]; 98 98 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); … … 118 118 printPositiveTestHeader(stdout,"psArray","Reallocate void pointer array smaller"); 119 119 psArr = psArrayRealloc(psArr,3); 120 for( inti = 0; i < 3; i++) {120 for(psS32 i = 0; i < 3; i++) { 121 121 testStruct *ts = (testStruct*)psArr->data[i]; 122 122 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); … … 142 142 printPositiveTestHeader(stdout, "psArray", "Free void pointer array"); 143 143 psFree(psArr); 144 for( inti = 0; i < 10; i++) {144 for(psS32 i = 0; i < 10; i++) { 145 145 psFree(mySt[i]); 146 146 } 147 147 psMemCheckLeaks(0, NULL, stdout); 148 intnBad = psMemCheckCorruption(0);148 psS32 nBad = psMemCheckCorruption(0); 149 149 if(nBad) { 150 150 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psBitSet.c
r1807 r2204 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $20 * @date $Date: 2004- 09-14 20:01:52$19 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-10-27 00:57:33 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psTest.h" 28 28 29 static inttestBitSet01a(void);30 static inttestBitSet01b(void);31 static inttestBitSet01c(void);32 static inttestBitSet02(void);33 static inttestBitSet03(void);34 static inttestBitSet04(void);35 static inttestBitSet05(void);36 static inttestBitSet06(void);29 static psS32 testBitSet01a(void); 30 static psS32 testBitSet01b(void); 31 static psS32 testBitSet01c(void); 32 static psS32 testBitSet02(void); 33 static psS32 testBitSet03(void); 34 static psS32 testBitSet04(void); 35 static psS32 testBitSet05(void); 36 static psS32 testBitSet06(void); 37 37 38 38 testDescription tests[] = { … … 50 50 51 51 52 int main( intargc, char* argv[] )52 psS32 main( psS32 argc, char* argv[] ) 53 53 { 54 54 psLogSetLevel( PS_LOG_INFO ); … … 57 57 } 58 58 59 inttestBitSet01a(void)59 psS32 testBitSet01a(void) 60 60 { 61 61 psErr* err; … … 109 109 } 110 110 111 inttestBitSet01b(void)111 psS32 testBitSet01b(void) 112 112 { 113 113 char *binOut = NULL; … … 212 212 } 213 213 214 static inttestBitSet01c(void)214 static psS32 testBitSet01c(void) 215 215 { 216 216 psBitSet* bs = psBitSetAlloc(24); … … 275 275 } 276 276 277 inttestBitSet02()277 psS32 testBitSet02() 278 278 { 279 279 char *binOut1 = NULL; … … 284 284 psBitSet* bs2 = psBitSetAlloc(24); 285 285 psBitSet* and = psBitSetAlloc(24); 286 for( inti=0; i<24; i++) {286 for(psS32 i=0; i<24; i++) { 287 287 if ((i & 2) == 0) { 288 288 bs1 = psBitSetSet(bs1, i); … … 312 312 } 313 313 314 for( inti=0; i<24; i++) {315 bool truth = psBitSetTest(and,i);316 bool res = psBitSetTest(outbs,i);314 for(psS32 i=0; i<24; i++) { 315 psBool truth = psBitSetTest(and,i); 316 psBool res = psBitSetTest(outbs,i); 317 317 if ( res != truth) { 318 318 binOut1 = psBitSetToString(bs1); … … 331 331 psAbort(__func__,"psBitSetOp failed to create a new psBitSet for the result"); 332 332 } 333 for( inti=0; i<24; i++) {334 bool truth = psBitSetTest(and,i);335 bool res = psBitSetTest(outbs,i);333 for(psS32 i=0; i<24; i++) { 334 psBool truth = psBitSetTest(and,i); 335 psBool res = psBitSetTest(outbs,i); 336 336 if ( res != truth) { 337 337 binOut1 = psBitSetToString(bs1); … … 351 351 } 352 352 353 static inttestBitSet03(void)353 static psS32 testBitSet03(void) 354 354 { 355 355 char *binOut1 = NULL; … … 360 360 psBitSet* bs2 = psBitSetAlloc(24); 361 361 psBitSet* or = psBitSetAlloc(24); 362 for( inti=0; i<24; i++) {362 for(psS32 i=0; i<24; i++) { 363 363 if ((i/2) % 2) { 364 364 bs1 = psBitSetSet(bs1, i); … … 389 389 } 390 390 391 for( inti=0; i<24; i++) {392 bool truth = psBitSetTest(or,i);393 bool res = psBitSetTest(outbs,i);391 for(psS32 i=0; i<24; i++) { 392 psBool truth = psBitSetTest(or,i); 393 psBool res = psBitSetTest(outbs,i); 394 394 if ( res != truth) { 395 395 binOut1 = psBitSetToString(bs1); … … 408 408 psAbort(__func__,"psBitSetOp failed to create a new psBitSet for the result"); 409 409 } 410 for( inti=0; i<24; i++) {411 bool truth = psBitSetTest(or,i);412 bool res = psBitSetTest(outbs,i);410 for(psS32 i=0; i<24; i++) { 411 psBool truth = psBitSetTest(or,i); 412 psBool res = psBitSetTest(outbs,i); 413 413 if ( res != truth) { 414 414 binOut1 = psBitSetToString(bs1); … … 429 429 } 430 430 431 static inttestBitSet04(void)431 static psS32 testBitSet04(void) 432 432 { 433 433 char *binOut1 = NULL; … … 438 438 psBitSet* bs2 = psBitSetAlloc(24); 439 439 psBitSet* xor = psBitSetAlloc(24); 440 for( inti=0; i<24; i++) {440 for(psS32 i=0; i<24; i++) { 441 441 if ((i/2) % 2) { 442 442 bs1 = psBitSetSet(bs1, i); … … 467 467 } 468 468 469 for( inti=0; i<24; i++) {470 bool truth = psBitSetTest(xor,i);471 bool res = psBitSetTest(outbs,i);469 for(psS32 i=0; i<24; i++) { 470 psBool truth = psBitSetTest(xor,i); 471 psBool res = psBitSetTest(outbs,i); 472 472 if ( res != truth) { 473 473 binOut1 = psBitSetToString(bs1); … … 486 486 psAbort(__func__,"psBitSetOp failed to create a new psBitSet for the result"); 487 487 } 488 for( inti=0; i<24; i++) {489 bool truth = psBitSetTest(xor,i);490 bool res = psBitSetTest(outbs,i);488 for(psS32 i=0; i<24; i++) { 489 psBool truth = psBitSetTest(xor,i); 490 psBool res = psBitSetTest(outbs,i); 491 491 if ( res != truth) { 492 492 binOut1 = psBitSetToString(bs1); … … 507 507 } 508 508 509 static inttestBitSet05(void)509 static psS32 testBitSet05(void) 510 510 { 511 511 char *binOut1 = NULL; … … 514 514 psBitSet* bs1 = psBitSetAlloc(24); 515 515 psBitSet* not = psBitSetAlloc(24); 516 for( inti=0; i<24; i++) {516 for(psS32 i=0; i<24; i++) { 517 517 if (i % 2) { 518 518 bs1 = psBitSetSet(bs1, i); … … 538 538 } 539 539 540 for( inti=0; i<24; i++) {541 bool truth = psBitSetTest(not,i);542 bool res = psBitSetTest(outbs,i);540 for(psS32 i=0; i<24; i++) { 541 psBool truth = psBitSetTest(not,i); 542 psBool res = psBitSetTest(outbs,i); 543 543 if ( res != truth) { 544 544 binOut1 = psBitSetToString(bs1); … … 556 556 psAbort(__func__,"psBitSetOp failed to create a new psBitSet for the result"); 557 557 } 558 for( inti=0; i<24; i++) {559 bool truth = psBitSetTest(not,i);560 bool res = psBitSetTest(outbs,i);558 for(psS32 i=0; i<24; i++) { 559 psBool truth = psBitSetTest(not,i); 560 psBool res = psBitSetTest(outbs,i); 561 561 if ( res != truth) { 562 562 binOut1 = psBitSetToString(bs1); … … 575 575 } 576 576 577 static inttestBitSet06(void)577 static psS32 testBitSet06(void) 578 578 { 579 579 psErr* err; -
trunk/psLib/test/collections/tst_psHash00.c
r1421 r2204 8 8 #include "psHash.h" 9 9 #define NUM_HASH_TABLE_BUCKETS 10 10 intmain()10 psS32 main() 11 11 { 12 12 psHash *myHashTable = NULL; 13 inttestStatus = true;14 inti = 0;15 intcurrentId = psMemGetId();16 intmemLeaks = 0;13 psS32 testStatus = true; 14 psS32 i = 0; 15 psS32 currentId = psMemGetId(); 16 psS32 memLeaks = 0; 17 17 printPositiveTestHeader(stdout, 18 18 "psHash functions", -
trunk/psLib/test/collections/tst_psHash01.c
r1811 r2204 7 7 #include "psHash.h" 8 8 #define NUM_HASH_TABLE_BUCKETS 100 9 intimGlobal = 0;9 psS32 imGlobal = 0; 10 10 11 11 typedef struct … … 32 32 } 33 33 34 intmain()34 psS32 main() 35 35 { 36 36 psHash *myHashTable = NULL; 37 inttestStatus = true;38 intcurrentId = psMemGetId();37 psS32 testStatus = true; 38 psS32 currentId = psMemGetId(); 39 39 ID* id = NULL; 40 intmemLeaks = 0;40 psS32 memLeaks = 0; 41 41 42 42 printPositiveTestHeader(stdout, -
trunk/psLib/test/collections/tst_psHash02.c
r1421 r2204 12 12 #include "psHash.h" 13 13 #define NUM_HASH_TABLE_BUCKETS 100 14 intimGlobal = 0;14 psS32 imGlobal = 0; 15 15 16 16 typedef struct … … 36 36 } 37 37 38 intmain()38 psS32 main() 39 39 { 40 40 psHash *myHashTable = NULL; 41 inttestStatus = true;42 inti = 0;41 psS32 testStatus = true; 42 psS32 i = 0; 43 43 ID *id = NULL; 44 44 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL … … 46 46 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL 47 47 }; 48 intcurrentId = psMemGetId();49 intmemLeaks = 0;48 psS32 currentId = psMemGetId(); 49 psS32 memLeaks = 0; 50 50 51 51 printPositiveTestHeader(stdout, -
trunk/psLib/test/collections/tst_psHash03.c
r1811 r2204 11 11 #include "psMemory.h" 12 12 #define NUM_HASH_TABLE_BUCKETS 100 13 intimGlobal = 0;14 intcurrentId = 0;13 psS32 imGlobal = 0; 14 psS32 currentId = 0; 15 15 16 16 typedef struct … … 27 27 psMemBlock **memBlocks = NULL; 28 28 psMemBlock *tmp = NULL; 29 intnumBlocks = 0;29 psS32 numBlocks = 0; 30 30 31 31 numBlocks = psMemCheckLeaks(currentId, &memBlocks, NULL); … … 36 36 if (memBlocks != NULL) { 37 37 for (tmp = *memBlocks; tmp != NULL; tmp = tmp->nextBlock) { 38 printf("%d ", ( int) tmp->id);38 printf("%d ", (psS32) tmp->id); 39 39 } 40 40 } … … 62 62 } 63 63 64 intmain()64 psS32 main() 65 65 { 66 66 psHash *myHashTable = NULL; 67 inttestStatus = true;68 inti = 0;69 intTotalKeys = 0;70 bool retVal = false;67 psS32 testStatus = true; 68 psS32 i = 0; 69 psS32 TotalKeys = 0; 70 psBool retVal = false; 71 71 ID *id = NULL; 72 72 ID *ids[4]; … … 75 75 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL 76 76 }; 77 intmemLeaks = 0;77 psS32 memLeaks = 0; 78 78 79 79 currentId = psMemGetId(); -
trunk/psLib/test/collections/tst_psHash04.c
r1421 r2204 7 7 #include "psHash.h" 8 8 #define NUM_HASH_TABLE_BUCKETS 100 9 intimGlobal = 0;9 psS32 imGlobal = 0; 10 10 11 11 typedef struct … … 32 32 } 33 33 34 intmain()34 psS32 main() 35 35 { 36 36 psHash *myHashTable = NULL; 37 inttestStatus = true;38 inti = 0;37 psS32 testStatus = true; 38 psS32 i = 0; 39 39 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL 40 40 }; 41 41 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL 42 42 }; 43 intcurrentId = psMemGetId();44 intmemLeaks = 0;43 psS32 currentId = psMemGetId(); 44 psS32 memLeaks = 0; 45 45 psList *myLinkList = NULL; 46 46 psListElem *tmp = NULL; -
trunk/psLib/test/collections/tst_psList.c
r1749 r2204 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2004- 09-09 02:24:59$8 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-27 00:57:33 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 18 18 19 19 20 static inttestListAlloc(void);21 static inttestListAdd(void);22 static inttestListGet(void);23 static inttestListRemove(void);24 static inttestListConvert(void);25 static inttestListIterator(void);26 static inttestListFree(void);27 static inttestListSort(void);20 static psS32 testListAlloc(void); 21 static psS32 testListAdd(void); 22 static psS32 testListGet(void); 23 static psS32 testListRemove(void); 24 static psS32 testListConvert(void); 25 static psS32 testListIterator(void); 26 static psS32 testListFree(void); 27 static psS32 testListSort(void); 28 28 29 29 testDescription tests[] = { … … 39 39 }; 40 40 41 int main(intargc, char* argv[])41 psS32 main(psS32 argc, char* argv[]) 42 42 { 43 43 psLogSetLevel(PS_LOG_INFO); … … 50 50 } 51 51 52 inttestListAlloc(void)52 psS32 testListAlloc(void) 53 53 { 54 54 psList* list; 55 intref;55 psS32 ref; 56 56 float* data; 57 57 … … 117 117 } 118 118 119 inttestListAdd(void)119 psS32 testListAdd(void) 120 120 { 121 121 psList* list = NULL; 122 int* data = NULL;122 psS32* data = NULL; 123 123 124 124 psLogMsg(__func__,PS_LOG_INFO,"psListAdd shall add an element to list"); … … 134 134 */ 135 135 136 data = psAlloc(sizeof( int));136 data = psAlloc(sizeof(psS32)); 137 137 *data = 1; 138 138 … … 161 161 162 162 // 3. where is PS_LIST_HEAD or PS_LIST_TAIL 163 data = psAlloc(sizeof( int));163 data = psAlloc(sizeof(psS32)); 164 164 *data = 2; 165 165 if ( ! psListAdd(list,PS_LIST_HEAD,data) ) { … … 181 181 182 182 // verify that the head is the inserted data item 183 if (*( int*)list->head->data != 2) {183 if (*(psS32*)list->head->data != 2) { 184 184 psError(__func__,"psListAdd with PS_LIST_HEAD didn't insert at the head."); 185 185 return 5; 186 186 } 187 187 188 data = psAlloc(sizeof( int));188 data = psAlloc(sizeof(psS32)); 189 189 *data = 3; 190 190 if ( ! psListAdd(list,PS_LIST_TAIL,data) ) { … … 205 205 206 206 // verify that the head is still the same 207 if (*( int*)list->head->data != 2) {207 if (*(psS32*)list->head->data != 2) { 208 208 psError(__func__,"psListAdd with PS_LIST_TAIL modified the head."); 209 209 return 7; … … 211 211 212 212 // verify that the tail is the data item inserted 213 if (*( int*)list->tail->data != 3) {213 if (*(psS32*)list->tail->data != 3) { 214 214 psError(__func__,"psListAdd with PS_LIST_TAIL didn't insert at the tail."); 215 215 return 8; … … 218 218 // 4. where is not PS_LIST_* but <0 219 219 220 data = psAlloc(sizeof( int));220 data = psAlloc(sizeof(psS32)); 221 221 *data = 4; 222 222 psLogMsg(__func__,PS_LOG_INFO,"Following should error with invalid insert location"); … … 239 239 240 240 // 5. where is >0 241 data = psAlloc(sizeof( int));241 data = psAlloc(sizeof(psS32)); 242 242 *data = 5; 243 243 … … 253 253 psFree(data); 254 254 // verify that the size incremented 255 if (list->size != 4 || *( int*)list->head->next->data != 5) {255 if (list->size != 4 || *(psS32*)list->head->next->data != 5) { 256 256 printListInt(list); 257 257 psError(__func__,"psListAdd didn't insert to position #1."); … … 259 259 } 260 260 261 data = psAlloc(sizeof( int));261 data = psAlloc(sizeof(psS32)); 262 262 *data = 6; 263 263 if ( ! psListAdd(list,3,data) ) { … … 271 271 psFree(data); 272 272 // verify that the size incremented 273 if (list->size != 5 || *( int*)list->head->next->next->next->data != 6) {273 if (list->size != 5 || *(psS32 *)list->head->next->next->next->data != 6) { 274 274 printListInt(list); 275 275 psError(__func__,"psListAdd didn't insert to position #4."); … … 277 277 } 278 278 279 data = psAlloc(sizeof( int));279 data = psAlloc(sizeof(psS32)); 280 280 *data = 7; 281 281 if ( ! psListAdd(list,2,data) ) { … … 289 289 psFree(data); 290 290 // verify that the size incremented 291 if (list->size != 6 || *( int*)list->head->next->next->data != 7) {291 if (list->size != 6 || *(psS32 *)list->head->next->next->data != 7) { 292 292 printListInt(list); 293 293 psError(__func__,"psListAdd didn't insert to position #2."); … … 295 295 } 296 296 297 data = psAlloc(sizeof( int));297 data = psAlloc(sizeof(psS32)); 298 298 *data = 7; 299 299 psLogMsg(__func__,PS_LOG_INFO,"Following should be a warning."); … … 325 325 void printListInt(psList* list) 326 326 { 327 int* data = NULL;328 bool first = true;327 psS32* data = NULL; 328 psBool first = true; 329 329 330 330 psListSetIterator(list,PS_LIST_HEAD); … … 333 333 while ( data != NULL ) { 334 334 if (!first) { 335 printf(", %d",*( int*)data);335 printf(", %d",*(psS32*)data); 336 336 } else { 337 printf("%d",*( int*)data);337 printf("%d",*(psS32*)data); 338 338 first = false; 339 339 } … … 345 345 346 346 347 inttestListGet(void)347 psS32 testListGet(void) 348 348 { 349 349 psList* list = NULL; 350 int* data;350 psS32* data; 351 351 352 352 /* … … 371 371 372 372 // create a list 373 data = psAlloc(sizeof( int));373 data = psAlloc(sizeof(psS32)); 374 374 *data = 0; 375 375 list = psListAlloc(data); 376 376 psFree(data); 377 377 378 data = psAlloc(sizeof( int));378 data = psAlloc(sizeof(psS32)); 379 379 *data = 1; 380 380 psListAdd(list,PS_LIST_TAIL,data); 381 381 psFree(data); 382 382 383 data = psAlloc(sizeof( int));383 data = psAlloc(sizeof(psS32)); 384 384 *data = 2; 385 385 psListAdd(list,PS_LIST_TAIL,data); 386 386 psFree(data); 387 387 388 data = psAlloc(sizeof( int));388 data = psAlloc(sizeof(psS32)); 389 389 *data = 3; 390 390 psListAdd(list,PS_LIST_TAIL,data); … … 392 392 393 393 // 2. which>0 and which<list.n. 394 data = ( int*)psListGet(list,3);394 data = (psS32*)psListGet(list,3); 395 395 if (data == NULL || *data != 3) { 396 396 psError(__func__,"psListGet failed with which=3"); 397 397 return 2; 398 398 } 399 data = ( int*)psListGet(list,1);399 data = (psS32*)psListGet(list,1); 400 400 if (data == NULL || *data != 1) { 401 401 psError(__func__,"psListGet failed with which=1"); … … 404 404 405 405 // 3. which>=list.n. 406 data = ( int*)psListGet(list,5);406 data = (psS32*)psListGet(list,5); 407 407 if (data != NULL) { 408 408 psError(__func__,"psListGet failed with which=5"); 409 409 return 4; 410 410 } 411 data = ( int*)psListGet(list,4);411 data = (psS32*)psListGet(list,4); 412 412 if (data != NULL) { 413 413 psError(__func__,"psListGet failed with which=4"); … … 416 416 417 417 // 4. which=PS_LIST_HEAD 418 data = ( int*)psListGet(list,PS_LIST_HEAD);418 data = (psS32*)psListGet(list,PS_LIST_HEAD); 419 419 if (data == NULL || *data != 0) { 420 420 psError(__func__,"psListGet failed with which=PS_LIST_HEAD"); … … 423 423 424 424 // 5. which=PS_LIST_NEXT 425 data = ( int*)psListGet(list,PS_LIST_NEXT);425 data = (psS32*)psListGet(list,PS_LIST_NEXT); 426 426 if (data == NULL || *data != 1) { 427 427 psError(__func__,"psListGet failed with which=PS_LIST_NEXT"); … … 430 430 431 431 // 6. which=PS_LIST_TAIL 432 data = ( int*)psListGet(list,PS_LIST_TAIL);432 data = (psS32*)psListGet(list,PS_LIST_TAIL); 433 433 if (data == NULL || *data != 3) { 434 434 psError(__func__,"psListGet failed with which=PS_LIST_TAIL"); … … 437 437 438 438 // 7. which=PS_LIST_PREV 439 data = ( int*)psListGet(list,PS_LIST_PREVIOUS);439 data = (psS32*)psListGet(list,PS_LIST_PREVIOUS); 440 440 if (data == NULL || *data != 2) { 441 441 psError(__func__,"psListGet failed with which=PS_LIST_PREV"); … … 448 448 } 449 449 450 inttestListRemove(void)450 psS32 testListRemove(void) 451 451 { 452 452 psList* list = NULL; 453 int* data;453 psS32* data; 454 454 455 455 /* … … 480 480 list = psListAlloc(NULL); 481 481 482 for ( intlcv=0;lcv<15;lcv++) {483 data = psAlloc(sizeof( int));482 for (psS32 lcv=0;lcv<15;lcv++) { 483 data = psAlloc(sizeof(psS32)); 484 484 *data = lcv; 485 485 psListAdd(list,PS_LIST_TAIL,data); … … 682 682 } 683 683 684 inttestListConvert(void)684 psS32 testListConvert(void) 685 685 { 686 686 687 687 psList* list = NULL; 688 688 psArray* arr = NULL; 689 int* data;689 psS32* data; 690 690 691 691 /* 692 692 array=psListToArray(list) shall take each element of the list, increment 693 their reference, and insert them into the returned fresh void*array.693 their reference, and insert them into the returned fresh psPtr array. 694 694 The list shall not be changed, except for the element reference increment. 695 695 */ … … 699 699 // create a list 700 700 list = psListAlloc(NULL); 701 for ( intlcv=0;lcv<15;lcv++) {702 data = psAlloc(sizeof( int));701 for (psS32 lcv=0;lcv<15;lcv++) { 702 data = psAlloc(sizeof(psS32)); 703 703 *data = lcv; 704 704 psListAdd(list,PS_LIST_TAIL,data); … … 712 712 return 1; 713 713 } 714 for ( inti=0;i<arr->n;i++) {715 if (i != *( int*)arr->data[i]) {714 for (psS32 i=0;i<arr->n;i++) { 715 if (i != *(psS32*)arr->data[i]) { 716 716 psError(__func__,"Element %d of array is incorrect (%d).", 717 i,*( int*)arr->data[i]);717 i,*(psS32*)arr->data[i]); 718 718 return 1; 719 719 } 720 if (i != *( int*)psListGet(list,i)) {720 if (i != *(psS32*)psListGet(list,i)) { 721 721 psError(__func__,"Element %d of list is incorrect (%d).", 722 i,*( int*)arr->data[i]);722 i,*(psS32*)arr->data[i]); 723 723 return 1; 724 724 } … … 738 738 arr = psArrayAlloc(15); 739 739 arr->n = arr->nalloc; 740 for ( intlcv=0;lcv<15;lcv++) {741 data = psAlloc(sizeof( int));740 for (psS32 lcv=0;lcv<15;lcv++) { 741 data = psAlloc(sizeof(psS32)); 742 742 *data = lcv; 743 743 arr->data[lcv] = data; … … 750 750 return 1; 751 751 } 752 for ( inti=0;i<arr->n;i++) {753 if (i != *( int*)arr->data[i]) {752 for (psS32 i=0;i<arr->n;i++) { 753 if (i != *(psS32*)arr->data[i]) { 754 754 psError(__func__,"Element %d of array is incorrect (%d).", 755 i,*( int*)arr->data[i]);755 i,*(psS32*)arr->data[i]); 756 756 return 1; 757 757 } 758 if (i != *( int*)psListGet(list,i)) {758 if (i != *(psS32*)psListGet(list,i)) { 759 759 psError(__func__,"Element %d of list is incorrect (%d).", 760 i,*( int*)arr->data[i]);760 i,*(psS32*)arr->data[i]); 761 761 return 1; 762 762 } … … 810 810 } 811 811 812 inttestListIterator(void)812 psS32 testListIterator(void) 813 813 { 814 814 psList* list = NULL; 815 int* data;815 psS32* data; 816 816 817 817 psLogMsg(__func__,PS_LOG_INFO," psListSetIterator/psListGetNext/psListGetPrev" … … 837 837 // create a list 838 838 list = psListAlloc(NULL); 839 for ( intlcv=0;lcv<15;lcv++) {840 data = psAlloc(sizeof( int));839 for (psS32 lcv=0;lcv<15;lcv++) { 840 data = psAlloc(sizeof(psS32)); 841 841 *data = lcv; 842 842 psListAdd(list,PS_LIST_TAIL,data); … … 852 852 // 3. set list.cursor to list.tail if where=PS_LIST_TAIL 853 853 psListSetIterator(list,PS_LIST_TAIL); 854 if (*( int*)psListGetCurrent(list) != 14) {854 if (*(psS32*)psListGetCurrent(list) != 14) { 855 855 psError(__func__,"Didn't successfully move cursor to tail."); 856 856 return 1; … … 859 859 // 2. set list.cursor to list.head if where=PS_LIST_HEAD 860 860 psListSetIterator(list,PS_LIST_HEAD); 861 if (*( int*)psListGetCurrent(list) != 0) {861 if (*(psS32*)psListGetCurrent(list) != 0) { 862 862 psError(__func__,"Didn't successfully move cursor to head."); 863 863 return 2; … … 866 866 // 4. set list.cursor to list.cursor->next if where=PS_LIST_NEXT 867 867 psListSetIterator(list,PS_LIST_NEXT); 868 if (*( int*)psListGetCurrent(list) != 1) {868 if (*(psS32*)psListGetCurrent(list) != 1) { 869 869 psError(__func__,"Didn't successfully move cursor to next."); 870 870 return 3; 871 871 } 872 872 psListSetIterator(list,PS_LIST_NEXT); 873 if (*( int*)psListGetCurrent(list) != 2) {873 if (*(psS32*)psListGetCurrent(list) != 2) { 874 874 psError(__func__,"Didn't successfully move cursor to next twice."); 875 875 return 4; … … 878 878 // 5. set list.cursor to list.cursor->prev if where=PS_LIST_PREV 879 879 psListSetIterator(list,PS_LIST_PREVIOUS); 880 if (*( int*)psListGetCurrent(list) != 1) {880 if (*(psS32*)psListGetCurrent(list) != 1) { 881 881 psError(__func__,"Didn't successfully move cursor to previous."); 882 882 return 5; 883 883 } 884 884 psListSetIterator(list,PS_LIST_PREVIOUS); 885 if (*( int*)psListGetCurrent(list) != 0) {885 if (*(psS32*)psListGetCurrent(list) != 0) { 886 886 psError(__func__,"Didn't successfully move cursor to previous twice."); 887 887 return 6; … … 892 892 psLogMsg(__func__,PS_LOG_INFO,"Following should error with 'Can't move to an unknown position.'"); 893 893 psListSetIterator(list,PS_LIST_UNKNOWN); 894 if (*( int*)psListGetCurrent(list) != 1) {894 if (*(psS32*)psListGetCurrent(list) != 1) { 895 895 psError(__func__,"PS_LIST_UNKNOWN moved cursor."); 896 896 return 7; 897 897 } 898 898 psListSetIterator(list,PS_LIST_CURRENT); 899 if (*( int*)psListGetCurrent(list) != 1) {899 if (*(psS32*)psListGetCurrent(list) != 1) { 900 900 psError(__func__,"PS_LIST_CURRENT moved cursor."); 901 901 return 8; … … 903 903 904 904 // test psListGetPrevious/Next 905 if (*( int*)psListGetNext(list) != 2) {905 if (*(psS32*)psListGetNext(list) != 2) { 906 906 psError(__func__,"psListGetNext didn't move cursor to next."); 907 907 return 9; 908 908 } 909 if (*( int*)psListGetNext(list) != 3) {909 if (*(psS32*)psListGetNext(list) != 3) { 910 910 psError(__func__,"psListGetNext didn't move cursor to next."); 911 911 return 10; 912 912 } 913 if (*( int*)psListGetPrevious(list) != 2) {913 if (*(psS32*)psListGetPrevious(list) != 2) { 914 914 psError(__func__,"psListGetPrevious didn't move cursor to previous."); 915 915 return 11; 916 916 } 917 if (*( int*)psListGetPrevious(list) != 1) {917 if (*(psS32*)psListGetPrevious(list) != 1) { 918 918 psError(__func__,"psListGetPrevious didn't move cursor to previous."); 919 919 return 12; 920 920 } 921 if (*( int*)psListGetPrevious(list) != 0) {921 if (*(psS32*)psListGetPrevious(list) != 0) { 922 922 psError(__func__,"psListGetPrevious didn't move cursor to previous.."); 923 923 return 13; … … 939 939 } 940 940 941 inttestListFree(void)941 psS32 testListFree(void) 942 942 { 943 943 float* data[15]; … … 954 954 955 955 list = psListAlloc(NULL); 956 for ( intlcv=0;lcv<15;lcv++) {957 data[lcv] = psAlloc(sizeof( int));956 for (psS32 lcv=0;lcv<15;lcv++) { 957 data[lcv] = psAlloc(sizeof(psS32)); 958 958 *data[lcv] = lcv; 959 959 psListAdd(list,PS_LIST_TAIL,data[lcv]); … … 987 987 */ 988 988 989 for ( inti=0;i<15;i++) {989 for (psS32 i=0;i<15;i++) { 990 990 if (psMemGetRefCounter(data[i]) != 1) { 991 991 psError(__func__,"pslistFree didn't decrement the data item's reference counter"); … … 998 998 } 999 999 1000 inttestListSort(void)1000 psS32 testListSort(void) 1001 1001 { 1002 1002 psList* list; … … 1004 1004 list = psListAlloc(NULL); 1005 1005 1006 for ( intlcv=0;lcv<15;lcv++) {1007 float* data = psAlloc(sizeof( int));1006 for (psS32 lcv=0;lcv<15;lcv++) { 1007 float* data = psAlloc(sizeof(psS32)); 1008 1008 if (lcv < 7) { 1009 1009 *data = 13-lcv*2; … … 1070 1070 list = psListAlloc(NULL); 1071 1071 1072 for ( intlcv=0;lcv<15;lcv++) {1073 psU32* data = psAlloc(sizeof( int));1072 for (psS32 lcv=0;lcv<15;lcv++) { 1073 psU32* data = psAlloc(sizeof(psS32)); 1074 1074 if (lcv < 7) { 1075 1075 *data = 13-lcv*2; -
trunk/psLib/test/collections/tst_psMetadataIO.c
r1986 r2204 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-10- 06 22:51:31 $15 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-10-27 00:57:31 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 80 80 vec = (psVector*)metadataItem->data.V; 81 81 printf("Key Value: "); 82 for( inti=0; i<vec->nalloc;i++) {82 for(psS32 i=0; i<vec->nalloc;i++) { 83 83 printf("%d ", vec->data.S32[i]); 84 84 } … … 103 103 static void printMetadataTable(psHash *mdTable) 104 104 { 105 inti;105 psS32 i; 106 106 psHashBucket* ptr = NULL; 107 107 for(i=0; i<mdTable->nbucket; i++) { … … 123 123 124 124 125 int main(intargc, char* argv[])125 psS32 main(psS32 argc, char* argv[]) 126 126 { 127 127 // Test A - Read config file with overwrite set true 128 128 printPositiveTestHeader(stdout, "psMetadata", "Test A - Read config file with overwrite set true"); 129 129 psMetadata *metadata1 = NULL; 130 intfailedLines1 = 0;130 psS32 failedLines1 = 0; 131 131 failedLines1 = psMetadataParseConfig(&metadata1, "test.config", true); 132 132 printf("Failed lines: %d Expected: 6\n", failedLines1); … … 138 138 printPositiveTestHeader(stdout, "psMetadata", "Test B - Read config file with overwrite set false"); 139 139 psMetadata *metadata2 = NULL; 140 intfailedLines2 = 0;140 psS32 failedLines2 = 0; 141 141 failedLines2 = psMetadataParseConfig(&metadata2, "test.config", false); 142 142 printf("Failed lines: %d Expected: 7", failedLines2); … … 148 148 printPositiveTestHeader(stdout, "psMetadata", "Test C - Read config file without auto-allocation of metadata"); 149 149 psMetadata *metadata3 = psMetadataAlloc(); 150 intfailedLines3 = 0;150 psS32 failedLines3 = 0; 151 151 failedLines3 = psMetadataParseConfig(&metadata3, "test.config", false); 152 152 printf("Failed lines: %d Expected: 7", failedLines3); … … 176 176 psMemCheckLeaks(0, NULL, stdout); 177 177 psMemCheckCorruption(0); 178 intnBad = psMemCheckCorruption(0);178 psS32 nBad = psMemCheckCorruption(0); 179 179 if(nBad) { 180 180 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psMetadata_01.c
r2153 r2204 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $20 * @date $Date: 2004-10- 15 19:26:31$19 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-10-27 00:57:33 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 96 96 static void printMetadataTable(psHash *mdTable) 97 97 { 98 inti;98 psS32 i; 99 99 psHashBucket* ptr = NULL; 100 100 for(i=0; i<mdTable->nbucket; i++) { … … 116 116 117 117 118 int main(intargc, char* argv[])118 psS32 main(psS32 argc, char* argv[]) 119 119 { 120 120 psMetadata *metadata1 = NULL; … … 262 262 psMemCheckLeaks(0, NULL, stdout); 263 263 psMemCheckCorruption(0); 264 intnBad = psMemCheckCorruption(0);264 psS32 nBad = psMemCheckCorruption(0); 265 265 if(nBad) { 266 266 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psMetadata_02.c
r2012 r2204 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-10- 07 22:31:31$16 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-10-27 00:57:33 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 60 60 61 61 62 int main( intargc, char* argv[] )62 psS32 main( psS32 argc, char* argv[] ) 63 63 { 64 64 psMetadataItem *item1 = NULL; … … 136 136 psMemCheckLeaks(0, NULL, stdout); 137 137 psMemCheckCorruption(0); 138 intnBad = psMemCheckCorruption(0);138 psS32 nBad = psMemCheckCorruption(0); 139 139 if(nBad) { 140 140 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psMetadata_03.c
r2018 r2204 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-10- 08 01:33:14$16 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-10-27 00:57:33 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 60 60 61 61 62 int main( intargc, char* argv[] )62 psS32 main( psS32 argc, char* argv[] ) 63 63 { 64 64 psMetadataItem *item1 = NULL; … … 231 231 } 232 232 psMemCheckCorruption(0); 233 intnBad = psMemCheckCorruption(0);233 psS32 nBad = psMemCheckCorruption(0); 234 234 if(nBad) { 235 235 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psMetadata_04.c
r2023 r2204 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $21 * @date $Date: 2004-10- 08 20:53:21$20 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2004-10-27 00:57:33 $ 22 22 * 23 23 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 64 64 65 65 66 int main( intargc, char* argv[] )66 psS32 main( psS32 argc, char* argv[] ) 67 67 { 68 68 psMetadataItem *item1 = NULL; … … 201 201 } 202 202 psMemCheckCorruption(0); 203 intnBad = psMemCheckCorruption(0);203 psS32 nBad = psMemCheckCorruption(0); 204 204 if(nBad) { 205 205 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psMetadata_05.c
r2049 r2204 22 22 * @author Ross Harman, MHPCC 23 23 * 24 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $25 * @date $Date: 2004-10- 12 01:40:32$24 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2004-10-27 00:57:33 $ 26 26 * 27 27 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 68 68 69 69 70 int main( intargc, char* argv[] )70 psS32 main( psS32 argc, char* argv[] ) 71 71 { 72 longdata;72 psS64 data; 73 73 psF32 fpdata; 74 74 psMetadataItem *item1 = NULL; … … 271 271 } 272 272 psMemCheckCorruption(0); 273 intnBad = psMemCheckCorruption(0);273 psS32 nBad = psMemCheckCorruption(0); 274 274 if(nBad) { 275 275 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psMetadata_06.c
r2050 r2204 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-10- 12 01:54:00$15 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-10-27 00:57:33 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 59 59 60 60 61 int main( intargc, char* argv[] )61 psS32 main( psS32 argc, char* argv[] ) 62 62 { 63 63 psMetadataItem *item1a = NULL; … … 134 134 } 135 135 psMemCheckCorruption(0); 136 intnBad = psMemCheckCorruption(0);136 psS32 nBad = psMemCheckCorruption(0); 137 137 if(nBad) { 138 138 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psVector.c
r1920 r2204 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $17 * @date $Date: 2004- 09-28 23:26:49$16 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-10-27 00:57:33 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psTest.h" 25 25 26 int main(intargc,27 char* argv[])26 psS32 main(psS32 argc, 27 char* argv[]) 28 28 { 29 29 … … 40 40 // Test B - Add data to integer vector 41 41 printPositiveTestHeader(stdout, "psVector", "Add data to S32 vector"); 42 for( inti = 0; i < 5; i++) {42 for(psS32 i = 0; i < 5; i++) { 43 43 psVec->data.S32[i] = i*10; 44 44 printf("Elem %d = %d\n", i, psVec->data.S32[i]); … … 53 53 psVec = psVectorRealloc(psVec,10); 54 54 printf("Adding more elements to S32 vector...\n"); 55 for( inti = 5; i < 10; i++) {55 for(psS32 i = 5; i < 10; i++) { 56 56 psVec->data.S32[i] = i*10; 57 57 psVec->n++; … … 67 67 psVec = psVectorRealloc(psVec,3); 68 68 printf("Vector size = %d\n", psVec->nalloc); 69 for( inti = 0; i < 3; i++) {69 for(psS32 i = 0; i < 3; i++) { 70 70 printf("Elem %d = %d\n", i, psVec->data.S32[i]); 71 71 } … … 78 78 printPositiveTestHeader(stdout, "psVector", "Free S32 vector"); 79 79 psFree(psVec); 80 intleaks = psMemCheckLeaks(0, NULL, stdout);80 psS32 leaks = psMemCheckLeaks(0, NULL, stdout); 81 81 if(leaks != 0) { 82 82 printf("ERROR: Found %d memory leaks\n",leaks); 83 83 } 84 intnBad = psMemCheckCorruption(0);84 psS32 nBad = psMemCheckCorruption(0); 85 85 if(nBad) { 86 86 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psVectorSort_01.c
r1406 r2204 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004- 08-06 22:34:05$12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:33 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 20 20 #include "psTest.h" 21 21 22 int main(intargc,23 char* argv[])22 psS32 main(psS32 argc, 23 char* argv[]) 24 24 { 25 25 psVector *in = NULL; … … 41 41 in->data.F32[5] = 5.0f; 42 42 in->data.F32[6] = -20.0f; 43 for( inti=0; i<7; i++) {43 for(psS32 i=0; i<7; i++) { 44 44 printf("vec[%d] = %f\n", i, in->data.F32[i]); 45 45 } … … 51 51 tempVec = out; 52 52 out = psVectorSort(out, in); 53 for( inti=0; i<7; i++) {53 for(psS32 i=0; i<7; i++) { 54 54 printf("vec[%d] = %f\n", i, out->data.F32[i]); 55 55 } … … 63 63 printPositiveTestHeader(stdout,"psVectorSort", "Sort input float vector into itself"); 64 64 in = psVectorSort(in, in); 65 for( inti=0; i<7; i++) {65 for(psS32 i=0; i<7; i++) { 66 66 printf("vec[%d] = %f\n", i, out->data.F32[i]); 67 67 } … … 74 74 psFree(out); 75 75 psMemCheckLeaks(0, NULL, stdout); 76 intnBad = psMemCheckCorruption(0);76 psS32 nBad = psMemCheckCorruption(0); 77 77 if(nBad) { 78 78 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psVectorSort_02.c
r1406 r2204 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004- 08-06 22:34:05$12 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:33 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 20 20 #include "psTest.h" 21 21 22 int main(intargc,23 char* argv[])22 psS32 main(psS32 argc, 23 char* argv[]) 24 24 { 25 25 psVector *in = NULL; … … 36 36 in->data.F32[3] = 1.0f; 37 37 in->data.F32[4] = 5.0f; 38 for( inti=0; i<5; i++) {38 for(psS32 i=0; i<5; i++) { 39 39 printf("arr[%d] = %f\n", i, in->data.F32[i]); 40 40 } … … 45 45 printPositiveTestHeader(stdout,"psVectorSortIndex", "Create sorted index vector"); 46 46 out = psVectorSortIndex(out, in); 47 for( inti=0; i<5; i++) {47 for(psS32 i=0; i<5; i++) { 48 48 printf("arr[%d] = %d\n", i, out->data.U32[i]); 49 49 } … … 61 61 psFree(in); 62 62 psFree(out); 63 intnLeaks = psMemCheckLeaks(0, NULL, stdout);63 psS32 nLeaks = psMemCheckLeaks(0, NULL, stdout); 64 64 if(nLeaks) { 65 65 printf("ERROR: Found %d memory leaks\n", nLeaks); 66 66 } 67 intnBad = psMemCheckCorruption(0);67 psS32 nBad = psMemCheckCorruption(0); 68 68 if(nBad) { 69 69 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psVectorSort_03.c
r1406 r2204 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004- 08-06 22:34:05$14 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-10-27 00:57:33 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "psTest.h" 23 23 24 int main(intargc,25 char* argv[])24 psS32 main(psS32 argc, 25 char* argv[]) 26 26 { 27 27 psVector *in = NULL; … … 37 37 out->n = 6; 38 38 in->n = 5; 39 for( inti=0; i<5; i++) {39 for(psS32 i=0; i<5; i++) { 40 40 printf("arr[%d] = %f\n", i, in->data.F32[i]); 41 41 } … … 55 55 out2 = psVectorAlloc(5, PS_TYPE_F64); 56 56 out2->n = 5; 57 for( intj=0; j<5; j++) {57 for(psS32 j=0; j<5; j++) { 58 58 printf("vec[%d] = %f\n", j, in2->data.F32[j]); 59 59 } … … 72 72 psFree(out); 73 73 psFree(out2); 74 intnLeaks = psMemCheckLeaks(0, NULL, stdout);74 psS32 nLeaks = psMemCheckLeaks(0, NULL, stdout); 75 75 if(nLeaks) { 76 76 printf("ERROR: Found %d memory leaks\n", nLeaks); 77 77 } 78 intnBad = psMemCheckCorruption(0);78 psS32 nBad = psMemCheckCorruption(0); 79 79 if(nBad) { 80 80 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/collections/tst_psVectorSort_04.c
r1406 r2204 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2004- 08-06 22:34:05$11 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 00:57:33 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 19 19 #include "psTest.h" 20 20 21 int main(intargc,22 char* argv[])21 psS32 main(psS32 argc, 22 char* argv[]) 23 23 { 24 24 psVector *badIn = NULL; … … 34 34 printPositiveTestHeader(stdout, "psVectorSort", "Free vectors"); 35 35 psFree(goodOut); 36 intnLeaks = psMemCheckLeaks(0, NULL, stdout);36 psS32 nLeaks = psMemCheckLeaks(0, NULL, stdout); 37 37 if(nLeaks) { 38 38 printf("ERROR: Found %d memory blocks\n", nLeaks); 39 39 } 40 intnBad = psMemCheckCorruption(0);40 psS32 nBad = psMemCheckCorruption(0); 41 41 if(nBad) { 42 42 printf("ERROR: Found %d bad memory blocks\n", nBad);
Note:
See TracChangeset
for help on using the changeset viewer.
