Changeset 6500 for trunk/psLib/test/types
- Timestamp:
- Feb 27, 2006, 4:53:03 PM (20 years ago)
- Location:
- trunk/psLib/test/types
- Files:
-
- 6 edited
-
tst_psArray.c (modified) (6 diffs)
-
tst_psList.c (modified) (4 diffs)
-
tst_psPixels.c (modified) (9 diffs)
-
verified/tst_psArray.stderr (modified) (2 diffs)
-
verified/tst_psList.stderr (modified) (1 diff)
-
verified/tst_psPixels.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/types/tst_psArray.c
r6445 r6500 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $20 * @date $Date: 2006-02- 17 03:24:46$19 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2006-02-28 02:53:03 $ 21 21 * 22 22 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 53 53 static psS32 testArrayAdd( void ); 54 54 static psS32 testArrayGetSet( void ); 55 55 static psS32 testArrayLength( void ); 56 56 57 57 testDescription tests[] = { … … 60 60 {testArrayAdd, 667, "psArrayAdd", 0, false}, 61 61 {testArrayGetSet, 668, "psArrayGetSet", 0, false}, 62 {testArrayLength, 669, "psArrayLength", 0, false}, 62 63 {NULL} 63 64 }; … … 464 465 if ( !psArraySet(test, 0, p1) ) 465 466 fprintf(stderr, "ArraySet failed to set S32 at position 0\n"); 467 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 466 468 if ( psArraySet(test, 10, p1) ) 467 469 fprintf(stderr, "ArraySet Improperly set S32 at out of range position\n"); … … 475 477 psFree(p2); // free ref from psArrayGet 476 478 479 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 477 480 if ( psArraySet(test, -6, p3) ) 478 481 fprintf(stderr, "ArraySet failed to fail using an out of range negative number\n"); … … 485 488 return 0; 486 489 } 490 491 psS32 testArrayLength( void ) 492 { 493 psArray *array = psArrayAlloc(5); 494 495 if (psArrayLength(array) != 0) { 496 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 497 "psArrayLength failed to return the correct length of array.\n"); 498 return 1; 499 } 500 array->n = 5; 501 if (psArrayLength(array) != 5) { 502 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 503 "psArrayLength failed to return the correct length of array.\n"); 504 return 2; 505 } 506 array->n++; 507 if (psArrayLength(array) != 6) { 508 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 509 "psArrayLength failed to return the correct length of array.\n"); 510 return 3; 511 } 512 psFree(array); 513 514 psArray *emptyArray = NULL; 515 psVector *vector = psVectorAlloc(5, PS_TYPE_F32); 516 517 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 518 if (psArrayLength(emptyArray) != -1) { 519 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 520 "psArrayLength failed to return -1 for a NULL input array.\n"); 521 return 4; 522 } 523 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 524 if (psArrayLength((psArray*)vector) != -1) { 525 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 526 "psArrayLength failed to return -1 for an invalid input array.\n"); 527 return 5; 528 } 529 psFree(vector); 530 531 return 0; 532 } 533 -
trunk/psLib/test/types/tst_psList.c
r4547 r6500 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $9 * @date $Date: 200 5-07-13 02:47:01$8 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-02-28 02:53:03 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 static psS32 testListAddAfter(void); 29 29 static psS32 testListAddBefore(void); 30 static psS32 testListLength(void); 30 31 31 32 testDescription tests[] = { … … 40 41 {testListAddAfter,811,"psListAddAfter",0,false}, 41 42 {testListAddBefore,811,"psListAddBefore",0,false}, 43 {testListLength,666,"testListLength",0,false}, 42 44 {NULL} 43 45 }; … … 1271 1273 return 0; 1272 1274 } 1275 1276 psS32 testListLength( void ) 1277 { 1278 psArray *temp = psArrayAlloc(5); 1279 psList *list = psListAlloc(temp); 1280 1281 if (psListLength(list) != 1) { 1282 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 1283 "psListLength failed to return the correct length of list.\n"); 1284 return 1; 1285 } 1286 list->n = 5; 1287 if (psListLength(list) != 5) { 1288 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 1289 "psListLength failed to return the correct length of list.\n"); 1290 return 2; 1291 } 1292 list->n++; 1293 if (psListLength(list) != 6) { 1294 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 1295 "psListLength failed to return the correct length of list.\n"); 1296 return 3; 1297 } 1298 psFree(temp); 1299 psFree(list); 1300 1301 psList *emptyList = NULL; 1302 psVector *vector = psVectorAlloc(5, PS_TYPE_F32); 1303 1304 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 1305 if (psListLength(emptyList) != -1) { 1306 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 1307 "psListLength failed to return -1 for a NULL input list.\n"); 1308 return 4; 1309 } 1310 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 1311 if (psListLength((psList*)vector) != -1) { 1312 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 1313 "psListLength failed to return -1 for an invalid input list.\n"); 1314 return 5; 1315 } 1316 psFree(vector); 1317 1318 return 0; 1319 } 1320 -
trunk/psLib/test/types/tst_psPixels.c
r5214 r6500 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 3$7 * @version $Revision: 1.4 $ 8 8 * $Name: not supported by cvs2svn $ 9 * @date $Date: 200 5-10-01 00:14:17$9 * @date $Date: 2006-02-28 02:53:03 $ 10 10 * 11 11 * Copyright 2005 Maui High Performance Computing Center, University of Hawaii … … 22 22 static int testPixelsConcatenate(void); 23 23 static psS32 testPixelsGetSet(void); 24 static psS32 testPixelsLength( void ); 24 25 25 26 testDescription tests[] = { … … 31 32 {testPixelsConcatenate,866,"psPixelsConcatenate",0,false}, 32 33 {testPixelsGetSet,867,"psPixelsGet/Set",0,false}, 34 {testPixelsLength,666,"psPixelsLength",0,false}, 33 35 {NULL} 34 36 }; … … 85 87 p1->data[0].x = 1; 86 88 p1->data[0].y = 2; 87 89 p1->n++; 88 90 if (p1->n != p1->nalloc) { 89 91 psError(PS_ERR_UNKNOWN, true, … … 113 115 p2->data[i].x = i; 114 116 p2->data[i].y = 100+i; 117 p2->n++; 115 118 } 116 119 … … 140 143 // first, tests that reallocing a NULL just allocates 141 144 psPixels* p0 = psPixelsRealloc(NULL,10); 145 p0->n = 10; 142 146 143 147 if (p0 == NULL) { … … 168 172 169 173 psPixels* p1 = psPixelsRealloc(p0, 20); 174 // p1->n = 20; 170 175 171 176 if (p1 != p0) { … … 205 210 206 211 psPixels* p2 = psPixelsRealloc(p1,5); 207 212 p2->n = 5; 208 213 if (p2 != p1) { 209 214 psError(PS_ERR_UNKNOWN, true, … … 546 551 } 547 552 553 psS32 testPixelsLength( void ) 554 { 555 psPixels *pixels = psPixelsAlloc(5); 556 557 if (psPixelsLength(pixels) != 0) { 558 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 559 "psPixelsLength failed to return the correct length of pixels.\n"); 560 return 1; 561 } 562 pixels->n = 5; 563 if (psPixelsLength(pixels) != 5) { 564 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 565 "psPixelsLength failed to return the correct length of pixels.\n"); 566 return 2; 567 } 568 pixels->n++; 569 if (psPixelsLength(pixels) != 6) { 570 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 571 "psPixelsLength failed to return the correct length of pixels.\n"); 572 return 3; 573 } 574 psFree(pixels); 575 576 psPixels *emptyPixels = NULL; 577 psVector *vector = psVectorAlloc(5, PS_TYPE_F32); 578 579 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 580 if (psPixelsLength(emptyPixels) != -1) { 581 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 582 "psPixelsLength failed to return -1 for a NULL input pixels.\n"); 583 return 4; 584 } 585 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 586 if (psPixelsLength((psPixels*)vector) != -1) { 587 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 588 "psPixelsLength failed to return -1 for an invalid input pixels.\n"); 589 return 5; 590 } 591 psFree(vector); 592 593 return 0; 594 } 595 -
trunk/psLib/test/types/verified/tst_psArray.stderr
r6445 r6500 225 225 \**********************************************************************************/ 226 226 227 <DATE><TIME>|<HOST>|I|testArrayGetSet 228 Following should generate error message 227 229 <DATE><TIME>|<HOST>|E|psArraySet (FILE:LINENO) 228 230 Specified position, 10, is greater than n+1 of the array, 1. 231 <DATE><TIME>|<HOST>|I|testArrayGetSet 232 Following should generate error message 229 233 <DATE><TIME>|<HOST>|E|psArraySet (FILE:LINENO) 230 234 Invalid position. Negative number too large … … 232 236 ---> TESTPOINT PASSED (psArray{psArrayGetSet} | tst_psArray.c) 233 237 238 /***************************** TESTPOINT ******************************************\ 239 * TestFile: tst_psArray.c * 240 * TestPoint: psArray{psArrayLength} * 241 * TestType: Positive * 242 \**********************************************************************************/ 243 244 <DATE><TIME>|<HOST>|I|testArrayLength 245 Following should generate error message 246 <DATE><TIME>|<HOST>|E|psArrayLength (FILE:LINENO) 247 Error: Specified array is not a valid psArray 248 <DATE><TIME>|<HOST>|I|testArrayLength 249 Following should generate error message 250 <DATE><TIME>|<HOST>|E|psArrayLength (FILE:LINENO) 251 Error: Specified array is not a valid psArray 252 253 ---> TESTPOINT PASSED (psArray{psArrayLength} | tst_psArray.c) 254 -
trunk/psLib/test/types/verified/tst_psList.stderr
r4547 r6500 165 165 ---> TESTPOINT PASSED (psList{psListAddBefore} | tst_psList.c) 166 166 167 /***************************** TESTPOINT ******************************************\ 168 * TestFile: tst_psList.c * 169 * TestPoint: psList{testListLength} * 170 * TestType: Positive * 171 \**********************************************************************************/ 172 173 <DATE><TIME>|<HOST>|I|testListLength 174 Following should generate error message 175 <DATE><TIME>|<HOST>|E|psListLength (FILE:LINENO) 176 Error: Specified list is not a valid psList 177 <DATE><TIME>|<HOST>|I|testListLength 178 Following should generate error message 179 <DATE><TIME>|<HOST>|E|psListLength (FILE:LINENO) 180 Error: Specified list is not a valid psList 181 182 ---> TESTPOINT PASSED (psList{testListLength} | tst_psList.c) 183 -
trunk/psLib/test/types/verified/tst_psPixels.stderr
r5114 r6500 84 84 ---> TESTPOINT PASSED (psPixels{psPixelsGet/Set} | tst_psPixels.c) 85 85 86 /***************************** TESTPOINT ******************************************\ 87 * TestFile: tst_psPixels.c * 88 * TestPoint: psPixels{psPixelsLength} * 89 * TestType: Positive * 90 \**********************************************************************************/ 91 92 <DATE><TIME>|<HOST>|I|testPixelsLength 93 Following should generate error message 94 <DATE><TIME>|<HOST>|E|psPixelsLength (FILE:LINENO) 95 Error: Specified pixels is not a valid psPixels 96 <DATE><TIME>|<HOST>|I|testPixelsLength 97 Following should generate error message 98 <DATE><TIME>|<HOST>|E|psPixelsLength (FILE:LINENO) 99 Error: Specified pixels is not a valid psPixels 100 101 ---> TESTPOINT PASSED (psPixels{psPixelsLength} | tst_psPixels.c) 102
Note:
See TracChangeset
for help on using the changeset viewer.
