Changeset 6484 for trunk/psLib/test/mathtypes
- Timestamp:
- Feb 24, 2006, 1:43:16 PM (20 years ago)
- Location:
- trunk/psLib/test/mathtypes
- Files:
-
- 3 edited
-
tst_psVector.c (modified) (9 diffs)
-
tst_psVectorSort_02.c (modified) (3 diffs)
-
verified/tst_psVector.stderr (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/mathtypes/tst_psVector.c
r6349 r6484 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $17 * @date $Date: 2006-02- 08 00:00:36 $16 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2006-02-24 23:43:16 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 70 70 return 1; 71 71 } 72 if (psVec->n != psVec->nalloc) {72 if (psVec->n != 0) { 73 73 fprintf(stderr,"Vector population = %ld\n", psVec->n); 74 74 return 2; … … 126 126 for(psS32 i = 0; i < 5; i++) { 127 127 psVec->data.S32[i] = i*10; 128 psVec->n++; 128 129 } 129 130 … … 202 203 } 203 204 205 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 204 206 psVector* vecBogus = psVectorRealloc(NULL, 6); 205 207 if (vecBogus != NULL) { … … 319 321 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U8 Case \n"); 320 322 } 321 if ( !psVectorInit(in2, PS_MAX_U64) ) { 323 324 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 325 if ( psVectorInit(in2, PS_MAX_U64) ) { 322 326 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U16 Case \n"); 323 327 } … … 328 332 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U64 Case \n"); 329 333 } 330 if ( !psVectorInit(in5, PS_MAX_S16 ) ) { 334 335 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 336 if ( psVectorInit(in5, PS_MAX_S16 ) ) { 331 337 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. S8 Case \n"); 332 338 } … … 463 469 vec->n = 0; 464 470 465 if ( !psVectorSet(vec, 0, 10) ) 471 if ( !psVectorSet(vec, 0, 10) ) { 466 472 fprintf(stderr, "VectorSet failed to set S32 at position 0\n"); 467 if ( psVectorSet(vec, 10, 10) ) 473 } 474 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 475 if ( psVectorSet(vec, 10, 10) ) { 468 476 fprintf(stderr, "VectorSet Improperly set S32 at out of range position\n"); 469 if ( !psVectorSet(vec, 1, 4) ) 477 } 478 if ( !psVectorSet(vec, 1, 4) ) { 470 479 fprintf(stderr, "VectorSet Failed to set S32 at position 1\n"); 471 if ( (psS32)psVectorGet(vec, 0) != 10 ) 480 } 481 if ( (psS32)psVectorGet(vec, 0) != 10 ) { 472 482 fprintf(stderr, 473 483 "VectorGet Failed to return the correct S32 from position 0\n"); 474 if ( (psS32)psVectorGet(vec, -1) != 4 ) 484 } 485 if ( (psS32)psVectorGet(vec, -1) != 4 ) { 475 486 fprintf(stderr, 476 487 "VectorGet Failed to return the correct S32 from tail using -1\n"); 488 } 477 489 478 490 psFree(vec); … … 485 497 long numPix2 = 0; 486 498 psVector *vec = NULL; 499 500 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 487 501 numPix = psVectorCountPixelMask(vec, 1); 488 489 502 if (numPix != -1) { 490 503 psError(PS_ERR_BAD_PARAMETER_VALUE, false, … … 507 520 vec2->data.U8[3] = 1; 508 521 vec2->data.U8[4] = 0; 522 vec->n = 5; 523 vec2->n = 5; 524 525 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 509 526 numPix = psVectorCountPixelMask(vec, 1); 510 527 numPix2 = psVectorCountPixelMask(vec2, 1); -
trunk/psLib/test/mathtypes/tst_psVectorSort_02.c
r4547 r6484 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $17 * @date $Date: 200 5-07-13 02:47:00$16 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2006-02-24 23:43:16 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 98 98 for(psS32 m=0; m<5; m++) { 99 99 in->data.U8[m]= 20-m; 100 in->n++; 100 101 } 101 102 out = psVectorAlloc(3,PS_TYPE_U32); 103 out->n = 3; 102 104 out = psVectorSortIndex(out,in); 103 105 if(out->n != 5) { … … 151 153 in = psVectorAlloc(5,PS_TYPE_U8); 152 154 out = psVectorAlloc(5,PS_TYPE_U32); 155 in->n = 5; 156 out->n = 5; 153 157 tempVect = out; 154 158 in->type.type = PS_TYPE_BOOL; -
trunk/psLib/test/mathtypes/verified/tst_psVector.stderr
r6350 r6484 18 18 \**********************************************************************************/ 19 19 20 <HOST>|I|testVectorRealloc 21 Following should generate error message 20 22 <HOST>|E|psVectorRealloc (FILE:LINENO) 21 23 psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown. … … 38 40 \**********************************************************************************/ 39 41 42 <HOST>|I|testVectorInit 43 Following should generate error message 40 44 <HOST>|E|psVectorInit (FILE:LINENO) 41 45 Error: U16 Value out of Range. 42 <HOST>| E|testVectorInit (FILE:LINENO)43 VectorInit failed. U16 Case46 <HOST>|I|testVectorInit 47 Following should generate error message 44 48 <HOST>|E|psVectorInit (FILE:LINENO) 45 49 Error: S8 Value out of Range. 46 <HOST>|E|testVectorInit (FILE:LINENO)47 VectorInit failed. S8 Case48 50 49 51 ---> TESTPOINT PASSED (psVector{psVectorInit} | tst_psVector.c) … … 82 84 \**********************************************************************************/ 83 85 86 <HOST>|I|testVectorGetSet 87 Following should generate error message 84 88 <HOST>|E|psVectorSet (FILE:LINENO) 85 89 Invalid position. Number too large … … 93 97 \**********************************************************************************/ 94 98 99 <HOST>|I|testVectorCountPixelMask 100 Following should generate error message 95 101 <HOST>|E|psVectorCountPixelMask (FILE:LINENO) 96 102 The input psVector can not be NULL. 103 <HOST>|I|testVectorCountPixelMask 104 Following should generate error message 97 105 <HOST>|E|psVectorCountPixelMask (FILE:LINENO) 98 106 psVector type does not match the specified psMaskType!
Note:
See TracChangeset
for help on using the changeset viewer.
