Changeset 4308 for trunk/psLib/test
- Timestamp:
- Jun 17, 2005, 1:44:22 PM (21 years ago)
- Location:
- trunk/psLib/test
- Files:
-
- 6 edited
-
collections/tst_psArray.c (modified) (7 diffs)
-
collections/tst_psMetadata_04.c (modified) (2 diffs)
-
dataManip/tst_psVectorFFT.c (modified) (4 diffs)
-
image/tst_psImageGeomManip.c (modified) (2 diffs)
-
image/verified/tst_psImagePixelManip.stderr (modified) (1 diff)
-
sysUtils/tst_psMemory.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psArray.c
r3682 r4308 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $20 * @date $Date: 2005-0 4-07 20:27:41$19 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2005-06-17 23:44:22 $ 21 21 * 22 22 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 202 202 } 203 203 } 204 ps Free(mySt[0]);204 psMemDecrRefCounter(mySt[0]); 205 205 printFooter(stderr,"psArray","Remove valid item", true); 206 206 … … 235 235 psFree(mySt[i]); 236 236 } 237 if( psMemCheckLeaks(0, NULL, stderr, false) != 0) { 238 psError(PS_ERR_UNKNOWN,true,"Memory leaks detected."); 239 return 110; 240 } 241 psS32 nBad = psMemCheckCorruption(0); 242 if(nBad) { 243 fprintf(stderr,"ERROR: Found %d bad memory blocks\n", nBad); 244 return 111; 245 } 237 246 238 printFooter(stderr, "psArray" ,"Free void pointer array", true); 247 239 … … 361 353 } 362 354 363 psFree(data);364 365 355 subtest++; 366 356 if (arr->nalloc != nalloc) { … … 386 376 return subtest; 387 377 } 378 379 psFree(data); 388 380 } 389 381 … … 391 383 data = psAlloc(sizeof(float)); 392 384 arr = psArrayAdd(arr, delta, data); 393 psFree(data);394 385 395 386 // make sure the array was expanded … … 418 409 } 419 410 411 psFree(data); 412 420 413 // make the array full again (operation tested already) 421 414 while (arr->n < arr->nalloc) { -
trunk/psLib/test/collections/tst_psMetadata_04.c
r3682 r4308 23 23 * @author Ross Harman, MHPCC 24 24 * 25 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $26 * @date $Date: 2005-0 4-07 20:27:41$25 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 26 * @date $Date: 2005-06-17 23:44:22 $ 27 27 * 28 28 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 101 101 psMetadataAddItem(metadata, item5, PS_LIST_HEAD, PS_META_DEFAULT); 102 102 psMetadataAddItem(metadata, item6, PS_LIST_HEAD, PS_META_DEFAULT); 103 ps Free(vec);103 psMemDecrRefCounter(vec); // vs. psFree, which now would set vec to NULL (want to keep it to comparison later) 104 104 printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true); 105 105 -
trunk/psLib/test/dataManip/tst_psVectorFFT.c
r3884 r4308 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 5-11 22:02:16$8 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-17 23:44:22 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 474 474 475 475 psFree( vec ); 476 psFree( vec2 );477 476 478 477 // Perform conjugate for non-complex number … … 509 508 for ( psU32 n = 0; n < 100; n++ ) { 510 509 if ( fabsf( crealf(vec->data.C64[n]) - crealf(vec2->data.C64[n])) > FLT_EPSILON || 511 fabsf( cimagf(vec->data.C64[n]) -cimagf(vec2->data.C64[n])) > FLT_EPSILON ) {510 fabsf( cimagf(vec->data.C64[n]) + cimagf(vec2->data.C64[n])) > FLT_EPSILON ) { 512 511 psError(PS_ERR_UNKNOWN,true,"psVectorConjugate result is invalid (n=%d)",n); 513 512 return 13; … … 516 515 psFree(vec); 517 516 518 // Perform vector conjugate with null input 519 if ( psVectorConjugate( NULL,NULL) != NULL) {517 // Perform vector conjugate with null input (vec2 should be freed too) 518 if ( psVectorConjugate(vec2,NULL) != NULL) { 520 519 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with null input vector"); 521 520 return 61; -
trunk/psLib/test/image/tst_psImageGeomManip.c
r4214 r4308 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-06-1 1 02:19:05$8 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-17 23:44:22 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1077 1077 static psS32 testImageTransform(void) 1078 1078 { 1079 1080 /// XXX: TODO 1079 int cols = 16; 1080 int rows = 32; 1081 1082 psPlaneTransform* trans = psPlaneTransformAlloc(2,2); 1083 trans->x->coeff[1][0] = 0.5; 1084 trans->y->coeff[0][1] = 1.5; 1085 1086 psImage* in = psImageAlloc(cols,rows,PS_TYPE_F32); 1087 for (psS32 row=0;row<rows;row++) { 1088 psF32* inRow = in->data.F32[row]; 1089 for (psS32 col=0;col<cols;col++) { 1090 inRow[col] = (psF32)row+(psF32)col/1000.0f; 1091 } 1092 } 1093 1094 psImage* out = psImageTransform(NULL, 1095 NULL, 1096 in, 1097 NULL, 1098 0, 1099 trans, 1100 psRegionSet(0,cols*2,0,rows*2), 1101 NULL, 1102 PS_INTERPOLATE_FLAT, 1103 -1); 1104 1105 if (out == NULL) { 1106 psError(PS_ERR_UNKNOWN, false, 1107 "out == NULL"); 1108 return 1; 1109 } 1110 if (out->type.type != PS_TYPE_F32) { 1111 psError(PS_ERR_UNKNOWN, false, 1112 "out->type.type != PS_TYPE_F32, out->type.type == %d", 1113 out->type.type); 1114 return 2; 1115 } 1116 if (out->numRows != rows*2 || out->numCols != cols*2) { 1117 psError(PS_ERR_UNKNOWN, false, 1118 "out size is %dx%d, not %dx%d", 1119 out->numCols, out->numRows, cols*2, rows); 1120 return 3; 1121 } 1122 1123 for (psS32 row=0;row<out->numRows;row++) { 1124 psF32* outRow = out->data.F32[row]; 1125 for (psS32 col=0;col<cols;col++) { 1126 float inValue = p_psImagePixelInterpolateFLAT_F32(in, 1127 col*trans->x->coeff[1][0]+trans->x->coeff[0][0], 1128 row*trans->y->coeff[0][1]+trans->y->coeff[0][0], 1129 NULL, 0, 1130 -1); 1131 if (fabsf(outRow[col] - inValue) > FLT_EPSILON*10) { 1132 psError(PS_ERR_UNKNOWN, false, 1133 "out at %d,%d was %g, expected %g", 1134 col,row,outRow[col], inValue); 1135 return 4; 1136 } 1137 } 1138 } 1139 1140 psFree(out); 1141 psFree(in); 1142 psFree(trans); 1081 1143 return 0; 1082 1144 } -
trunk/psLib/test/image/verified/tst_psImagePixelManip.stderr
r3986 r4308 27 27 <DATE><TIME>|<HOST>|I|testImageClip 28 28 Following should be an error (max<min) 29 <DATE><TIME>|<HOST>|E|psImageClip (FILE:LINENO)30 Specified min value, 256, can not be greater than the specified max value, 128.31 29 32 30 ---> TESTPOINT PASSED (psImage{psImageClip} | tst_psImagePixelManip.c) -
trunk/psLib/test/sysUtils/tst_psMemory.c
r3682 r4308 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 4-07 20:27:42 $8 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-17 23:44:22 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 130 130 psLogMsg( __func__, PS_LOG_INFO, "psFree shall be just decrement a multiple refererenced pointer." ); 131 131 132 ps Free( mem );132 psMemDecrRefCounter( mem ); 133 133 134 134 ref = psMemGetRefCounter( mem ); … … 521 521 { 522 522 523 psPtr buffer = psAlloc( 1024 ); 523 psPtr buffer = psAlloc( 1024 ); 524 psPtr buffer2 = buffer; 524 525 525 526 psFree( buffer ); 526 527 527 528 psLogMsg( __func__, PS_LOG_INFO, "Next should abort due to multiple freeing." ); 528 psFree( buffer );529 psFree( buffer2 ); 529 530 530 531 psError(PS_ERR_UNKNOWN,true,
Note:
See TracChangeset
for help on using the changeset viewer.
