Changeset 2273 for trunk/psLib/test/dataManip
- Timestamp:
- Nov 3, 2004, 3:05:00 PM (22 years ago)
- Location:
- trunk/psLib/test/dataManip
- Files:
-
- 12 edited
-
tst_psFunc02.c (modified) (6 diffs)
-
tst_psFunc03.c (modified) (2 diffs)
-
tst_psFunc04.c (modified) (2 diffs)
-
tst_psFunc05.c (modified) (1 diff)
-
tst_psFunc07.c (modified) (2 diffs)
-
tst_psMatrixVectorArithmetic02.c (modified) (2 diffs)
-
tst_psMatrixVectorArithmetic03.c (modified) (4 diffs)
-
tst_psMinimize04.c (modified) (1 diff)
-
tst_psMinimize04b.c (modified) (3 diffs)
-
tst_psMinimize04b_F32.c (modified) (3 diffs)
-
tst_psMinimize06.c (modified) (1 diff)
-
tst_psVectorFFT.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psFunc02.c
r2204 r2273 64 64 } 65 65 66 p _psSpline1DFree(tmpSpline);66 psFree(tmpSpline); 67 67 psMemCheckCorruption(1); 68 68 memLeaks = psMemCheckLeaks(currentId,NULL,stderr); … … 90 90 } 91 91 92 p _psSpline1DFree(tmpSpline);92 psFree(tmpSpline); 93 93 psMemCheckCorruption(1); 94 94 memLeaks = psMemCheckLeaks(currentId,NULL,stderr); … … 144 144 } 145 145 146 p _psSpline1DFree(tmpSpline);146 psFree(tmpSpline); 147 147 psMemCheckCorruption(1); 148 148 memLeaks = psMemCheckLeaks(currentId,NULL,stderr); … … 198 198 } 199 199 200 p _psSpline1DFree(tmpSpline);200 psFree(tmpSpline); 201 201 psMemCheckCorruption(1); 202 202 memLeaks = psMemCheckLeaks(currentId,NULL,stderr); … … 224 224 } 225 225 226 p _psSpline1DFree(tmpSpline);226 psFree(tmpSpline); 227 227 psMemCheckCorruption(1); 228 228 memLeaks = psMemCheckLeaks(currentId,NULL,stderr); … … 278 278 } 279 279 280 p _psSpline1DFree(tmpSpline);280 psFree(tmpSpline); 281 281 psMemCheckCorruption(1); 282 282 memLeaks = psMemCheckLeaks(currentId,NULL,stderr); -
trunk/psLib/test/dataManip/tst_psFunc03.c
r2204 r2273 72 72 } 73 73 74 p _psSpline1DFree(tmpSpline);74 psFree(tmpSpline); 75 75 psFree(bounds); 76 76 psMemCheckCorruption(1); … … 132 132 } 133 133 134 p _psSpline1DFree(tmpSpline);134 psFree(tmpSpline); 135 135 psFree(bounds); 136 136 psMemCheckCorruption(1); -
trunk/psLib/test/dataManip/tst_psFunc04.c
r2204 r2273 53 53 } 54 54 55 p _psSpline1DFree(tmpSpline);55 psFree(tmpSpline); 56 56 psMemCheckCorruption(1); 57 57 psFree(data); … … 105 105 } 106 106 107 p _psSpline1DFree(tmpSpline);107 psFree(tmpSpline); 108 108 psMemCheckCorruption(1); 109 109 psFree(data); -
trunk/psLib/test/dataManip/tst_psFunc05.c
r2204 r2273 59 59 } 60 60 61 p _psSpline1DFree(tmpSpline);61 psFree(tmpSpline); 62 62 63 63 psFree(x); -
trunk/psLib/test/dataManip/tst_psFunc07.c
r2223 r2273 83 83 psFree(newX); 84 84 psFree(y); 85 p _psSpline1DFree(tmpSpline);85 psFree(tmpSpline); 86 86 psFree(newY); 87 87 … … 152 152 psFree(newX); 153 153 psFree(y); 154 p _psSpline1DFree(tmpSpline);154 psFree(tmpSpline); 155 155 psFree(newY); 156 156 -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c
r2204 r2273 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-1 0-27 00:57:33$12 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-11-04 01:05:00 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 83 83 #define CHECK_MEMORY \ 84 84 if( psMemCheckLeaks(0, NULL, stdout) != 0 ) { \ 85 psError( __func__,"Memory leaks detected."); \85 psError(PS_ERR_UNKNOWN, true,"Memory leaks detected."); \ 86 86 return 50; \ 87 87 } \ 88 88 psS32 nBad = psMemCheckCorruption(0); \ 89 89 if(nBad) { \ 90 psError( __func__,"ERROR: Found %d bad memory blocks\n", nBad); \90 psError(PS_ERR_UNKNOWN, true,"ERROR: Found %d bad memory blocks\n", nBad); \ 91 91 return 51; \ 92 92 } -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c
r2204 r2273 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $18 * @date $Date: 2004-1 0-27 00:57:33$17 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-11-04 01:05:00 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 221 221 CREATE_AND_SET_VECTOR(vector6,F64,0,3); 222 222 if ( psBinaryOp(vector6,vector4,"+",NULL) != NULL ) { 223 psError( __func__,"psBinaryOp should return null when out and in1 valid but in2 null.");223 psError(PS_ERR_UNKNOWN, true,"psBinaryOp should return null when out and in1 valid but in2 null."); 224 224 return 10; 225 225 } … … 228 228 vector4->type.dimen = PS_DIMEN_OTHER; 229 229 if ( psBinaryOp(NULL,vector4,"+",vector5) != NULL) { 230 psError( __func__,"psBinaryOp should return null when input dimen PS_DIMEN_OTHER.");230 psError(PS_ERR_UNKNOWN, true,"psBinaryOp should return null when input dimen PS_DIMEN_OTHER."); 231 231 return 11; 232 232 } … … 236 236 CREATE_AND_SET_IMAGE(image10,F64,0,3,3); 237 237 if ( psBinaryOp(image10,inScalar,"+",vector4) == NULL ) { 238 psError( __func__,"psBinaryOp should not return null when input/out dimension don't match.");238 psError(PS_ERR_UNKNOWN, true,"psBinaryOp should not return null when input/out dimension don't match."); 239 239 return 12; 240 240 } -
trunk/psLib/test/dataManip/tst_psMinimize04.c
r2204 r2273 237 237 myPoly = psVectorFitPolynomial1D(NULL, NULL, NULL, NULL); 238 238 if ( myPoly != NULL ) { 239 psError( __func__,"A null polynomial should have returned a null pointer.");239 psError(PS_ERR_UNKNOWN, true,"A null polynomial should have returned a null pointer."); 240 240 testStatus = false; 241 241 } -
trunk/psLib/test/dataManip/tst_psMinimize04b.c
r2204 r2273 47 47 yErr->data.F64[i] = 1.0; 48 48 } 49 p _psNormalizeVectorF64(x);49 psNormalizeVectorRange(x,0.0,1.0); 50 50 51 51 printPositiveTestHeader(stdout, … … 113 113 y->data.F64[i] = setData(x->data.F64[i]); 114 114 } 115 p _psNormalizeVectorF64(x);115 psNormalizeVectorRange(x,0.0,1.0); 116 116 117 117 printPositiveTestHeader(stdout, … … 173 173 y->data.F64[i] = setData(x->data.F64[i]); 174 174 } 175 p _psNormalizeVectorF64(x);175 psNormalizeVectorRange(x,0.0,1.0); 176 176 177 177 printPositiveTestHeader(stdout, -
trunk/psLib/test/dataManip/tst_psMinimize04b_F32.c
r2204 r2273 47 47 yErr->data.F32[i] = 1.0; 48 48 } 49 p _psNormalizeVector(x);49 psNormalizeVectorRange(x,0.0f,1.0f); 50 50 51 51 printPositiveTestHeader(stdout, … … 113 113 y->data.F32[i] = setData(x->data.F32[i]); 114 114 } 115 p _psNormalizeVector(x);115 psNormalizeVectorRange(x,0.0f,1.0f); 116 116 117 117 printPositiveTestHeader(stdout, … … 173 173 y->data.F32[i] = setData(x->data.F32[i]); 174 174 } 175 p _psNormalizeVector(x);175 psNormalizeVectorRange(x,0.0,1.0); 176 176 177 177 printPositiveTestHeader(stdout, -
trunk/psLib/test/dataManip/tst_psMinimize06.c
r2204 r2273 35 35 if (myDeriv == NULL) { 36 36 myDeriv = psImageAlloc(myParams->n, myCoords->n, PS_TYPE_F32); 37 psError( __func__, "myDeriv is NULL.\n");37 psError(PS_ERR_UNKNOWN, true, "myDeriv is NULL.\n"); 38 38 } 39 39 -
trunk/psLib/test/dataManip/tst_psVectorFFT.c
r2204 r2273 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-1 0-27 00:57:33$8 * @version $Revision: 1.8 $ $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 … … 85 85 vec2 = psVectorFFT( NULL, vec, PS_FFT_FORWARD ); 86 86 if ( vec2->type.type != PS_TYPE_C32 ) { 87 psError( __func__, "FFT didn't produce complex values?" );87 psError(PS_ERR_UNKNOWN,true, "FFT didn't produce complex values?" ); 88 88 return 1; 89 89 } … … 94 94 if ( n == 1 || n == 99 ) { 95 95 if ( fabsf( cabsf( vec2->data.C32[ n ] ) - 50.0f ) > 0.1f ) { 96 psError( __func__, "FFT didn't work for vector (n=%d)", n );96 psError(PS_ERR_UNKNOWN,true, "FFT didn't work for vector (n=%d)", n ); 97 97 return 2; 98 98 } 99 99 } else { 100 100 if ( fabsf( cabsf( vec2->data.C32[ n ] ) ) > 0.1f ) { 101 psError( __func__, "FFT didn't work for vector (n=%d)", n );101 psError(PS_ERR_UNKNOWN,true, "FFT didn't work for vector (n=%d)", n ); 102 102 return 3; 103 103 } … … 108 108 vec3 = psVectorFFT( NULL, vec2, PS_FFT_REVERSE ); 109 109 if ( vec3->type.type != PS_TYPE_C32 ) { 110 psError( __func__, "FFT didn't produce complex values?" );110 psError(PS_ERR_UNKNOWN,true, "FFT didn't produce complex values?" ); 111 111 return 4; 112 112 } … … 115 115 psF32 vecVal = crealf( vec3->data.C32[ n ] ) / 100; 116 116 if ( fabsf( vecVal - val ) > 0.1f ) { 117 psError( __func__, "Reverse FFT didn't give me the original vector back (n=%d) (%.2f vs %.2f)",118 n, vecVal, val );117 psError(PS_ERR_UNKNOWN,true, "Reverse FFT didn't give me the original vector back (n=%d) (%.2f vs %.2f)", 118 n, vecVal, val ); 119 119 return 5; 120 120 } … … 150 150 vec2 = psVectorReal( vec2, vec ); 151 151 if ( vec2 == NULL ) { 152 psError( __func__, "psVectorReal returned a NULL?" );152 psError(PS_ERR_UNKNOWN,true, "psVectorReal returned a NULL?" ); 153 153 return 1; 154 154 } 155 155 if ( vec2->type.type != PS_TYPE_F32 ) { 156 psError( __func__, "psVectorReal returned a wrong type (%d)?",157 vec2->type.type );156 psError(PS_ERR_UNKNOWN,true, "psVectorReal returned a wrong type (%d)?", 157 vec2->type.type ); 158 158 return 2; 159 159 } … … 161 161 vec3 = psVectorImaginary( vec3, vec ); 162 162 if ( vec3 == NULL ) { 163 psError( __func__, "psVectorImaginary returned a NULL?" );163 psError(PS_ERR_UNKNOWN,true, "psVectorImaginary returned a NULL?" ); 164 164 return 3; 165 165 } 166 166 if ( vec3->type.type != PS_TYPE_F32 ) { 167 psError( __func__, "psVectorImaginary returned a wrong type (%d)?",168 vec3->type.type );167 psError(PS_ERR_UNKNOWN,true, "psVectorImaginary returned a wrong type (%d)?", 168 vec3->type.type ); 169 169 return 4; 170 170 } … … 175 175 psF32 i = ( n * 2 ); 176 176 if ( fabsf( vec2->data.F32[ n ] - r ) > FLT_EPSILON ) { 177 psError( __func__, "psVectorReal didn't return the real portion at n=%d",178 n );177 psError(PS_ERR_UNKNOWN,true, "psVectorReal didn't return the real portion at n=%d", 178 n ); 179 179 return 5; 180 180 } 181 181 if ( fabsf( vec3->data.F32[ n ] - i ) > FLT_EPSILON ) { 182 psError( __func__, "psVectorImaginary didn't return the real portion at n=%d",183 n );182 psError(PS_ERR_UNKNOWN,true, "psVectorImaginary didn't return the real portion at n=%d", 183 n ); 184 184 return 6; 185 185 } … … 230 230 // 3. verify that the result is a psC32 231 231 if ( vec3->type.type != PS_TYPE_C32 ) { 232 psError( __func__, "Vector Type from psVectorComplex is not complex? (%d)",233 vec3->type.type );232 psError(PS_ERR_UNKNOWN,true, "Vector Type from psVectorComplex is not complex? (%d)", 233 vec3->type.type ); 234 234 return 1; 235 235 } … … 240 240 if ( fabsf( crealf( vec3->data.C32[ n ] ) - n ) > FLT_EPSILON || 241 241 fabsf( cimagf( vec3->data.C32[ n ] ) - ( n * 2 ) ) > FLT_EPSILON ) { 242 psError( __func__, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)",243 n, crealf( vec3->data.C32[ n ] ), cimagf( vec3->data.C32[ n ] ) );242 psError(PS_ERR_UNKNOWN,true, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)", 243 n, crealf( vec3->data.C32[ n ] ), cimagf( vec3->data.C32[ n ] ) ); 244 244 return 2; 245 245 }; … … 251 251 252 252 // 7. call psVectorComplex 253 psLogMsg( __func__, PS_LOG_INFO, "Following should be an error (type mismatch)." );253 psLogMsg(__func__, PS_LOG_INFO, "Following should be an error (type mismatch)." ); 254 254 vec3 = psVectorComplex( vec3, vec, vec2 ); 255 255 // 8. verify that an appropriate error occurred. (this partially has to be done via inspection) 256 256 if ( vec3 != NULL ) { 257 psError( __func__, "psVectorComplex returned a vector though input types mismatched." );257 psError(PS_ERR_UNKNOWN,true, "psVectorComplex returned a vector though input types mismatched." ); 258 258 return 3; 259 259 } … … 267 267 // 11. verify thet an appropriate error occurred. (actually, it isn't an error...) 268 268 if ( vec3->n != 100 ) { 269 psError( __func__, "psVectorComplex returned a larger vector than the input supported (%d).", vec3->n );269 psError(PS_ERR_UNKNOWN,true, "psVectorComplex returned a larger vector than the input supported (%d).", vec3->n ); 270 270 return 4; 271 271 } … … 302 302 // 3. verify result is psC32 303 303 if ( vec2->type.type != PS_TYPE_C32 ) { 304 psError( __func__, "the psVectorConjugate didn't return a C32 vector" );304 psError(PS_ERR_UNKNOWN,true, "the psVectorConjugate didn't return a C32 vector" ); 305 305 return 1; 306 306 } … … 310 310 if ( fabsf( crealf( vec->data.C32[ n ] ) - crealf( vec2->data.C32[ n ] ) ) > FLT_EPSILON || 311 311 fabsf( cimagf( vec->data.C32[ n ] ) + cimagf( vec2->data.C32[ n ] ) ) > FLT_EPSILON ) { 312 psError( __func__, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)",313 n, crealf( vec2->data.C32[ n ] ), cimagf( vec2->data.C32[ n ] ) );312 psError(PS_ERR_UNKNOWN,true, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)", 313 n, crealf( vec2->data.C32[ n ] ), cimagf( vec2->data.C32[ n ] ) ); 314 314 return 2; 315 315 }; … … 347 347 // 3. verify result is psF32 348 348 if ( vec2->type.type != PS_TYPE_F32 ) { 349 psError( __func__, "the type was not PS_TYPE_F32." );349 psError(PS_ERR_UNKNOWN,true, "the type was not PS_TYPE_F32." ); 350 350 return 1; 351 351 } … … 360 360 val = cabsf( vec->data.C32[ 0 ] ) * cabsf( vec->data.C32[ 0 ] ) / 100 / 100; 361 361 if ( fabsf( vec2->data.F32[ 0 ] - val ) > FLT_EPSILON ) { 362 psError( __func__, "psVectorPowerSpectrum result is invalid (n=0, %.2f %.2f)",363 vec2->data.F32[ 0 ], val );362 psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=0, %.2f %.2f)", 363 vec2->data.F32[ 0 ], val ); 364 364 return 2; 365 365 }; … … 370 370 371 371 if ( fabsf( val - vec2->data.F32[ n ] ) > FLT_EPSILON ) { 372 psError( __func__, "psVectorPowerSpectrum result is invalid (n=%d, %.2f %.2f)",373 n, vec2->data.F32[ n ], val );372 psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=%d, %.2f %.2f)", 373 n, vec2->data.F32[ n ], val ); 374 374 return 2; 375 375 }; … … 378 378 val = cabsf( vec->data.C32[ 50 ] ) * cabsf( vec->data.C32[ 50 ] ) / 100 / 100; 379 379 if ( fabsf( vec2->data.F32[ 50 ] - val ) > FLT_EPSILON ) { 380 psError( __func__, "psVectorPowerSpectrum result is invalid (n=50, %.2f %.2f)",381 vec2->data.F32[ 0 ], val );380 psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=50, %.2f %.2f)", 381 vec2->data.F32[ 0 ], val ); 382 382 return 2; 383 383 };
Note:
See TracChangeset
for help on using the changeset viewer.
