Changeset 2273 for trunk/psLib/test/collections
- Timestamp:
- Nov 3, 2004, 3:05:00 PM (22 years ago)
- Location:
- trunk/psLib/test/collections
- Files:
-
- 8 edited
-
tst_psArray.c (modified) (8 diffs)
-
tst_psList.c (modified) (77 diffs)
-
tst_psMetadata_01.c (modified) (4 diffs)
-
tst_psMetadata_02.c (modified) (2 diffs)
-
tst_psMetadata_03.c (modified) (11 diffs)
-
tst_psMetadata_04.c (modified) (9 diffs)
-
tst_psMetadata_05.c (modified) (6 diffs)
-
tst_psMetadata_06.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psArray.c
r2204 r2273 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-1 0-27 00:57:33$14 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-11-04 01:05:00 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 psArray *psArr = psArrayAlloc(5); 44 44 if (psArr->nalloc != 5) { 45 psError( __func__,"psArray didn't have proper number of elements.");45 psError(PS_ERR_UNKNOWN, true,"psArray didn't have proper number of elements."); 46 46 return 1; 47 47 } … … 64 64 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 65 65 if (fabsf(ts->x - 10*i) > 0.01f || fabsf(ts->y - 10.1*i) > 0.01f) { 66 psError( __func__,"Couldn't properly get elements from array.");66 psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array."); 67 67 return 2; 68 68 } … … 70 70 printf("array size = %d\n", psArr->nalloc); 71 71 if (psArr->nalloc != 5) { 72 psError( __func__,"Array Size wrong");72 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 73 73 return 3; 74 74 } 75 75 printf("array population = %d\n", psArr->n); 76 76 if (psArr->n != 5) { 77 psError( __func__,"Array population wrong");77 psError(PS_ERR_UNKNOWN, true,"Array population wrong"); 78 78 return 4; 79 79 } … … 98 98 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 99 99 if (fabsf(ts->x - 10*i) > 0.01f || fabsf(ts->y - 10.1*i) > 0.01f) { 100 psError( __func__,"Couldn't properly get elements from array.");100 psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array."); 101 101 return 5; 102 102 } … … 104 104 printf("array size = %d\n", psArr->nalloc); 105 105 if (psArr->nalloc != 10) { 106 psError( __func__,"Array Size wrong");106 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 107 107 return 6; 108 108 } 109 109 printf("array population = %d\n", psArr->n); 110 110 if (psArr->n != 10) { 111 psError( __func__,"Array Population wrong");111 psError(PS_ERR_UNKNOWN, true,"Array Population wrong"); 112 112 return 7; 113 113 } … … 122 122 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 123 123 if (fabsf(ts->x - 10*i) > 0.01f || fabsf(ts->y - 10.1*i) > 0.01f) { 124 psError( __func__,"Couldn't properly get elements from array.");124 psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array."); 125 125 return 8; 126 126 } … … 128 128 printf("array size = %d\n", psArr->nalloc); 129 129 if (psArr->nalloc != 3) { 130 psError( __func__,"Array Size wrong");130 psError(PS_ERR_UNKNOWN, true,"Array Size wrong"); 131 131 return 9; 132 132 } 133 133 printf("array population = %d\n", psArr->n); 134 134 if (psArr->n != 3) { 135 psError( __func__,"Array Population wrong");135 psError(PS_ERR_UNKNOWN, true,"Array Population wrong"); 136 136 return 10; 137 137 } -
trunk/psLib/test/collections/tst_psList.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-11-04 01:05:00 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 44 44 45 45 if (! runTestSuite(stderr,"psList",tests,argc,argv) ) { 46 psError( __FILE__,"One or more tests failed");46 psError(PS_ERR_UNKNOWN,true,"One or more tests failed"); 47 47 return 1; 48 48 } … … 66 66 list = psListAlloc(NULL); 67 67 if (list == NULL) { 68 psError( __func__,"psListAlloc failed to return a list.");68 psError(PS_ERR_UNKNOWN, true,"psListAlloc failed to return a list."); 69 69 return 1; 70 70 } 71 71 72 72 if (list->head != NULL || list->tail != NULL) { 73 psError( __func__,"head and/or tail was not NULL for empty list.");73 psError(PS_ERR_UNKNOWN, true,"head and/or tail was not NULL for empty list."); 74 74 return 2; 75 75 } 76 76 77 77 if (list->size != 0) { 78 psError( __func__,"size of list wasn't zero for empty list.");78 psError(PS_ERR_UNKNOWN, true,"size of list wasn't zero for empty list."); 79 79 return 3; 80 80 } … … 84 84 list = psListAlloc(data); 85 85 if (list == NULL) { 86 psError( __func__,"psListAlloc failed to return a list.");86 psError(PS_ERR_UNKNOWN, true,"psListAlloc failed to return a list."); 87 87 return 4; 88 88 } 89 89 90 90 if (list->head == NULL || list->tail == NULL) { 91 psError( __func__,"head and/or tail was NULL for one-element new list.");91 psError(PS_ERR_UNKNOWN, true,"head and/or tail was NULL for one-element new list."); 92 92 return 5; 93 93 } 94 94 95 95 if (list->head->data != data || list->tail->data != data) { 96 psError( __func__,"head and/or tail didn't point to data's node for one-element new list.");96 psError(PS_ERR_UNKNOWN, true,"head and/or tail didn't point to data's node for one-element new list."); 97 97 return 6; 98 98 } 99 99 100 100 if (list->size != 1) { 101 psError( __func__,"size of list wasn't correctly set for new, one-element list.");101 psError(PS_ERR_UNKNOWN, true,"size of list wasn't correctly set for new, one-element list."); 102 102 return 7; 103 103 } … … 105 105 ref = psMemGetRefCounter(data); 106 106 if (ref != 2) { 107 psError( __func__,"psList didn't increment reference count of data (%d.",ref);107 psError(PS_ERR_UNKNOWN, true,"psList didn't increment reference count of data (%d.",ref); 108 108 return 8; 109 109 } … … 139 139 // 1. list is NULL (error) 140 140 if (psListAdd(NULL,PS_LIST_HEAD,data)) { 141 psError( __func__,"psListAdd was given a NULL list, but returned a true/success.");141 psError(PS_ERR_UNKNOWN, true,"psListAdd was given a NULL list, but returned a true/success."); 142 142 return 1; 143 143 } … … 146 146 psFree(data); 147 147 if (list->size != 1) { 148 psError( __func__,"psListAlloc didn't create a list properly.");148 psError(PS_ERR_UNKNOWN, true,"psListAlloc didn't create a list properly."); 149 149 return 2; 150 150 } … … 152 152 // 2. data is NULL (error, list should not grow) 153 153 if (psListAdd(list, PS_LIST_HEAD,NULL)) { 154 psError( __func__,"psListAdd successfully added a NULL data item?");154 psError(PS_ERR_UNKNOWN, true,"psListAdd successfully added a NULL data item?"); 155 155 return 40; 156 156 } 157 157 if ( list->size != 1) { 158 psError( __func__,"psListAdd with a NULL data element changed the list size or returned success.");158 psError(PS_ERR_UNKNOWN, true,"psListAdd with a NULL data element changed the list size or returned success."); 159 159 return 3; 160 160 } … … 164 164 *data = 2; 165 165 if ( ! psListAdd(list,PS_LIST_HEAD,data) ) { 166 psError( __func__,"psListAdd failed to add a data item to head.");166 psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add a data item to head."); 167 167 return 21; 168 168 } 169 169 170 170 if (psMemGetRefCounter(data) != 2) { 171 psError( __func__,"psListAdd didn't increment the data reference count.");171 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count."); 172 172 return 20; 173 173 } … … 176 176 // verify that the size incremented 177 177 if (list->size != 2) { 178 psError( __func__,"psListAdd didn't increment the size by one");178 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by one"); 179 179 return 4; 180 180 } … … 182 182 // verify that the head is the inserted data item 183 183 if (*(psS32*)list->head->data != 2) { 184 psError( __func__,"psListAdd with PS_LIST_HEAD didn't insert at the head.");184 psError(PS_ERR_UNKNOWN, true,"psListAdd with PS_LIST_HEAD didn't insert at the head."); 185 185 return 5; 186 186 } … … 189 189 *data = 3; 190 190 if ( ! psListAdd(list,PS_LIST_TAIL,data) ) { 191 psError( __func__,"psListAdd failed to add a data item to tail.");191 psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add a data item to tail."); 192 192 return 21; 193 193 } 194 194 195 195 if (psMemGetRefCounter(data) != 2) { 196 psError( __func__,"psListAdd didn't increment the data reference count.");196 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count."); 197 197 return 22; 198 198 } … … 200 200 // verify that the size incremented 201 201 if (list->size != 3) { 202 psError( __func__,"psListAdd didn't increment the size by 1");202 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by 1"); 203 203 return 6; 204 204 } … … 206 206 // verify that the head is still the same 207 207 if (*(psS32*)list->head->data != 2) { 208 psError( __func__,"psListAdd with PS_LIST_TAIL modified the head.");208 psError(PS_ERR_UNKNOWN, true,"psListAdd with PS_LIST_TAIL modified the head."); 209 209 return 7; 210 210 } … … 212 212 // verify that the tail is the data item inserted 213 213 if (*(psS32*)list->tail->data != 3) { 214 psError( __func__,"psListAdd with PS_LIST_TAIL didn't insert at the tail.");214 psError(PS_ERR_UNKNOWN, true,"psListAdd with PS_LIST_TAIL didn't insert at the tail."); 215 215 return 8; 216 216 } … … 223 223 224 224 if ( psListAdd(list,-10,data) ) { 225 psError( __func__,"psListAdd successfully added data to a -10 position?");225 psError(PS_ERR_UNKNOWN, true,"psListAdd successfully added data to a -10 position?"); 226 226 return 30; 227 227 } 228 228 if (psMemGetRefCounter(data) != 1) { 229 psError( __func__,"psListAdd incremented the data reference count.");229 psError(PS_ERR_UNKNOWN, true,"psListAdd incremented the data reference count."); 230 230 return 24; 231 231 } … … 234 234 if (list->size != 3) { 235 235 printListInt(list); 236 psError( __func__,"psListAdd didn't insert to head when where was invalid.");236 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to head when where was invalid."); 237 237 return 9; 238 238 } … … 243 243 244 244 if ( ! psListAdd(list,1,data) ) { 245 psError( __func__,"psListAdd failed to add data to 1 position.");245 psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to 1 position."); 246 246 return 30; 247 247 } 248 248 249 249 if (psMemGetRefCounter(data) != 2) { 250 psError( __func__,"psListAdd didn't increment the data reference count.");250 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count."); 251 251 return 25; 252 252 } … … 255 255 if (list->size != 4 || *(psS32*)list->head->next->data != 5) { 256 256 printListInt(list); 257 psError( __func__,"psListAdd didn't insert to position #1.");257 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #1."); 258 258 return 10; 259 259 } … … 262 262 *data = 6; 263 263 if ( ! psListAdd(list,3,data) ) { 264 psError( __func__,"psListAdd failed to add data to 4 position.");264 psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to 4 position."); 265 265 return 31; 266 266 } 267 267 if (psMemGetRefCounter(data) != 2) { 268 psError( __func__,"psListAdd didn't increment the data reference count.");268 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count."); 269 269 return 26; 270 270 } … … 273 273 if (list->size != 5 || *(psS32 *)list->head->next->next->next->data != 6) { 274 274 printListInt(list); 275 psError( __func__,"psListAdd didn't insert to position #4.");275 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #4."); 276 276 return 50; 277 277 } … … 280 280 *data = 7; 281 281 if ( ! psListAdd(list,2,data) ) { 282 psError( __func__,"psListAdd failed to add data to 2 position.");282 psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to 2 position."); 283 283 return 32; 284 284 } 285 285 if (psMemGetRefCounter(data) != 2) { 286 psError( __func__,"psListAdd didn't increment the data reference count.");286 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count."); 287 287 return 28; 288 288 } … … 291 291 if (list->size != 6 || *(psS32 *)list->head->next->next->data != 7) { 292 292 printListInt(list); 293 psError( __func__,"psListAdd didn't insert to position #2.");293 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #2."); 294 294 return 11; 295 295 } … … 300 300 301 301 if ( ! psListAdd(list,9,data) ) { 302 psError( __func__,"psListAdd failed to add data to a 9 position?");302 psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to a 9 position?"); 303 303 return 30; 304 304 } 305 305 306 306 if (psMemGetRefCounter(data) != 2) { 307 psError( __func__,"psListAdd didn't increment the data reference count.");307 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count."); 308 308 return 29; 309 309 } … … 314 314 if (list->size != 7) { 315 315 printListInt(list); 316 psError( __func__,"psListAdd didn't insert to position #9.");316 psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #9."); 317 317 return 12; 318 318 } … … 366 366 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error"); 367 367 if (psListGet(list,PS_LIST_HEAD) != NULL) { 368 psError( __func__,"psListGet didn't return NULL given a NULL list.");368 psError(PS_ERR_UNKNOWN, true,"psListGet didn't return NULL given a NULL list."); 369 369 return 1; 370 370 }; … … 394 394 data = (psS32*)psListGet(list,3); 395 395 if (data == NULL || *data != 3) { 396 psError( __func__,"psListGet failed with which=3");396 psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=3"); 397 397 return 2; 398 398 } 399 399 data = (psS32*)psListGet(list,1); 400 400 if (data == NULL || *data != 1) { 401 psError( __func__,"psListGet failed with which=1");401 psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=1"); 402 402 return 3; 403 403 } … … 406 406 data = (psS32*)psListGet(list,5); 407 407 if (data != NULL) { 408 psError( __func__,"psListGet failed with which=5");408 psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=5"); 409 409 return 4; 410 410 } 411 411 data = (psS32*)psListGet(list,4); 412 412 if (data != NULL) { 413 psError( __func__,"psListGet failed with which=4");413 psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=4"); 414 414 return 5; 415 415 } … … 418 418 data = (psS32*)psListGet(list,PS_LIST_HEAD); 419 419 if (data == NULL || *data != 0) { 420 psError( __func__,"psListGet failed with which=PS_LIST_HEAD");420 psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=PS_LIST_HEAD"); 421 421 return 6; 422 422 } … … 425 425 data = (psS32*)psListGet(list,PS_LIST_NEXT); 426 426 if (data == NULL || *data != 1) { 427 psError( __func__,"psListGet failed with which=PS_LIST_NEXT");427 psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=PS_LIST_NEXT"); 428 428 return 7; 429 429 } … … 432 432 data = (psS32*)psListGet(list,PS_LIST_TAIL); 433 433 if (data == NULL || *data != 3) { 434 psError( __func__,"psListGet failed with which=PS_LIST_TAIL");434 psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=PS_LIST_TAIL"); 435 435 return 8; 436 436 } … … 439 439 data = (psS32*)psListGet(list,PS_LIST_PREVIOUS); 440 440 if (data == NULL || *data != 2) { 441 psError( __func__,"psListGet failed with which=PS_LIST_PREV");441 psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=PS_LIST_PREV"); 442 442 return 9; 443 443 } … … 473 473 psLogMsg(__func__,PS_LOG_INFO,"Following should be an error"); 474 474 if (psListRemove(list,PS_LIST_HEAD,NULL)) { 475 psError( __func__,"psListRemove didn't return false given a NULL list.");475 psError(PS_ERR_UNKNOWN, true,"psListRemove didn't return false given a NULL list."); 476 476 return 1; 477 477 }; … … 493 493 (psListGet(list,PS_LIST_HEAD) == data) ) { 494 494 printListInt(list); 495 psError( __func__,"Failed to remove PS_LIST_HEAD");495 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_HEAD"); 496 496 return 1; 497 497 } … … 499 499 if (list->size != 14) { 500 500 printListInt(list); 501 psError( __func__,"Didn't decrement size properly to 14.");501 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 14."); 502 502 return 1; 503 503 } … … 508 508 (psListGet(list,PS_LIST_TAIL) == data) ) { 509 509 printListInt(list); 510 psError( __func__,"Failed to remove PS_LIST_TAIL");510 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_TAIL"); 511 511 return 1; 512 512 } … … 514 514 if (list->size != 13) { 515 515 printListInt(list); 516 psError( __func__,"Didn't decrement size properly to 13.");516 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 13."); 517 517 return 1; 518 518 } … … 522 522 if (! psListRemove(list,PS_LIST_NEXT,NULL)) { 523 523 printListInt(list); 524 psError( __func__,"Failed to remove PS_LIST_NEXT @ PS_LIST_HEAD");524 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_NEXT @ PS_LIST_HEAD"); 525 525 return 1; 526 526 } … … 528 528 if (list->size != 12) { 529 529 printListInt(list); 530 psError( __func__,"Didn't decrement size properly to 12.");530 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 12."); 531 531 return 1; 532 532 } … … 536 536 if (psListRemove(list,PS_LIST_NEXT,NULL)) { 537 537 printListInt(list); 538 psError( __func__,"Removed something with PS_LIST_NEXT @ PS_LIST_TAIL");538 psError(PS_ERR_UNKNOWN, true,"Removed something with PS_LIST_NEXT @ PS_LIST_TAIL"); 539 539 return 1; 540 540 } … … 545 545 ( psListGet(list,3) == data) ) { 546 546 printListInt(list); 547 psError( __func__,"Failed to remove PS_LIST_NEXT @ which=2");547 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_NEXT @ which=2"); 548 548 return 1; 549 549 } … … 551 551 if (list->size != 11) { 552 552 printListInt(list); 553 psError( __func__,"Didn't decrement size properly to 11.");553 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 11."); 554 554 return 1; 555 555 } … … 560 560 if (psListRemove(list,PS_LIST_PREVIOUS,NULL)) { 561 561 printListInt(list); 562 psError( __func__,"removed something for PS_LIST_PREVIOUS @ PS_LIST_HEAD");562 psError(PS_ERR_UNKNOWN, true,"removed something for PS_LIST_PREVIOUS @ PS_LIST_HEAD"); 563 563 return 1; 564 564 } … … 569 569 (psListGet(list,9) == data) ) { 570 570 printListInt(list); 571 psError( __func__,"Failed to remove PS_LIST_PREVIOUS @ PS_LIST_TAIL");571 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_PREVIOUS @ PS_LIST_TAIL"); 572 572 return 1; 573 573 } … … 575 575 if (list->size != 10) { 576 576 printListInt(list); 577 psError( __func__,"Didn't decrement size properly to 10.");577 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 10."); 578 578 return 1; 579 579 } … … 584 584 ( psListGet(list,1) == data) ) { 585 585 printListInt(list); 586 psError( __func__,"Failed to remove PS_LIST_PREVIOUS @ which=2");586 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_PREVIOUS @ which=2"); 587 587 return 1; 588 588 } … … 590 590 if (list->size != 9) { 591 591 printListInt(list); 592 psError( __func__,"Didn't decrement size properly to 9.");592 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 9."); 593 593 return 1; 594 594 } … … 598 598 if (psListRemove(list,PS_LIST_UNKNOWN,NULL)) { 599 599 printListInt(list); 600 psError( __func__,"removed something for PS_LIST_UNKNOWN with data=NULL");600 psError(PS_ERR_UNKNOWN, true,"removed something for PS_LIST_UNKNOWN with data=NULL"); 601 601 return 1; 602 602 } … … 607 607 (psListGet(list,PS_LIST_HEAD) == data) ) { 608 608 printListInt(list); 609 psError( __func__,"Failed to remove PS_LIST_UNKNOWN @ PS_LIST_HEAD");609 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_UNKNOWN @ PS_LIST_HEAD"); 610 610 return 1; 611 611 } … … 613 613 if (list->size != 8) { 614 614 printListInt(list); 615 psError( __func__,"Didn't decrement size properly to 8.");615 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 8."); 616 616 return 1; 617 617 } … … 621 621 (psListGet(list,PS_LIST_TAIL) == data) ) { 622 622 printListInt(list); 623 psError( __func__,"Failed to remove PS_LIST_UNKNOWN @ PS_LIST_TAIL");623 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_UNKNOWN @ PS_LIST_TAIL"); 624 624 return 1; 625 625 } … … 627 627 if (list->size != 7) { 628 628 printListInt(list); 629 psError( __func__,"Didn't decrement size properly to 7.");629 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 7."); 630 630 return 1; 631 631 } … … 637 637 (psListGet(list,1) == data) ) { 638 638 printListInt(list); 639 psError( __func__,"Failed to remove PS_LIST_UNKNOWN @ which=1");639 psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_UNKNOWN @ which=1"); 640 640 return 1; 641 641 } … … 643 643 if (list->size != 6) { 644 644 printListInt(list); 645 psError( __func__,"Didn't decrement size properly to 6.");645 psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to 6."); 646 646 return 1; 647 647 } … … 651 651 if ( psListRemove(list,PS_LIST_UNKNOWN,data) ) { 652 652 printListInt(list); 653 psError( __func__,"removed something for PS_LIST_UNKNOWN with previously removed item");653 psError(PS_ERR_UNKNOWN, true,"removed something for PS_LIST_UNKNOWN with previously removed item"); 654 654 return 1; 655 655 } … … 666 666 (psListGet(list,PS_LIST_HEAD) == data) ) { 667 667 printListInt(list); 668 psError( __func__,"Failed to remove last element");668 psError(PS_ERR_UNKNOWN, true,"Failed to remove last element"); 669 669 return 1; 670 670 } … … 672 672 if (list->size != 0) { 673 673 printListInt(list); 674 psError( __func__,"Didn't remove all the elements.");674 psError(PS_ERR_UNKNOWN, true,"Didn't remove all the elements."); 675 675 return 1; 676 676 } … … 709 709 710 710 if (arr->n != 15 || list->size != 15) { 711 psError( __func__,"The created array didn't have the proper size");711 psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size"); 712 712 return 1; 713 713 } 714 714 for (psS32 i=0;i<arr->n;i++) { 715 715 if (i != *(psS32*)arr->data[i]) { 716 psError( __func__,"Element %d of array is incorrect (%d).",716 psError(PS_ERR_UNKNOWN, true,"Element %d of array is incorrect (%d).", 717 717 i,*(psS32*)arr->data[i]); 718 718 return 1; 719 719 } 720 720 if (i != *(psS32*)psListGet(list,i)) { 721 psError( __func__,"Element %d of list is incorrect (%d).",721 psError(PS_ERR_UNKNOWN, true,"Element %d of list is incorrect (%d).", 722 722 i,*(psS32*)arr->data[i]); 723 723 return 1; 724 724 } 725 725 if (psMemGetRefCounter(arr->data[i]) != 2) { 726 psError( __func__,"Element %d had wrong reference count (%d).",726 psError(PS_ERR_UNKNOWN, true,"Element %d had wrong reference count (%d).", 727 727 i,psMemGetRefCounter(arr->data[i])); 728 728 return 1; … … 747 747 748 748 if (arr->n != 15 || list->size != 15) { 749 psError( __func__,"The created array didn't have the proper size");749 psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size"); 750 750 return 1; 751 751 } 752 752 for (psS32 i=0;i<arr->n;i++) { 753 753 if (i != *(psS32*)arr->data[i]) { 754 psError( __func__,"Element %d of array is incorrect (%d).",754 psError(PS_ERR_UNKNOWN, true,"Element %d of array is incorrect (%d).", 755 755 i,*(psS32*)arr->data[i]); 756 756 return 1; 757 757 } 758 758 if (i != *(psS32*)psListGet(list,i)) { 759 psError( __func__,"Element %d of list is incorrect (%d).",759 psError(PS_ERR_UNKNOWN, true,"Element %d of list is incorrect (%d).", 760 760 i,*(psS32*)arr->data[i]); 761 761 return 1; 762 762 } 763 763 if (psMemGetRefCounter(arr->data[i]) != 2) { 764 psError( __func__,"Element %d had wrong reference count (%d).",764 psError(PS_ERR_UNKNOWN, true,"Element %d had wrong reference count (%d).", 765 765 i,psMemGetRefCounter(arr->data[i])); 766 766 return 1; … … 775 775 arr = psListToArray(NULL); 776 776 if (arr != NULL) { 777 psError( __func__,"psListToArray didn't return NULL when given NULL");777 psError(PS_ERR_UNKNOWN, true,"psListToArray didn't return NULL when given NULL"); 778 778 return 1; 779 779 } … … 781 781 list = psArrayToList(NULL); 782 782 if (list != NULL) { 783 psError( __func__,"psArrayToList didn't return NULL when given NULL");783 psError(PS_ERR_UNKNOWN, true,"psArrayToList didn't return NULL when given NULL"); 784 784 return 1; 785 785 } … … 790 790 list = psArrayToList(arr); 791 791 if (list == NULL) { 792 psError( __func__,"psArrayToList didn't create an empty list from an "792 psError(PS_ERR_UNKNOWN, true,"psArrayToList didn't create an empty list from an " 793 793 "empty array."); 794 794 return 1; … … 800 800 arr = psListToArray(list); 801 801 if (arr == NULL) { 802 psError( __func__,"psArrayToList didn't create an empty array from an "802 psError(PS_ERR_UNKNOWN, true,"psArrayToList didn't create an empty array from an " 803 803 "empty list."); 804 804 return 1; … … 853 853 psListSetIterator(list,PS_LIST_TAIL); 854 854 if (*(psS32*)psListGetCurrent(list) != 14) { 855 psError( __func__,"Didn't successfully move cursor to tail.");855 psError(PS_ERR_UNKNOWN, true,"Didn't successfully move cursor to tail."); 856 856 return 1; 857 857 } … … 860 860 psListSetIterator(list,PS_LIST_HEAD); 861 861 if (*(psS32*)psListGetCurrent(list) != 0) { 862 psError( __func__,"Didn't successfully move cursor to head.");862 psError(PS_ERR_UNKNOWN, true,"Didn't successfully move cursor to head."); 863 863 return 2; 864 864 } … … 867 867 psListSetIterator(list,PS_LIST_NEXT); 868 868 if (*(psS32*)psListGetCurrent(list) != 1) { 869 psError( __func__,"Didn't successfully move cursor to next.");869 psError(PS_ERR_UNKNOWN, true,"Didn't successfully move cursor to next."); 870 870 return 3; 871 871 } 872 872 psListSetIterator(list,PS_LIST_NEXT); 873 873 if (*(psS32*)psListGetCurrent(list) != 2) { 874 psError( __func__,"Didn't successfully move cursor to next twice.");874 psError(PS_ERR_UNKNOWN, true,"Didn't successfully move cursor to next twice."); 875 875 return 4; 876 876 } … … 879 879 psListSetIterator(list,PS_LIST_PREVIOUS); 880 880 if (*(psS32*)psListGetCurrent(list) != 1) { 881 psError( __func__,"Didn't successfully move cursor to previous.");881 psError(PS_ERR_UNKNOWN, true,"Didn't successfully move cursor to previous."); 882 882 return 5; 883 883 } 884 884 psListSetIterator(list,PS_LIST_PREVIOUS); 885 885 if (*(psS32*)psListGetCurrent(list) != 0) { 886 psError( __func__,"Didn't successfully move cursor to previous twice.");886 psError(PS_ERR_UNKNOWN, true,"Didn't successfully move cursor to previous twice."); 887 887 return 6; 888 888 } … … 893 893 psListSetIterator(list,PS_LIST_UNKNOWN); 894 894 if (*(psS32*)psListGetCurrent(list) != 1) { 895 psError( __func__,"PS_LIST_UNKNOWN moved cursor.");895 psError(PS_ERR_UNKNOWN, true,"PS_LIST_UNKNOWN moved cursor."); 896 896 return 7; 897 897 } 898 898 psListSetIterator(list,PS_LIST_CURRENT); 899 899 if (*(psS32*)psListGetCurrent(list) != 1) { 900 psError( __func__,"PS_LIST_CURRENT moved cursor.");900 psError(PS_ERR_UNKNOWN, true,"PS_LIST_CURRENT moved cursor."); 901 901 return 8; 902 902 } … … 904 904 // test psListGetPrevious/Next 905 905 if (*(psS32*)psListGetNext(list) != 2) { 906 psError( __func__,"psListGetNext didn't move cursor to next.");906 psError(PS_ERR_UNKNOWN, true,"psListGetNext didn't move cursor to next."); 907 907 return 9; 908 908 } 909 909 if (*(psS32*)psListGetNext(list) != 3) { 910 psError( __func__,"psListGetNext didn't move cursor to next.");910 psError(PS_ERR_UNKNOWN, true,"psListGetNext didn't move cursor to next."); 911 911 return 10; 912 912 } 913 913 if (*(psS32*)psListGetPrevious(list) != 2) { 914 psError( __func__,"psListGetPrevious didn't move cursor to previous.");914 psError(PS_ERR_UNKNOWN, true,"psListGetPrevious didn't move cursor to previous."); 915 915 return 11; 916 916 } 917 917 if (*(psS32*)psListGetPrevious(list) != 1) { 918 psError( __func__,"psListGetPrevious didn't move cursor to previous.");918 psError(PS_ERR_UNKNOWN, true,"psListGetPrevious didn't move cursor to previous."); 919 919 return 12; 920 920 } 921 921 if (*(psS32*)psListGetPrevious(list) != 0) { 922 psError( __func__,"psListGetPrevious didn't move cursor to previous..");922 psError(PS_ERR_UNKNOWN, true,"psListGetPrevious didn't move cursor to previous.."); 923 923 return 13; 924 924 } 925 925 if (psListGetPrevious(list) != NULL) { 926 psError( __func__,"psListGetPrevious moved cursor beyond head.");926 psError(PS_ERR_UNKNOWN, true,"psListGetPrevious moved cursor beyond head."); 927 927 return 14; 928 928 } … … 930 930 psListSetIterator(list,PS_LIST_TAIL); // works according to an above test 931 931 if (psListGetNext(list) != NULL) { 932 psError( __func__,"psListGetNext moved cursor beyond tail.");932 psError(PS_ERR_UNKNOWN, true,"psListGetNext moved cursor beyond tail."); 933 933 return 15; 934 934 } … … 959 959 psListAdd(list,PS_LIST_TAIL,data[lcv]); 960 960 if (psMemGetRefCounter(data[lcv]) != 2) { 961 psError( __func__,"Reference counter for data was not incremented");961 psError(PS_ERR_UNKNOWN, true,"Reference counter for data was not incremented"); 962 962 return 1; 963 963 } … … 969 969 */ 970 970 if (list->size != 15) { 971 psError( __func__,"List wasn't populated as expected?");971 psError(PS_ERR_UNKNOWN, true,"List wasn't populated as expected?"); 972 972 return 2; 973 973 } … … 989 989 for (psS32 i=0;i<15;i++) { 990 990 if (psMemGetRefCounter(data[i]) != 1) { 991 psError( __func__,"pslistFree didn't decrement the data item's reference counter");991 psError(PS_ERR_UNKNOWN, true,"pslistFree didn't decrement the data item's reference counter"); 992 992 return 3; 993 993 } … … 1039 1039 iter = psListGet(list,PS_LIST_NEXT)) { 1040 1040 if (*prevValue > *iter) { 1041 psError( __func__,"Hey, the list wasn't sorted!?");1041 psError(PS_ERR_UNKNOWN, true,"Hey, the list wasn't sorted!?"); 1042 1042 return 1; 1043 1043 } … … 1059 1059 iter = psListGet(list,PS_LIST_NEXT)) { 1060 1060 if (*prevValue < *iter) { 1061 psError( __func__,"Hey, the list wasn't sorted!?");1061 psError(PS_ERR_UNKNOWN, true,"Hey, the list wasn't sorted!?"); 1062 1062 return 1; 1063 1063 } … … 1105 1105 iter = psListGet(list,PS_LIST_NEXT)) { 1106 1106 if (*prev > *iter) { 1107 psError( __func__,"Hey, the list wasn't sorted!?");1107 psError(PS_ERR_UNKNOWN, true,"Hey, the list wasn't sorted!?"); 1108 1108 return 1; 1109 1109 } … … 1125 1125 iter = psListGet(list,PS_LIST_NEXT)) { 1126 1126 if (*prev < *iter) { 1127 psError( __func__,"Hey, the list wasn't sorted!?");1127 psError(PS_ERR_UNKNOWN, true,"Hey, the list wasn't sorted!?"); 1128 1128 return 1; 1129 1129 } -
trunk/psLib/test/collections/tst_psMetadata_01.c
r2204 r2273 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $20 * @date $Date: 2004-1 0-27 00:57:33$19 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-11-04 01:05:00 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 227 227 metadata1 = psMetadataReadHeader(metadata1, NULL, 22, "header_2.fits"); 228 228 if (metadata1 != NULL ) { 229 psError( __func__,"psMetadataReadHeader did not return null when invalid ext given.");229 psError(PS_ERR_UNKNOWN, true,"psMetadataReadHeader did not return null when invalid ext given."); 230 230 return 10; 231 231 } … … 238 238 metadata1 = psMetadataReadHeader(NULL, "AARGH", -1, "header_2.fits"); 239 239 if (metadata1 != NULL ) { 240 psError( __func__,"psMetadataReadHeader did not return null invalid extname give.");240 psError(PS_ERR_UNKNOWN, true,"psMetadataReadHeader did not return null invalid extname give."); 241 241 return 11; 242 242 } … … 249 249 metadata1 = psMetadataReadHeader(NULL, "MY_DATA_2", 0, "header_2.fits"); 250 250 if (metadata1 != NULL ) { 251 psError( __func__,"psMetadataReadHeader did not return null w/ valid extname, invalid extnum");251 psError(PS_ERR_UNKNOWN, true,"psMetadataReadHeader did not return null w/ valid extname, invalid extnum"); 252 252 return 12; 253 253 } -
trunk/psLib/test/collections/tst_psMetadata_02.c
r2204 r2273 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-1 0-27 00:57:33$16 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-11-04 01:05:00 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 92 92 badItem = psMetadataItemAlloc(NULL, PS_META_STR, "I am a string", "HELLO WORLD"); 93 93 if (badItem != NULL) { 94 psError( __func__,"psMetadataItemAlloc did not return null with null name item.");94 psError(PS_ERR_UNKNOWN, true,"psMetadataItemAlloc did not return null with null name item."); 95 95 return 10; 96 96 } -
trunk/psLib/test/collections/tst_psMetadata_03.c
r2204 r2273 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-1 0-27 00:57:33$16 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-11-04 01:05:00 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 91 91 printPositiveTestHeader(stdout, "psMetadata", "Test B - Remove items from metadata by name"); 92 92 if( ! psMetadataAddItem(metadata, item1, PS_LIST_HEAD) ) { 93 psError( __func__,"psMetadataAddItem did not return true when adding by name.");93 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name."); 94 94 return 10; 95 95 } 96 96 if( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2",PS_META_S32,"I am S32 integer",77) ) { 97 psError( __func__,"psMetadataAddItem did not return true when adding by name.");97 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name."); 98 98 return 11; 99 99 } 100 100 if ( ! psMetadataRemove(metadata, 0, "myItem1" ) ) { 101 psError( __func__,"psMetadataRemove did not return true when removing by name.");101 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return true when removing by name."); 102 102 return 12; 103 103 } 104 104 if ( ! psMetadataRemove(metadata, 0, "myItem2" ) ) { 105 psError( __func__,"psMetadataRemove did not return true when removing by name.");105 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return true when removing by name."); 106 106 return 13; 107 107 } … … 112 112 printPositiveTestHeader(stdout, "psMetadata", "Test C - Remove items from metadata by index"); 113 113 if ( ! psMetadataAddItem(metadata, item3, PS_LIST_HEAD) ) { 114 psError( __func__,"psMetadataAddItem did not return true when adding by index.");114 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index."); 115 115 return 14; 116 116 } 117 117 if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4",PS_META_S32,"I am S32 integer",88) ) { 118 psError( __func__,"psMetadataAddItem did not return true when adding by index.");118 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index."); 119 119 return 15; 120 120 } 121 121 if( ! psMetadataRemove(metadata, 0, NULL) ) { 122 psError( __func__,"psMetadataRemove did not return true when removing by index.");122 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return true when removing by index."); 123 123 return 16; 124 124 } 125 125 if ( ! psMetadataRemove(metadata, 0, NULL ) ) { 126 psError( __func__,"psMetadataRemove did not return true when removing by index.");126 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return true when removing by index."); 127 127 return 17; 128 128 } … … 134 134 "Null metadata collection not allowed", 0); 135 135 if ( psMetadataRemove(NULL, 0, NULL) ) { 136 psError( __func__,"psMetadataRemove did not return false when removing from null metadata.");136 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false when removing from null metadata."); 137 137 return 18; 138 138 } … … 144 144 "Couldn't find metadata item. Name: AARGH", 0); 145 145 if( psMetadataRemove(metadata, 0, "AARGH") ) { 146 psError( __func__,"psMetadataRemove did not return false when removing non-existant item.");146 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false when removing non-existant item."); 147 147 return 19; 148 148 } … … 154 154 "Couldn't find metadata item in list. Index: 22", 0); 155 155 if( psMetadataRemove(metadata, 22, NULL) ) { 156 psError( __func__,"psMetadataRemove did not return false when removing non-existant item.");156 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false when removing non-existant item."); 157 157 return 20; 158 158 } … … 167 167 errMetadata->table = NULL; 168 168 if ( psMetadataAddItem(errMetadata, item3, PS_LIST_HEAD) ) { 169 psError( __func__,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table.");169 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table."); 170 170 return 21; 171 171 } 172 172 if ( psMetadataRemove(errMetadata, PS_LIST_HEAD, "errItem") ) { 173 psError( __func__,"psMetadataRemove did not return false w/ invalid metadata struct w/o hash table.");173 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false w/ invalid metadata struct w/o hash table."); 174 174 return 31; 175 175 } … … 183 183 errMetadata->list = NULL; 184 184 if ( psMetadataAddItem(errMetadata, item3, PS_LIST_HEAD) ) { 185 psError( __func__,"psMetadataAddItem did not return false w/ invalid metadata struct w/o link list.");185 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o link list."); 186 186 return 22; 187 187 } 188 188 if ( psMetadataRemove(errMetadata, PS_LIST_HEAD, "errItem") ) { 189 psError( __func__,"psMetadataRemove did not return false w/ invalid metadata struct w/o link list.");189 psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false w/ invalid metadata struct w/o link list."); 190 190 return 32; 191 191 } … … 199 199 errItem->name = NULL; 200 200 if ( psMetadataAddItem(errMetadata, errItem, PS_LIST_HEAD) ) { 201 psError( __func__,"psMetadataAddItem did not return false with item with null name.");201 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false with item with null name."); 202 202 return 23; 203 203 } … … 211 211 errMetadata->table = NULL; 212 212 if ( psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_META_S32,"Integer",22) ) { 213 psError( __func__,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table.");213 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table."); 214 214 return 24; 215 215 } … … 227 227 psFree(errMetadata); 228 228 if( psMemCheckLeaks(0, NULL, stdout) != 0 ) { 229 psError( __func__,"Memory leaks detected.");229 psError(PS_ERR_UNKNOWN, true,"Memory leaks detected."); 230 230 return 25; 231 231 } -
trunk/psLib/test/collections/tst_psMetadata_04.c
r2204 r2273 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $21 * @date $Date: 2004-1 0-27 00:57:33$20 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2004-11-04 01:05:00 $ 22 22 * 23 23 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 108 108 "Null metadata collection not allowed", 0); 109 109 if ( psMetadataLookup(NULL, "myItem2") != NULL ) { 110 psError( __func__,"psMetadataLookup did not return NULL with null metadata.");110 psError(PS_ERR_UNKNOWN, true,"psMetadataLookup did not return NULL with null metadata."); 111 111 return 11; 112 112 } … … 118 118 "Null key name not allowed", 0); 119 119 if ( psMetadataLookup(metadata, NULL) != NULL ) { 120 psError( __func__,"psMetadata did not return NULL with null key.");120 psError(PS_ERR_UNKNOWN, true,"psMetadata did not return NULL with null key."); 121 121 return 12; 122 122 } … … 128 128 "Couldn't find metadata item. Name: AARGH", 0); 129 129 if ( psMetadataLookup(metadata, "AARGH") != NULL ) { 130 psError( __func__,"psMetadata did not return NULL with a non-existant item.");130 psError(PS_ERR_UNKNOWN, true,"psMetadata did not return NULL with a non-existant item."); 131 131 return 13; 132 132 } … … 150 150 item = psMetadataGet(NULL, 0); 151 151 if ( item != NULL ) { 152 psError( __func__,"psMetadataGet did not return NULL with null metadata structure.");152 psError(PS_ERR_UNKNOWN, true,"psMetadataGet did not return NULL with null metadata structure."); 153 153 return 15; 154 154 } … … 160 160 "Couldn't find metadata item with given index. Index: 22", 0); 161 161 if ( psMetadataGet(metadata, 22) != NULL ) { 162 psError( __func__,"psMetadataGet did not return NULL with non-existant metadata item.");162 psError(PS_ERR_UNKNOWN, true,"psMetadataGet did not return NULL with non-existant metadata item."); 163 163 return 16; 164 164 } … … 171 171 metadata->table = NULL; 172 172 if ( psMetadataLookup(metadata,"myItem2") != NULL ) { 173 psError( __func__,"psMetadataLookup did not return null for invalid metadata object.");173 psError(PS_ERR_UNKNOWN, true,"psMetadataLookup did not return null for invalid metadata object."); 174 174 return 20; 175 175 } … … 183 183 metadata->list = NULL; 184 184 if ( psMetadataGet(metadata,0) != NULL ) { 185 psError( __func__,"psMetadataLookup did not return null for invalid metadata object.");185 psError(PS_ERR_UNKNOWN, true,"psMetadataLookup did not return null for invalid metadata object."); 186 186 return 20; 187 187 } … … 197 197 psFree(item4); 198 198 if ( psMemCheckLeaks(0, NULL, stdout) != 0 ) { 199 psError( __func__,"memory leaks detected.");199 psError(PS_ERR_UNKNOWN, true,"memory leaks detected."); 200 200 return 20; 201 201 } -
trunk/psLib/test/collections/tst_psMetadata_05.c
r2204 r2273 22 22 * @author Ross Harman, MHPCC 23 23 * 24 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $25 * @date $Date: 2004-1 0-27 00:57:33$24 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2004-11-04 01:05:00 $ 26 26 * 27 27 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 145 145 } 146 146 if( psMetadataGetPrevious(metadata,"myItem3",1) == NULL) { 147 psError( __func__,"psMetadataGetPrevious did not return an item from metadata.");147 psError(PS_ERR_UNKNOWN, true,"psMetadataGetPrevious did not return an item from metadata."); 148 148 return 45; 149 149 } … … 151 151 metadata->list = NULL; 152 152 if ( psMetadataGetPrevious(metadata,NULL,1) != NULL) { 153 psError( __func__,"psMetadataGetPrevious did not return null for invalid metadata.");153 psError(PS_ERR_UNKNOWN, true,"psMetadataGetPrevious did not return null for invalid metadata."); 154 154 return 50; 155 155 } … … 213 213 "Null metadata collection not allowed", 0); 214 214 if( psMetadataGetNext(NULL, "myItem2", 0) != NULL ) { 215 psError( __func__,"psMetadataGetNext did not return null for null metadata.");215 psError(PS_ERR_UNKNOWN, true,"psMetadataGetNext did not return null for null metadata."); 216 216 return 40; 217 217 } … … 219 219 metadata->list = NULL; 220 220 if ( psMetadataGetNext(metadata, "myItem2", 0) != NULL ) { 221 psError( __func__,"psMetadataGetNext did not return null for invalid metadata.");221 psError(PS_ERR_UNKNOWN, true,"psMetadataGetNext did not return null for invalid metadata."); 222 222 return 41; 223 223 } … … 267 267 psFree(item8); 268 268 if ( psMemCheckLeaks(0, NULL, stdout) != 0 ) { 269 psError( __func__,"Memory leaks detected.");269 psError(PS_ERR_UNKNOWN, true,"Memory leaks detected."); 270 270 return 50; 271 271 } -
trunk/psLib/test/collections/tst_psMetadata_06.c
r2204 r2273 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-1 0-27 00:57:33$15 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-11-04 01:05:00 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 88 88 printPositiveTestHeader(stdout, "psMetadata", "Test B - Add leaf node on top of existing leaf node"); 89 89 if( ! psMetadataAddItem(metadata, item1a, PS_LIST_HEAD) ) { 90 psError( __func__,"psMetadataAddItem returned false for adding a node top.");90 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem returned false for adding a node top."); 91 91 return 20; 92 92 } 93 93 if ( ! psMetadataAddItem(metadata, item1b, PS_LIST_HEAD) ) { 94 psError( __func__,"psMetadataAddItem returned false for adding a node top.");94 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem returned false for adding a node top."); 95 95 return 21; 96 96 } … … 102 102 printPositiveTestHeader(stdout, "psMetadata", "Test C - Add leaf node to existing folder node"); 103 103 if ( ! psMetadataAddItem(metadata, item1c, PS_LIST_HEAD) ) { 104 psError( __func__,"psMetadataAddItem return false for adding a not to existing node.");104 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem return false for adding a not to existing node."); 105 105 return 22; 106 106 } … … 111 111 printPositiveTestHeader(stdout, "psMetadata", "Test D - Add folder node on top of existing leaf node"); 112 112 if ( ! psMetadataAddItem(metadata, item2a, PS_LIST_HEAD) ) { 113 psError( __func__,"psMetadataAddItem returned false for adding a node to existing leaf node.");113 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem returned false for adding a node to existing leaf node."); 114 114 return 23; 115 115 } 116 116 if ( ! psMetadataAddItem(metadata, item2b, PS_LIST_HEAD) ) { 117 psError( __func__,"psMetadataAddItem returned false for adding a nod to existing leaf node.");117 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem returned false for adding a nod to existing leaf node."); 118 118 return 24; 119 119 } … … 130 130 psFree(metadata); 131 131 if ( psMemCheckLeaks(0, NULL, stdout) != 0 ) { 132 psError( __func__,"Memory leaks detected.");132 psError(PS_ERR_UNKNOWN, true,"Memory leaks detected."); 133 133 return 25; 134 134 }
Note:
See TracChangeset
for help on using the changeset viewer.
