Changeset 12607
- Timestamp:
- Mar 27, 2007, 12:52:03 PM (19 years ago)
- Location:
- trunk/psLib/test
- Files:
-
- 30 edited
-
astro/tap_psEarthOrientation_corrections.c (modified) (1 diff)
-
astro/tap_psEarthOrientation_motion.c (modified) (9 diffs)
-
astro/tap_psSphereOps_all.c (modified) (13 diffs)
-
astro/tap_psTime_01.c (modified) (20 diffs)
-
astro/tap_psTime_02.c (modified) (4 diffs)
-
astro/tap_psTime_03.c (modified) (11 diffs)
-
db/tap_psDB.c (modified) (6 diffs)
-
imageops/tap_psImageShift.c (modified) (5 diffs)
-
imageops/tap_psImageShiftKernel.c (modified) (10 diffs)
-
math/tap_psPolynomialUtils_Derivatives.c (modified) (4 diffs)
-
math/tap_psRandom.c (modified) (4 diffs)
-
math/tap_psSparse.c (modified) (7 diffs)
-
math/tap_psStats00.c (modified) (14 diffs)
-
math/tap_psStats01.c (modified) (8 diffs)
-
math/tap_psStats02.c (modified) (8 diffs)
-
math/tap_psStats03.c (modified) (2 diffs)
-
math/tap_psStats06.c (modified) (2 diffs)
-
math/tap_psStats08.c (modified) (4 diffs)
-
mathtypes/tap_psImageInterpolate.c (modified) (7 diffs)
-
pstap/src/pstap.h (modified) (6 diffs)
-
sys/tap_psString.c (modified) (2 diffs)
-
types/tap_psLookupTable_all.c (modified) (1 diff)
-
types/tap_psMetadataConfigFormat.c (modified) (3 diffs)
-
types/tap_psMetadataConfigParse.c (modified) (4 diffs)
-
types/tap_psMetadataConfigPrint.c (modified) (1 diff)
-
types/tap_psMetadataConfigWrite.c (modified) (1 diff)
-
types/tap_psMetadataConfig_input.c (modified) (3 diffs)
-
types/tap_psMetadataItemParse.c (modified) (11 diffs)
-
types/tap_psMetadata_copying.c (modified) (1 diff)
-
types/tap_psMetadata_polynomials.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astro/tap_psEarthOrientation_corrections.c
r12513 r12607 130 130 "Skipping 3 tests because psEarthPole is NULL!"); 131 131 psCube *outCube = psSphereToCube(apparent); 132 ok_double_tol( outCube->x, x, 0.001,132 is_double_tol( outCube->x, x, 0.001, 133 133 "psAberration: return correct sphere for valid inputs."); 134 ok_double_tol( outCube->y, y, 0.001,134 is_double_tol( outCube->y, y, 0.001, 135 135 "psAberration: return correct sphere for valid inputs."); 136 ok_double_tol( outCube->z, z, 0.001,136 is_double_tol( outCube->z, z, 0.001, 137 137 "psAberration: return correct sphere for valid inputs."); 138 138 psFree(outCube); -
trunk/psLib/test/astro/tap_psEarthOrientation_motion.c
r12513 r12607 114 114 skip_start( ep == NULL, 3, 115 115 "Skipping 3 tests because psEarthPole is NULL!"); 116 ok_double_tol(ep->x, x, 0.1,116 is_double_tol(ep->x, x, 0.1, 117 117 "psEOC_PrecessionModel: return valid EarthPole for valid inputs (x)."); 118 ok_double_tol(ep->y, y, 0.1,118 is_double_tol(ep->y, y, 0.1, 119 119 "psEOC_PrecessionModel: return valid EarthPole for valid inputs (y)."); 120 ok_double_tol(ep->s, s, 0.1,120 is_double_tol(ep->s, s, 0.1, 121 121 "psEOC_PrecessionModel: return valid EarthPole for valid inputs (s)."); 122 122 skip_end(); … … 198 198 skip_start( polarMotion == NULL, 3, 199 199 "Skipping 3 tests because psEarthPole is NULL!"); 200 ok_double_tol(polarMotion->x, x, 0.1,200 is_double_tol(polarMotion->x, x, 0.1, 201 201 "psEOC_GetPolarMotion: return valid EarthPole for valid inputs " 202 202 "(x) - IERS B."); 203 ok_double_tol(polarMotion->y, y, 0.1,203 is_double_tol(polarMotion->y, y, 0.1, 204 204 "psEOC_GetPolarMotion: return valid EarthPole for valid inputs " 205 205 "(y) - IERS B."); 206 ok_double_tol(polarMotion->s, s, 0.1,206 is_double_tol(polarMotion->s, s, 0.1, 207 207 "psEOC_GetPolarMotion: return valid EarthPole for valid inputs " 208 208 "(s) - IERS B."); … … 219 219 skip_start( polarMotion == NULL, 3, 220 220 "Skipping 3 tests because psEarthPole is NULL!"); 221 ok_double_tol(polarMotion->x, x, 0.1,221 is_double_tol(polarMotion->x, x, 0.1, 222 222 "psEOC_GetPolarMotion: return valid EarthPole for valid inputs " 223 223 "(x) - IERS A."); 224 ok_double_tol(polarMotion->y, y, 0.1,224 is_double_tol(polarMotion->y, y, 0.1, 225 225 "psEOC_GetPolarMotion: return valid EarthPole for valid inputs " 226 226 "(y) - IERS A."); 227 ok_double_tol(polarMotion->s, s, 0.1,227 is_double_tol(polarMotion->s, s, 0.1, 228 228 "psEOC_GetPolarMotion: return valid EarthPole for valid inputs " 229 229 "(s) - IERS A."); … … 289 289 skip_start( out == NULL, 4, 290 290 "Skipping 4 tests because psSphereRot output is NULL!"); 291 ok_double_tol( out->q0, q0, 0.0001,291 is_double_tol( out->q0, q0, 0.0001, 292 292 "psSphereRot_CEOtoGCRS: return correct psSphereRot for valid input (q0)."); 293 ok_double_tol( out->q1, q1, 0.0001,293 is_double_tol( out->q1, q1, 0.0001, 294 294 "psSphereRot_CEOtoGCRS: return correct psSphereRot for valid input (q1)."); 295 ok_double_tol( out->q2, q2, 0.0001,295 is_double_tol( out->q2, q2, 0.0001, 296 296 "psSphereRot_CEOtoGCRS: return correct psSphereRot for valid input (q2)."); 297 ok_double_tol( out->q3, -q3, 0.0001,297 is_double_tol( out->q3, -q3, 0.0001, 298 298 "psSphereRot_CEOtoGCRS: return correct psSphereRot for valid input (q3)."); 299 299 skip_end(); … … 355 355 psSphere *result = psSphereRotApply(NULL, earthRot, obj); 356 356 psCube *cube = psSphereToCube(result); 357 ok_double_tol( cube->x, x, 0.0001,357 is_double_tol( cube->x, x, 0.0001, 358 358 "psSphereRot_TEOtoCEO: return NULL for NULL time input. (x)"); 359 ok_double_tol( cube->y, y, 0.0001,359 is_double_tol( cube->y, y, 0.0001, 360 360 "psSphereRot_TEOtoCEO: return NULL for NULL time input. (y)"); 361 ok_double_tol( cube->z, z, 0.0001,361 is_double_tol( cube->z, z, 0.0001, 362 362 "psSphereRot_TEOtoCEO: return NULL for NULL time input. (z)"); 363 363 psFree(earthRot); … … 390 390 skip_start( out == NULL, 4, 391 391 "Skipping 4 tests because psSphereRot output is NULL!"); 392 ok_double_tol( out->q0, q0, 0.0001,392 is_double_tol( out->q0, q0, 0.0001, 393 393 "psSphereRot_ITRStoTEO: return correct psSphereRot for valid input (q0)."); 394 ok_double_tol( out->q1, q1, 0.0001,394 is_double_tol( out->q1, q1, 0.0001, 395 395 "psSphereRot_ITRStoTEO: return correct psSphereRot for valid input (q1)."); 396 ok_double_tol( out->q2, q2, 0.0001,396 is_double_tol( out->q2, q2, 0.0001, 397 397 "psSphereRot_ITRStoTEO: return correct psSphereRot for valid input (q2)."); 398 ok_double_tol( out->q3, q3, 0.0001,398 is_double_tol( out->q3, q3, 0.0001, 399 399 "psSphereRot_ITRStoTEO: return correct psSphereRot for valid input (q3)."); 400 400 skip_end(); … … 462 462 skip_start( rot == NULL || outputCoord == NULL, 2, 463 463 "Skipping 2 tests because psSphereRot output is NULL!"); 464 ok_double_tol( outputCoord->r, SPHERE_PRECESS_TP1_EXPECT_R, ERROR_TOL,464 is_double_tol( outputCoord->r, SPHERE_PRECESS_TP1_EXPECT_R, ERROR_TOL, 465 465 "psSpherePrecess: return correct psSphereRot for valid" 466 466 " inputs and PS_PRECESS_ROUGH mode. (r)"); 467 ok_double_tol( outputCoord->d, SPHERE_PRECESS_TP1_EXPECT_D, ERROR_TOL,467 is_double_tol( outputCoord->d, SPHERE_PRECESS_TP1_EXPECT_D, ERROR_TOL, 468 468 "psSpherePrecess: return correct psSphereRot for valid" 469 469 " inputs and PS_PRECESS_ROUGH mode. (d)"); … … 485 485 skip_start( rot == NULL || outputCoord == NULL, 2, 486 486 "Skipping 2 tests because psSphereRot output is NULL!"); 487 ok_double_tol( outputCoord->r, SPHERE_PRECESS_TP2_EXPECT_R, ERROR_TOL,487 is_double_tol( outputCoord->r, SPHERE_PRECESS_TP2_EXPECT_R, ERROR_TOL, 488 488 "psSpherePrecess: return correct psSphereRot for valid" 489 489 " inputs and PS_PRECESS_ROUGH mode. (r)"); 490 ok_double_tol( outputCoord->d, SPHERE_PRECESS_TP2_EXPECT_D, ERROR_TOL,490 is_double_tol( outputCoord->d, SPHERE_PRECESS_TP2_EXPECT_D, ERROR_TOL, 491 491 "psSpherePrecess: return correct psSphereRot for valid" 492 492 " inputs and PS_PRECESS_ROUGH mode. (d)"); … … 508 508 skip_start( rot == NULL || outputCoord == NULL, 2, 509 509 "Skipping 2 tests because psSphereRot output is NULL!"); 510 ok_double_tol( outputCoord->r, SPHERE_PRECESS_TP3_EXPECT_R, ERROR_TOL,510 is_double_tol( outputCoord->r, SPHERE_PRECESS_TP3_EXPECT_R, ERROR_TOL, 511 511 "psSpherePrecess: return correct psSphereRot for valid" 512 512 " inputs and PS_PRECESS_ROUGH mode. (r)"); 513 ok_double_tol( outputCoord->d, SPHERE_PRECESS_TP3_EXPECT_D, ERROR_TOL,513 is_double_tol( outputCoord->d, SPHERE_PRECESS_TP3_EXPECT_D, ERROR_TOL, 514 514 "psSpherePrecess: return correct psSphereRot for valid" 515 515 " inputs and PS_PRECESS_ROUGH mode. (d)"); -
trunk/psLib/test/astro/tap_psSphereOps_all.c
r12513 r12607 77 77 ok( myST != NULL && psMemCheckSphereRot(myST), 78 78 "psSphereRotAlloc: return allocated SphereRot for valid inputs."); 79 ok_double(q0, myST->q0,79 is_double(q0, myST->q0, 80 80 "psSphereRotAlloc: return correct q0 value."); 81 ok_double(q1, myST->q1,81 is_double(q1, myST->q1, 82 82 "psSphereRotAlloc: return correct q1 value."); 83 ok_double(q2, myST->q2,83 is_double(q2, myST->q2, 84 84 "psSphereRotAlloc: return correct q2 value."); 85 ok_double(q3, myST->q3,85 is_double(q3, myST->q3, 86 86 "psSphereRotAlloc: return correct q3 value."); 87 87 } … … 107 107 ok( myST != NULL && psMemCheckSphereRot(myST), 108 108 "psSphereRotQuat: return allocated SphereRot for valid inputs."); 109 ok_double(q0, myST->q0,109 is_double(q0, myST->q0, 110 110 "psSphereRotQuat: return correct q0 value."); 111 ok_double(q1, myST->q1,111 is_double(q1, myST->q1, 112 112 "psSphereRotQuat: return correct q1 value."); 113 ok_double(q2, myST->q2,113 is_double(q2, myST->q2, 114 114 "psSphereRotQuat: return correct q2 value."); 115 ok_double(q3, myST->q3,115 is_double(q3, myST->q3, 116 116 "psSphereRotQuat: return correct q3 value."); 117 117 } … … 190 190 "Skipping 1 tests because psSphereRotApply failed!"); 191 191 out2 = psSphereRotApply(out2, s1, out); 192 ok_double( out2->r, 0.0,192 is_double( out2->r, 0.0, 193 193 "psSphereRotConjugate: return correct SphereRot values."); 194 ok_double( out2->d, 0.0,194 is_double( out2->d, 0.0, 195 195 "psSphereRotConjugate: return correct SphereRot values."); 196 196 skip_end(); … … 207 207 { 208 208 s1 = psSphereRotInvert(-PHI_P, -DELTA_P, -ALPHA_P); 209 ok_double(s1->q0, myST->q0,209 is_double(s1->q0, myST->q0, 210 210 "psSphereRotInvert: return correct q0 value."); 211 ok_double(s1->q1, myST->q1,211 is_double(s1->q1, myST->q1, 212 212 "psSphereRotInvert: return correct q1 value."); 213 ok_double(s1->q2, myST->q2,213 is_double(s1->q2, myST->q2, 214 214 "psSphereRotInvert: return correct q2 value."); 215 ok_double(s1->q3, myST->q3,215 is_double(s1->q3, myST->q3, 216 216 "psSphereRotInvert: return correct q3 value."); 217 217 psFree(s1); … … 240 240 icrs->d = DEG_TO_RAD(90.0); 241 241 psSphere* ecliptic = psSphereRotApply(NULL, s1, icrs); 242 ok_double_tol(DEG_TO_RAD(90.0), ecliptic->r, 0.00001,242 is_double_tol(DEG_TO_RAD(90.0), ecliptic->r, 0.00001, 243 243 "psSphereRotICRSToEcliptic: return correct SphereRot for MJD_2000 date."); 244 ok_double_tol(DEG_TO_RAD(66.560719), ecliptic->d, 0.00001,244 is_double_tol(DEG_TO_RAD(66.560719), ecliptic->d, 0.00001, 245 245 "psSphereRotICRSToEcliptic: return correct SphereRot for MJD_2000 date."); 246 246 psFree(ecliptic); … … 271 271 psSphere* fromEcliptic = psSphereRotApply(NULL, s2, ecliptic); 272 272 //XXX: Pretty sure the following can be 180 degrees OR 0 degrees. (= the poles) 273 ok_double_tol(DEG_TO_RAD(180.0), fromEcliptic->r, 0.00001,273 is_double_tol(DEG_TO_RAD(180.0), fromEcliptic->r, 0.00001, 274 274 "psSphereRotEclipticToICRS: return correct SphereRot for MJD_2000 date."); 275 ok_double_tol(DEG_TO_RAD(90.0), fromEcliptic->d, 0.00001,275 is_double_tol(DEG_TO_RAD(90.0), fromEcliptic->d, 0.00001, 276 276 "psSphereRotEclipticToICRS: return correct SphereRot for MJD_2000 date."); 277 277 psFree(ecliptic); … … 289 289 s2 = psSphereRotICRSToGalactic(); 290 290 galactic = psSphereRotApply(NULL, s2, icrs); 291 ok_double_tol(DEG_TO_RAD(122.93192), galactic->r, 0.00001,291 is_double_tol(DEG_TO_RAD(122.93192), galactic->r, 0.00001, 292 292 "psSphereRotICRSToGalactic: return correct SphereRot."); 293 ok_double_tol(DEG_TO_RAD(27.12825), galactic->d, 0.00001,293 is_double_tol(DEG_TO_RAD(27.12825), galactic->d, 0.00001, 294 294 "psSphereRotICRSToGalactic: return correct SphereRot."); 295 295 } … … 300 300 psSphere *test = psSphereRotApply(NULL, s1, galactic); 301 301 //XXX: Pretty sure the following can be 180 degrees OR 0 degrees. (= the poles) 302 ok_double_tol(DEG_TO_RAD(180.0), test->r, 0.00001,302 is_double_tol(DEG_TO_RAD(180.0), test->r, 0.00001, 303 303 "psSphereRotGalacticToICRS: return correct SphereRot."); 304 ok_double_tol(DEG_TO_RAD(90.0), test->d, 0.00001,304 is_double_tol(DEG_TO_RAD(90.0), test->d, 0.00001, 305 305 "psSphereRotGalacticToICRS: return correct SphereRot."); 306 306 psFree(test); … … 382 382 output = psSphereGetOffset(origin, offset, PS_SPHERICAL, PS_ARCMIN); 383 383 empty = psSphereGetOffset(origin, offset, PS_SPHERICAL, PS_DEGREE); 384 ok_double_tol(DEG_TO_RAD(empty->r), MIN_TO_RAD(output->r), 0.0001,384 is_double_tol(DEG_TO_RAD(empty->r), MIN_TO_RAD(output->r), 0.0001, 385 385 "psSphereGetOffset: return correct offset for differing units."); 386 ok_double_tol(DEG_TO_RAD(empty->d), MIN_TO_RAD(output->d), 0.0001,386 is_double_tol(DEG_TO_RAD(empty->d), MIN_TO_RAD(output->d), 0.0001, 387 387 "psSphereGetOffset: return correct offset for differing units."); 388 388 psFree(output); … … 426 426 skip_start( output == NULL, 2, 427 427 "Skipping 2 tests because Sphere output is NULL!"); 428 ok_double(output->r, M_PI/4.0,428 is_double(output->r, M_PI/4.0, 429 429 "psSphereSetOffset: return correct spherical offset."); 430 ok_double(output->d, M_PI/6.0,430 is_double(output->d, M_PI/6.0, 431 431 "psSphereSetOffset: return correct spherical offset."); 432 432 skip_end(); … … 443 443 skip_start( empty == NULL, 2, 444 444 "Skipping 2 tests because Sphere output is NULL!"); 445 ok_double_tol(empty->r, offset->r, 0.00001,445 is_double_tol(empty->r, offset->r, 0.00001, 446 446 "psSphereGetOffset: return correct spherical offset."); 447 ok_double_tol(empty->d, offset->d, 0.00001,447 is_double_tol(empty->d, offset->d, 0.00001, 448 448 "psSphereGetOffset: return correct spherical offset."); 449 449 skip_end(); … … 464 464 skip_start( empty == NULL, 2, 465 465 "Skipping 2 tests because Sphere output is NULL!"); 466 ok_double_tol(empty->r, (M_PI / 4.0), 0.0001,466 is_double_tol(empty->r, (M_PI / 4.0), 0.0001, 467 467 "psSphereGetOffset: return correct spherical offset."); 468 ok_double_tol(empty->d, (M_PI / 6.0), 0.0001,468 is_double_tol(empty->d, (M_PI / 6.0), 0.0001, 469 469 "psSphereGetOffset: return correct spherical offset."); 470 470 skip_end(); … … 480 480 offset->d = (M_PI / 6.0); //30 deg 481 481 empty = psSphereSetOffset(origin, offset, PS_SPHERICAL, PS_RADIAN); 482 ok_double_tol(empty->r, offset->r, 0.0001,482 is_double_tol(empty->r, offset->r, 0.0001, 483 483 "psSphereSetOffset: return correct offset for differing units."); 484 ok_double_tol(empty->d, offset->d, 0.0001,484 is_double_tol(empty->d, offset->d, 0.0001, 485 485 "psSphereSetOffset: return correct offset for differing units."); 486 486 psFree(output); -
trunk/psLib/test/astro/tap_psTime_01.c
r12412 r12607 23 23 * @author Eric Van Alst, MHPCC 24 24 * 25 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $26 * @date $Date: 2007-03- 13 00:01:37$25 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 26 * @date $Date: 2007-03-27 22:52:02 $ 27 27 * 28 28 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 187 187 psMemId id = psMemGetId(); 188 188 psF64 ut1Delta = psTimeGetUT1Delta(NULL, PS_IERS_B); 189 ok_double(ut1Delta, NAN, "psTimeGetUT1Delta(NULL, PS_IERS_B) returned NAN");189 is_double(ut1Delta, NAN, "psTimeGetUT1Delta(NULL, PS_IERS_B) returned NAN"); 190 190 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 191 191 } … … 200 200 time->leapsecond = false; 201 201 psF64 ut1Delta = psTimeGetUT1Delta(time, PS_IERS_B); 202 ok_double(ut1Delta, NAN, "psTimeGetUT1Delta() returned NAN for incorrect time");202 is_double(ut1Delta, NAN, "psTimeGetUT1Delta() returned NAN for incorrect time"); 203 203 psFree(time); 204 204 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 214 214 time->leapsecond = false; 215 215 psF64 ut1Delta = psTimeGetUT1Delta(time, -100); 216 ok_double(ut1Delta, NAN, "psTimeGetUT1Delta(time, -100) returned NAN (incorrect bulletin)");216 is_double(ut1Delta, NAN, "psTimeGetUT1Delta(time, -100) returned NAN (incorrect bulletin)"); 217 217 psFree(time); 218 218 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 229 229 psF64 ut1Delta = psTimeGetUT1Delta(time, PS_IERS_A); 230 230 231 ok_double_tol(ut1Delta, testTime1UT1DeltaBullA, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin A");231 is_double_tol(ut1Delta, testTime1UT1DeltaBullA, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin A"); 232 232 233 233 psFree(time); … … 244 244 psF64 ut1Delta = psTimeGetUT1Delta(time, PS_IERS_B); 245 245 246 ok_double_tol(ut1Delta, testTime1UT1DeltaBullB, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B");246 is_double_tol(ut1Delta, testTime1UT1DeltaBullB, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B"); 247 247 248 248 psFree(time); … … 262 262 psF64 ut1Delta = psTimeGetUT1Delta(time,PS_IERS_A); 263 263 264 ok_double_tol(ut1Delta, testTime2UT1DeltaBullA, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B");264 is_double_tol(ut1Delta, testTime2UT1DeltaBullA, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B"); 265 265 266 266 psFree(time); … … 280 280 psF64 ut1Delta = psTimeGetUT1Delta(time,PS_IERS_B); 281 281 282 ok_double_tol(ut1Delta, testTime2UT1DeltaBullB, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B");282 is_double_tol(ut1Delta, testTime2UT1DeltaBullB, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B"); 283 283 284 284 psFree(time); … … 298 298 psF64 ut1Delta = psTimeGetUT1Delta(time,PS_IERS_A); 299 299 300 ok_double_tol(ut1Delta, testTime3UT1DeltaBullA, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B");300 is_double_tol(ut1Delta, testTime3UT1DeltaBullA, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B"); 301 301 302 302 psFree(time); … … 315 315 psF64 ut1Delta = psTimeGetUT1Delta(time,PS_IERS_B); 316 316 317 ok_double_tol(ut1Delta, testTime3UT1DeltaBullB, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B");317 is_double_tol(ut1Delta, testTime3UT1DeltaBullB, ERROR_TOL, "psTimeGetUT1Delta() produced the correct result: bulletin B"); 318 318 319 319 psFree(time); … … 329 329 psMemId id = psMemGetId(); 330 330 psF64 mjd = psTimeToMJD(NULL); 331 ok_double(mjd, NAN, "psTimeToMJD(NULL) returned NULL");331 is_double(mjd, NAN, "psTimeToMJD(NULL) returned NULL"); 332 332 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 333 333 } … … 346 346 time->leapsecond = false; 347 347 psF64 mjd = psTimeToMJD(time); 348 ok_double(mjd, NAN, "psTimeToMJD() returned NAN for incorrect time");348 is_double(mjd, NAN, "psTimeToMJD() returned NAN for incorrect time"); 349 349 psFree(time); 350 350 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 361 361 psF64 mjd = psTimeToMJD(time); 362 362 363 ok_double_tol(mjd, 53207.765929, ERROR_TOL, "psTimeToMJD() returned correct time after 1/1/1970 epoch");363 is_double_tol(mjd, 53207.765929, ERROR_TOL, "psTimeToMJD() returned correct time after 1/1/1970 epoch"); 364 364 365 365 psFree(time); … … 376 376 psF64 mjd = psTimeToMJD(time); 377 377 378 ok_double_tol(mjd, testTime4MJD, ERROR_TOL, "psTimeToMJD() returned correct time before 1/1/1970 epoch");378 is_double_tol(mjd, testTime4MJD, ERROR_TOL, "psTimeToMJD() returned correct time before 1/1/1970 epoch"); 379 379 380 380 psFree(time); … … 391 391 psF64 jd = psTimeToJD(NULL); 392 392 393 ok_double(jd, NAN, "psTimeToJD(NULL) returned NULL");393 is_double(jd, NAN, "psTimeToJD(NULL) returned NULL"); 394 394 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 395 395 } … … 407 407 psF64 jd = psTimeToJD(time); 408 408 409 ok_double(jd, NAN, "psTimeToJD() returned NAN for incorrect time");409 is_double(jd, NAN, "psTimeToJD() returned NAN for incorrect time"); 410 410 411 411 psFree(time); … … 423 423 psF64 jd = psTimeToJD(time); 424 424 425 ok_double_tol(jd, 2453208.265929, ERROR_TOL, "psTimeToJD() returned the correct time after 1/1/1970 epoch");425 is_double_tol(jd, 2453208.265929, ERROR_TOL, "psTimeToJD() returned the correct time after 1/1/1970 epoch"); 426 426 427 427 psFree(time); … … 439 439 psF64 jd = psTimeToJD(time); 440 440 441 ok_double_tol(jd, testTime4JD, ERROR_TOL, "psTimeToJD() returned the correct time before 1/1/1970 epoch");441 is_double_tol(jd, testTime4JD, ERROR_TOL, "psTimeToJD() returned the correct time before 1/1/1970 epoch"); 442 442 443 443 psFree(time); … … 528 528 char *timeStr = psTimeToISO(time); 529 529 530 ok_str(timeStr, testTime1Str, "psTimeToISO(time) returned correct time (no leapsecond)");530 is_str(timeStr, testTime1Str, "psTimeToISO(time) returned correct time (no leapsecond)"); 531 531 532 532 psFree(timeStr); … … 547 547 char *timeStr = psTimeToISO(time); 548 548 549 ok_str(timeStr, testTime1StrLeap, "psTimeToISO(time) returned correct time (with leapsecond)");549 is_str(timeStr, testTime1StrLeap, "psTimeToISO(time) returned correct time (with leapsecond)"); 550 550 551 551 psFree(timeStr); -
trunk/psLib/test/astro/tap_psTime_02.c
r12413 r12607 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2007-03- 13 00:02:14$14 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-03-27 22:52:02 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 66 66 67 67 psF64 lmst = psTimeToLMST(NULL, 0); 68 ok_double(lmst, NAN, "psTimeToLMST(time,0) returned NAN");68 is_double(lmst, NAN, "psTimeToLMST(time,0) returned NAN"); 69 69 70 70 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 82 82 83 83 psF64 lmst = psTimeToLMST(time, 0.0); 84 ok_double_tol(lmst, testTime1LMST0, ERROR_TOL, "psTimeToLMST() returned the correct time");84 is_double_tol(lmst, testTime1LMST0, ERROR_TOL, "psTimeToLMST() returned the correct time"); 85 85 86 86 psFree(time); … … 102 102 103 103 psF64 lmst = psTimeToLMST(time,0.0); 104 ok_double(lmst, NAN, "psTimeToLMST() generated a NAN for incorrect type");104 is_double(lmst, NAN, "psTimeToLMST() generated a NAN for incorrect type"); 105 105 106 106 psFree(time); -
trunk/psLib/test/astro/tap_psTime_03.c
r12414 r12607 11 11 * @author Eric Van Alst, MHPCC 12 12 * 13 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2007-03- 13 00:19:21$13 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2007-03-27 22:52:02 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 326 326 327 327 psF64 delta = psTimeDelta(NULL, NULL); 328 ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(NULL, NULL) returned 0.0");328 is_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(NULL, NULL) returned 0.0"); 329 329 330 330 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 341 341 342 342 psF64 delta = psTimeDelta(time1, NULL); 343 ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0");343 is_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0"); 344 344 345 345 psFree(time1); … … 360 360 361 361 psF64 delta = psTimeDelta(time1, time2); 362 ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for unallowed time1 arg");362 is_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for unallowed time1 arg"); 363 363 364 364 psFree(time1); … … 382 382 383 383 psF64 delta = psTimeDelta(time1, time2); 384 ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for unallowed time2 arg");384 is_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for unallowed time2 arg"); 385 385 386 386 psFree(time1); … … 406 406 407 407 psF64 delta = psTimeDelta(time1, time2); 408 ok_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for different time types");408 is_double_tol(delta, 0.0, ERROR_TOL, "psTimeDelta(time1, NULL) returned 0.0 for different time types"); 409 409 410 410 psFree(time1); … … 428 428 429 429 psF64 delta = psTimeDelta(time2, time1); 430 ok_double_tol(delta, deltaTime1, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");430 is_double_tol(delta, deltaTime1, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type"); 431 431 432 432 psFree(time1); … … 451 451 452 452 psF64 delta = psTimeDelta(time2,time1); 453 ok_double_tol(delta, deltaTime2, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");453 is_double_tol(delta, deltaTime2, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type"); 454 454 455 455 psFree(time1); … … 474 474 475 475 psF64 delta = psTimeDelta(time2,time1); 476 ok_double_tol(delta, deltaTime3, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type");476 is_double_tol(delta, deltaTime3, ERROR_TOL, "psTimeDelta(time1, NULL) returned correct delta for times of the same type"); 477 477 478 478 psFree(time1); … … 494 494 // Verify TAI ISO string 495 495 char *timeStr = psTimeToISO(time); 496 ok_str(timeStr, testTimeBStrTAI[i], "TAI ISO string");496 is_str(timeStr, testTimeBStrTAI[i], "TAI ISO string"); 497 497 psFree(timeStr); 498 498 499 499 time = psTimeConvert(time, PS_TIME_TT); 500 500 timeStr = psTimeToISO(time); 501 ok_str(timeStr, testTimeBStrTT[i], "TT ISO string");501 is_str(timeStr, testTimeBStrTT[i], "TT ISO string"); 502 502 psFree(timeStr); 503 503 … … 506 506 time->leapsecond = testTimeBLeapsecond[i]; 507 507 timeStr = psTimeToISO(time); 508 ok_str(timeStr, testTimeBStrUTC[i], "UTC ISO string");508 is_str(timeStr, testTimeBStrUTC[i], "UTC ISO string"); 509 509 psFree(timeStr); 510 510 511 511 time = psTimeConvert(time, PS_TIME_UT1); 512 512 timeStr = psTimeToISO(time); 513 ok_str(timeStr, testTimeBStrUT1[i], "UT1 ISO string");513 is_str(timeStr, testTimeBStrUT1[i], "UT1 ISO string"); 514 514 psFree(timeStr); 515 515 -
trunk/psLib/test/db/tap_psDB.c
r12393 r12607 6 6 * @author Joshua Hoblitt, University of Hawaii 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-03- 10 01:24:09$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-03-27 22:52:02 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 164 164 // XXX this test is depending on the order the rows come out it... 165 165 // this shouldn't be depended upon 166 ok_str((char *)column->data[0], "brown", "horse.color == 'brown'");166 is_str((char *)column->data[0], "brown", "horse.color == 'brown'"); 167 167 ok((char *)column->data[1] == NULL, "horse.color == NULL"); 168 ok_str((char *)column->data[2], "pink", "horse.color == 'pink'");168 is_str((char *)column->data[2], "pink", "horse.color == 'pink'"); 169 169 170 170 psFree(column); … … 177 177 is_long(psVectorLength(column), 2, "psDBSelectColumnNum() - number of elements"); 178 178 179 ok_float(column->data.F32[0], 10e3, "hair == 10e3")180 ok_float(column->data.F32[1], NAN, "hair == NAN")179 is_float(column->data.F32[0], 10e3, "hair == 10e3") 180 is_float(column->data.F32[1], NAN, "hair == NAN") 181 181 182 182 psFree(column); … … 197 197 198 198 psMetadataItem *item = psListGet(md->list, 0); 199 ok_str(item->name, "color", "column name");200 ok_str((char *)item->data.V, "brown", "column value");199 is_str(item->name, "color", "column name"); 200 is_str((char *)item->data.V, "brown", "column value"); 201 201 } 202 202 psFree(resultSet); … … 219 219 220 220 psMetadataItem *item = psListGet(columns->list, 0); 221 ok_str(item->name, "color", "column name");221 is_str(item->name, "color", "column name"); 222 222 is_long(psArrayLength((psArray*)item->data.V), 3, "column array length"); 223 223 … … 245 245 246 246 psMetadataItem *item = psListGet(md->list, 0); 247 ok_str((char *)item->data.V, "HOT pink", "psDBUpdateRows() - psDBSelectRows() found HOT pink");247 is_str((char *)item->data.V, "HOT pink", "psDBUpdateRows() - psDBSelectRows() found HOT pink"); 248 248 249 249 } -
trunk/psLib/test/imageops/tap_psImageShift.c
r12513 r12607 28 28 // integer shifts should be exact 29 29 psImage *shift = psImageShift (NULL, image, 1.0, 1.0, 0.0, PS_INTERPOLATE_BILINEAR); 30 ok_float (shift->data.F32[10][10], 0.0, "point 10,10 should be 0.0 : %f", shift->data.F32[10][10]);31 ok_float (shift->data.F32[10][11], 0.0, "point 10,11 should be 0.0 : %f", shift->data.F32[10][11]);32 ok_float (shift->data.F32[10][12], 0.0, "point 10,12 should be 0.0 : %f", shift->data.F32[10][12]);33 ok_float (shift->data.F32[11][10], 0.0, "point 11,10 should be 0.0 : %f", shift->data.F32[11][10]);34 ok_float (shift->data.F32[11][11], 1.0, "point 11,11 should be 1.0 : %f", shift->data.F32[11][11]);35 ok_float (shift->data.F32[11][12], 0.0, "point 11,12 should be 0.0 : %f", shift->data.F32[11][12]);36 ok_float (shift->data.F32[12][10], 0.0, "point 12,10 should be 0.0 : %f", shift->data.F32[12][10]);37 ok_float (shift->data.F32[12][11], 0.0, "point 12,11 should be 0.0 : %f", shift->data.F32[12][11]);38 ok_float (shift->data.F32[12][12], 0.0, "point 12,12 should be 0.0 : %f", shift->data.F32[12][12]);30 is_float (shift->data.F32[10][10], 0.0, "point 10,10 should be 0.0 : %f", shift->data.F32[10][10]); 31 is_float (shift->data.F32[10][11], 0.0, "point 10,11 should be 0.0 : %f", shift->data.F32[10][11]); 32 is_float (shift->data.F32[10][12], 0.0, "point 10,12 should be 0.0 : %f", shift->data.F32[10][12]); 33 is_float (shift->data.F32[11][10], 0.0, "point 11,10 should be 0.0 : %f", shift->data.F32[11][10]); 34 is_float (shift->data.F32[11][11], 1.0, "point 11,11 should be 1.0 : %f", shift->data.F32[11][11]); 35 is_float (shift->data.F32[11][12], 0.0, "point 11,12 should be 0.0 : %f", shift->data.F32[11][12]); 36 is_float (shift->data.F32[12][10], 0.0, "point 12,10 should be 0.0 : %f", shift->data.F32[12][10]); 37 is_float (shift->data.F32[12][11], 0.0, "point 12,11 should be 0.0 : %f", shift->data.F32[12][11]); 38 is_float (shift->data.F32[12][12], 0.0, "point 12,12 should be 0.0 : %f", shift->data.F32[12][12]); 39 39 psFree(shift); 40 40 psFree(image); … … 64 64 psImage *shift = psImageShift (NULL, image, 0.2, 0.4, 0.0, PS_INTERPOLATE_BILINEAR); 65 65 // diag("these require tolerance of 4 epsilon (why?)"); 66 ok_float_tol (shift->data.F32[10][10], 0.8*0.6, 4*FLT_EPSILON, "point 10,10 should be %f : %f", 0.8*0.6, shift->data.F32[10][10]);67 ok_float_tol (shift->data.F32[10][11], 0.2*0.6, 4*FLT_EPSILON, "point 10,11 should be %f : %f", 0.2*0.6, shift->data.F32[10][11]);68 ok_float_tol (shift->data.F32[10][12], 0.0, 4*FLT_EPSILON, "point 10,12 should be %f : %f", 0.0, shift->data.F32[10][12]);69 ok_float_tol (shift->data.F32[11][10], 0.8*0.4, 4*FLT_EPSILON, "point 11,10 should be %f : %f", 0.8*0.4, shift->data.F32[11][10]);70 ok_float_tol (shift->data.F32[11][11], 0.2*0.4, 4*FLT_EPSILON, "point 11,11 should be %f : %f", 0.2*0.4, shift->data.F32[11][11]);71 ok_float_tol (shift->data.F32[11][12], 0.0, 4*FLT_EPSILON, "point 11,12 should be %f : %f", 0.0, shift->data.F32[11][12]);72 ok_float_tol (shift->data.F32[12][10], 0.0, 4*FLT_EPSILON, "point 12,10 should be %f : %f", 0.0, shift->data.F32[12][10]);73 ok_float_tol (shift->data.F32[12][11], 0.0, 4*FLT_EPSILON, "point 12,11 should be %f : %f", 0.0, shift->data.F32[12][11]);74 ok_float_tol (shift->data.F32[12][12], 0.0, 4*FLT_EPSILON, "point 12,12 should be %f : %f", 0.0, shift->data.F32[12][12]);66 is_float_tol (shift->data.F32[10][10], 0.8*0.6, 4*FLT_EPSILON, "point 10,10 should be %f : %f", 0.8*0.6, shift->data.F32[10][10]); 67 is_float_tol (shift->data.F32[10][11], 0.2*0.6, 4*FLT_EPSILON, "point 10,11 should be %f : %f", 0.2*0.6, shift->data.F32[10][11]); 68 is_float_tol (shift->data.F32[10][12], 0.0, 4*FLT_EPSILON, "point 10,12 should be %f : %f", 0.0, shift->data.F32[10][12]); 69 is_float_tol (shift->data.F32[11][10], 0.8*0.4, 4*FLT_EPSILON, "point 11,10 should be %f : %f", 0.8*0.4, shift->data.F32[11][10]); 70 is_float_tol (shift->data.F32[11][11], 0.2*0.4, 4*FLT_EPSILON, "point 11,11 should be %f : %f", 0.2*0.4, shift->data.F32[11][11]); 71 is_float_tol (shift->data.F32[11][12], 0.0, 4*FLT_EPSILON, "point 11,12 should be %f : %f", 0.0, shift->data.F32[11][12]); 72 is_float_tol (shift->data.F32[12][10], 0.0, 4*FLT_EPSILON, "point 12,10 should be %f : %f", 0.0, shift->data.F32[12][10]); 73 is_float_tol (shift->data.F32[12][11], 0.0, 4*FLT_EPSILON, "point 12,11 should be %f : %f", 0.0, shift->data.F32[12][11]); 74 is_float_tol (shift->data.F32[12][12], 0.0, 4*FLT_EPSILON, "point 12,12 should be %f : %f", 0.0, shift->data.F32[12][12]); 75 75 psFree(shift); 76 76 psFree(image); … … 117 117 118 118 // diag ("these require a tolerance of 100 epsilon"); 119 ok_float_tol (xo, 16.0, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.0, xo);120 ok_float_tol (xo, 16.0, 100*FLT_EPSILON, "y-centroid should be %f : %f", 16.0, yo);119 is_float_tol (xo, 16.0, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.0, xo); 120 is_float_tol (xo, 16.0, 100*FLT_EPSILON, "y-centroid should be %f : %f", 16.0, yo); 121 121 122 122 // fractional shifts introduce smoothing, … … 137 137 138 138 // diag ("these require a tolerance of 100 epsilon"); 139 ok_float_tol (xo, 17.2, 100*FLT_EPSILON, "x-centroid should be %f : %f", 17.2, xo);140 ok_float_tol (yo, 14.8, 100*FLT_EPSILON, "y-centroid should be %f : %f", 14.8, yo);139 is_float_tol (xo, 17.2, 100*FLT_EPSILON, "x-centroid should be %f : %f", 17.2, xo); 140 is_float_tol (yo, 14.8, 100*FLT_EPSILON, "y-centroid should be %f : %f", 14.8, yo); 141 141 142 142 psFree(shift); … … 161 161 // fractional shifts introduce smoothing, 162 162 psImage *shift = psImageShift (NULL, image, 0.2, 0.4, 0.0, PS_INTERPOLATE_BICUBE); 163 ok_float_tol (shift->data.F32[10][10], -0.157778, 4*FLT_EPSILON, "point 10,10 should be %f : %f", -0.157778, shift->data.F32[10][10]);164 ok_float_tol (shift->data.F32[10][11], +0.168889, 4*FLT_EPSILON, "point 10,11 should be %f : %f", +0.168889, shift->data.F32[10][11]);165 ok_float_tol (shift->data.F32[10][12], -0.131111, 4*FLT_EPSILON, "point 10,12 should be %f : %f", -0.131111, shift->data.F32[10][12]);166 ok_float_tol (shift->data.F32[11][10], +0.142221, 4*FLT_EPSILON, "point 11,10 should be %f : %f", +0.142221, shift->data.F32[11][10]);167 ok_float_tol (shift->data.F32[11][11], +0.488884, 4*FLT_EPSILON, "point 11,11 should be %f : %f", +0.488884, shift->data.F32[11][11]);168 ok_float_tol (shift->data.F32[11][12], +0.208878, 4*FLT_EPSILON, "point 11,12 should be %f : %f", +0.208878, shift->data.F32[11][12]);169 ok_float_tol (shift->data.F32[12][10], -0.064500, 4*FLT_EPSILON, "point 12,10 should be %f : %f", -0.064500, shift->data.F32[12][10]);170 ok_float_tol (shift->data.F32[12][11], +0.302066, 4*FLT_EPSILON, "point 12,11 should be %f : %f", +0.302066, shift->data.F32[12][11]);171 ok_float_tol (shift->data.F32[12][12], +0.041884, 4*FLT_EPSILON, "point 12,12 should be %f : %f", +0.041884, shift->data.F32[12][12]);163 is_float_tol (shift->data.F32[10][10], -0.157778, 4*FLT_EPSILON, "point 10,10 should be %f : %f", -0.157778, shift->data.F32[10][10]); 164 is_float_tol (shift->data.F32[10][11], +0.168889, 4*FLT_EPSILON, "point 10,11 should be %f : %f", +0.168889, shift->data.F32[10][11]); 165 is_float_tol (shift->data.F32[10][12], -0.131111, 4*FLT_EPSILON, "point 10,12 should be %f : %f", -0.131111, shift->data.F32[10][12]); 166 is_float_tol (shift->data.F32[11][10], +0.142221, 4*FLT_EPSILON, "point 11,10 should be %f : %f", +0.142221, shift->data.F32[11][10]); 167 is_float_tol (shift->data.F32[11][11], +0.488884, 4*FLT_EPSILON, "point 11,11 should be %f : %f", +0.488884, shift->data.F32[11][11]); 168 is_float_tol (shift->data.F32[11][12], +0.208878, 4*FLT_EPSILON, "point 11,12 should be %f : %f", +0.208878, shift->data.F32[11][12]); 169 is_float_tol (shift->data.F32[12][10], -0.064500, 4*FLT_EPSILON, "point 12,10 should be %f : %f", -0.064500, shift->data.F32[12][10]); 170 is_float_tol (shift->data.F32[12][11], +0.302066, 4*FLT_EPSILON, "point 12,11 should be %f : %f", +0.302066, shift->data.F32[12][11]); 171 is_float_tol (shift->data.F32[12][12], +0.041884, 4*FLT_EPSILON, "point 12,12 should be %f : %f", +0.041884, shift->data.F32[12][12]); 172 172 psFree(shift); 173 173 psFree(image); -
trunk/psLib/test/imageops/tap_psImageShiftKernel.c
r12513 r12607 29 29 // integer shifts should be exact 30 30 psImage *shift = psImageShiftKernel (NULL, image, 1.0, 1.0, PS_INTERPOLATE_BILINEAR); 31 ok_float (shift->data.F32[10][10], 0.0, "point 10,10 should be 0.0 : %f", shift->data.F32[10][10]);32 ok_float (shift->data.F32[10][11], 0.0, "point 10,11 should be 0.0 : %f", shift->data.F32[10][11]);33 ok_float (shift->data.F32[10][12], 0.0, "point 10,12 should be 0.0 : %f", shift->data.F32[10][12]);34 ok_float (shift->data.F32[11][10], 0.0, "point 11,10 should be 0.0 : %f", shift->data.F32[11][10]);35 ok_float (shift->data.F32[11][11], 1.0, "point 11,11 should be 1.0 : %f", shift->data.F32[11][11]);36 ok_float (shift->data.F32[11][12], 0.0, "point 11,12 should be 0.0 : %f", shift->data.F32[11][12]);37 ok_float (shift->data.F32[12][10], 0.0, "point 12,10 should be 0.0 : %f", shift->data.F32[12][10]);38 ok_float (shift->data.F32[12][11], 0.0, "point 12,11 should be 0.0 : %f", shift->data.F32[12][11]);39 ok_float (shift->data.F32[12][12], 0.0, "point 12,12 should be 0.0 : %f", shift->data.F32[12][12]);31 is_float (shift->data.F32[10][10], 0.0, "point 10,10 should be 0.0 : %f", shift->data.F32[10][10]); 32 is_float (shift->data.F32[10][11], 0.0, "point 10,11 should be 0.0 : %f", shift->data.F32[10][11]); 33 is_float (shift->data.F32[10][12], 0.0, "point 10,12 should be 0.0 : %f", shift->data.F32[10][12]); 34 is_float (shift->data.F32[11][10], 0.0, "point 11,10 should be 0.0 : %f", shift->data.F32[11][10]); 35 is_float (shift->data.F32[11][11], 1.0, "point 11,11 should be 1.0 : %f", shift->data.F32[11][11]); 36 is_float (shift->data.F32[11][12], 0.0, "point 11,12 should be 0.0 : %f", shift->data.F32[11][12]); 37 is_float (shift->data.F32[12][10], 0.0, "point 12,10 should be 0.0 : %f", shift->data.F32[12][10]); 38 is_float (shift->data.F32[12][11], 0.0, "point 12,11 should be 0.0 : %f", shift->data.F32[12][11]); 39 is_float (shift->data.F32[12][12], 0.0, "point 12,12 should be 0.0 : %f", shift->data.F32[12][12]); 40 40 psFree(shift); 41 41 psFree(image); … … 66 66 psImage *shift = psImageShiftKernel (NULL, image, 0.2, 0.4, PS_INTERPOLATE_BICUBE); 67 67 // diag("these require tolerance of 4 epsilon (why?)"); 68 ok_float_tol (shift->data.F32[10][10], 0.8*0.6, 4*FLT_EPSILON, "point 10,10 should be %f : %f", 0.8*0.6, shift->data.F32[10][10]);69 ok_float_tol (shift->data.F32[10][11], 0.2*0.6, 4*FLT_EPSILON, "point 10,11 should be %f : %f", 0.2*0.6, shift->data.F32[10][11]);70 ok_float_tol (shift->data.F32[10][12], 0.0, 4*FLT_EPSILON, "point 10,12 should be %f : %f", 0.0, shift->data.F32[10][12]);71 ok_float_tol (shift->data.F32[11][10], 0.8*0.4, 4*FLT_EPSILON, "point 11,10 should be %f : %f", 0.8*0.4, shift->data.F32[11][10]);72 ok_float_tol (shift->data.F32[11][11], 0.2*0.4, 4*FLT_EPSILON, "point 11,11 should be %f : %f", 0.2*0.4, shift->data.F32[11][11]);73 ok_float_tol (shift->data.F32[11][12], 0.0, 4*FLT_EPSILON, "point 11,12 should be %f : %f", 0.0, shift->data.F32[11][12]);74 ok_float_tol (shift->data.F32[12][10], 0.0, 4*FLT_EPSILON, "point 12,10 should be %f : %f", 0.0, shift->data.F32[12][10]);75 ok_float_tol (shift->data.F32[12][11], 0.0, 4*FLT_EPSILON, "point 12,11 should be %f : %f", 0.0, shift->data.F32[12][11]);76 ok_float_tol (shift->data.F32[12][12], 0.0, 4*FLT_EPSILON, "point 12,12 should be %f : %f", 0.0, shift->data.F32[12][12]);68 is_float_tol (shift->data.F32[10][10], 0.8*0.6, 4*FLT_EPSILON, "point 10,10 should be %f : %f", 0.8*0.6, shift->data.F32[10][10]); 69 is_float_tol (shift->data.F32[10][11], 0.2*0.6, 4*FLT_EPSILON, "point 10,11 should be %f : %f", 0.2*0.6, shift->data.F32[10][11]); 70 is_float_tol (shift->data.F32[10][12], 0.0, 4*FLT_EPSILON, "point 10,12 should be %f : %f", 0.0, shift->data.F32[10][12]); 71 is_float_tol (shift->data.F32[11][10], 0.8*0.4, 4*FLT_EPSILON, "point 11,10 should be %f : %f", 0.8*0.4, shift->data.F32[11][10]); 72 is_float_tol (shift->data.F32[11][11], 0.2*0.4, 4*FLT_EPSILON, "point 11,11 should be %f : %f", 0.2*0.4, shift->data.F32[11][11]); 73 is_float_tol (shift->data.F32[11][12], 0.0, 4*FLT_EPSILON, "point 11,12 should be %f : %f", 0.0, shift->data.F32[11][12]); 74 is_float_tol (shift->data.F32[12][10], 0.0, 4*FLT_EPSILON, "point 12,10 should be %f : %f", 0.0, shift->data.F32[12][10]); 75 is_float_tol (shift->data.F32[12][11], 0.0, 4*FLT_EPSILON, "point 12,11 should be %f : %f", 0.0, shift->data.F32[12][11]); 76 is_float_tol (shift->data.F32[12][12], 0.0, 4*FLT_EPSILON, "point 12,12 should be %f : %f", 0.0, shift->data.F32[12][12]); 77 77 psFree(shift); 78 78 psFree(image); … … 118 118 119 119 // diag ("these require a tolerance of 100 epsilon"); 120 ok_float_tol (xo, 16.0, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.0, xo);121 ok_float_tol (xo, 16.0, 100*FLT_EPSILON, "y-centroid should be %f : %f", 16.0, yo);120 is_float_tol (xo, 16.0, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.0, xo); 121 is_float_tol (xo, 16.0, 100*FLT_EPSILON, "y-centroid should be %f : %f", 16.0, yo); 122 122 123 123 // fractional shifts introduce smoothing, … … 137 137 138 138 // diag ("these require a tolerance of 100 epsilon"); 139 ok_float_tol (xo, 17.2, 100*FLT_EPSILON, "x-centroid should be %f : %f", 17.2, xo);140 ok_float_tol (yo, 14.8, 100*FLT_EPSILON, "y-centroid should be %f : %f", 14.8, yo);139 is_float_tol (xo, 17.2, 100*FLT_EPSILON, "x-centroid should be %f : %f", 17.2, xo); 140 is_float_tol (yo, 14.8, 100*FLT_EPSILON, "y-centroid should be %f : %f", 14.8, yo); 141 141 142 142 psFree(shift); … … 162 162 psImage *shift = psImageShiftKernel (NULL, image, 0.2, 0.4, PS_INTERPOLATE_BICUBE); 163 163 // diag ("please check these values: this kernel is very steep and ringy. what is the right BICUBE kernel?"); 164 ok_float_tol (shift->data.F32[10][10], -1.444445, 4*FLT_EPSILON, "point 10,10 should be %f : %f", -1.444445, shift->data.F32[10][10]);165 ok_float_tol (shift->data.F32[10][11], -0.277778, 4*FLT_EPSILON, "point 10,11 should be %f : %f", -0.277778, shift->data.F32[10][11]);166 ok_float_tol (shift->data.F32[10][12], -0.777778, 4*FLT_EPSILON, "point 10,12 should be %f : %f", -0.777778, shift->data.F32[10][12]);167 ok_float_tol (shift->data.F32[11][10], +0.055556, 4*FLT_EPSILON, "point 11,10 should be %f : %f", +0.055556, shift->data.F32[11][10]);168 ok_float_tol (shift->data.F32[11][11], +1.222222, 4*FLT_EPSILON, "point 11,11 should be %f : %f", +1.222222, shift->data.F32[11][11]);169 ok_float_tol (shift->data.F32[11][12], +0.722222, 4*FLT_EPSILON, "point 11,12 should be %f : %f", +0.722222, shift->data.F32[11][12]);170 ok_float_tol (shift->data.F32[12][10], -0.111111, 4*FLT_EPSILON, "point 12,10 should be %f : %f", -0.111111, shift->data.F32[12][10]);171 ok_float_tol (shift->data.F32[12][11], +1.055556, 4*FLT_EPSILON, "point 12,11 should be %f : %f", +1.055556, shift->data.F32[12][11]);172 ok_float_tol (shift->data.F32[12][12], +0.555556, 4*FLT_EPSILON, "point 12,12 should be %f : %f", +0.555556, shift->data.F32[12][12]);164 is_float_tol (shift->data.F32[10][10], -1.444445, 4*FLT_EPSILON, "point 10,10 should be %f : %f", -1.444445, shift->data.F32[10][10]); 165 is_float_tol (shift->data.F32[10][11], -0.277778, 4*FLT_EPSILON, "point 10,11 should be %f : %f", -0.277778, shift->data.F32[10][11]); 166 is_float_tol (shift->data.F32[10][12], -0.777778, 4*FLT_EPSILON, "point 10,12 should be %f : %f", -0.777778, shift->data.F32[10][12]); 167 is_float_tol (shift->data.F32[11][10], +0.055556, 4*FLT_EPSILON, "point 11,10 should be %f : %f", +0.055556, shift->data.F32[11][10]); 168 is_float_tol (shift->data.F32[11][11], +1.222222, 4*FLT_EPSILON, "point 11,11 should be %f : %f", +1.222222, shift->data.F32[11][11]); 169 is_float_tol (shift->data.F32[11][12], +0.722222, 4*FLT_EPSILON, "point 11,12 should be %f : %f", +0.722222, shift->data.F32[11][12]); 170 is_float_tol (shift->data.F32[12][10], -0.111111, 4*FLT_EPSILON, "point 12,10 should be %f : %f", -0.111111, shift->data.F32[12][10]); 171 is_float_tol (shift->data.F32[12][11], +1.055556, 4*FLT_EPSILON, "point 12,11 should be %f : %f", +1.055556, shift->data.F32[12][11]); 172 is_float_tol (shift->data.F32[12][12], +0.555556, 4*FLT_EPSILON, "point 12,12 should be %f : %f", +0.555556, shift->data.F32[12][12]); 173 173 174 174 psFree(shift); … … 216 216 217 217 // diag ("these require a tolerance of 100 epsilon"); 218 ok_float_tol (xo, 16.0, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.0, xo);219 ok_float_tol (xo, 16.0, 100*FLT_EPSILON, "y-centroid should be %f : %f", 16.0, yo);218 is_float_tol (xo, 16.0, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.0, xo); 219 is_float_tol (xo, 16.0, 100*FLT_EPSILON, "y-centroid should be %f : %f", 16.0, yo); 220 220 221 221 // fractional shifts introduce smoothing, … … 236 236 237 237 // diag ("these require a tolerance of 100 epsilon"); 238 ok_float_tol (xo, 16.2, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.2, xo);239 ok_float_tol (yo, 15.8, 100*FLT_EPSILON, "y-centroid should be %f : %f", 15.8, yo);238 is_float_tol (xo, 16.2, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.2, xo); 239 is_float_tol (yo, 15.8, 100*FLT_EPSILON, "y-centroid should be %f : %f", 15.8, yo); 240 240 241 241 psFree(shift); … … 260 260 // fractional shifts introduce smoothing, 261 261 psImage *shift = psImageShiftKernel (NULL, image, 0.0, 0.0, PS_INTERPOLATE_GAUSS); 262 ok_float_tol (shift->data.F32[10][10], -0.157778, 4*FLT_EPSILON, "point 10,10 should be %f : %f", -0.157778, shift->data.F32[10][10]);263 ok_float_tol (shift->data.F32[10][11], +0.168889, 4*FLT_EPSILON, "point 10,11 should be %f : %f", +0.168889, shift->data.F32[10][11]);264 ok_float_tol (shift->data.F32[10][12], -0.131111, 4*FLT_EPSILON, "point 10,12 should be %f : %f", -0.131111, shift->data.F32[10][12]);265 ok_float_tol (shift->data.F32[11][10], +0.142221, 4*FLT_EPSILON, "point 11,10 should be %f : %f", +0.142221, shift->data.F32[11][10]);266 ok_float_tol (shift->data.F32[11][11], +0.488884, 4*FLT_EPSILON, "point 11,11 should be %f : %f", +0.488884, shift->data.F32[11][11]);267 ok_float_tol (shift->data.F32[11][12], +0.208878, 4*FLT_EPSILON, "point 11,12 should be %f : %f", +0.208878, shift->data.F32[11][12]);268 ok_float_tol (shift->data.F32[12][10], -0.064500, 4*FLT_EPSILON, "point 12,10 should be %f : %f", -0.064500, shift->data.F32[12][10]);269 ok_float_tol (shift->data.F32[12][11], +0.302066, 4*FLT_EPSILON, "point 12,11 should be %f : %f", +0.302066, shift->data.F32[12][11]);270 ok_float_tol (shift->data.F32[12][12], +0.041884, 4*FLT_EPSILON, "point 12,12 should be %f : %f", +0.041884, shift->data.F32[12][12]);262 is_float_tol (shift->data.F32[10][10], -0.157778, 4*FLT_EPSILON, "point 10,10 should be %f : %f", -0.157778, shift->data.F32[10][10]); 263 is_float_tol (shift->data.F32[10][11], +0.168889, 4*FLT_EPSILON, "point 10,11 should be %f : %f", +0.168889, shift->data.F32[10][11]); 264 is_float_tol (shift->data.F32[10][12], -0.131111, 4*FLT_EPSILON, "point 10,12 should be %f : %f", -0.131111, shift->data.F32[10][12]); 265 is_float_tol (shift->data.F32[11][10], +0.142221, 4*FLT_EPSILON, "point 11,10 should be %f : %f", +0.142221, shift->data.F32[11][10]); 266 is_float_tol (shift->data.F32[11][11], +0.488884, 4*FLT_EPSILON, "point 11,11 should be %f : %f", +0.488884, shift->data.F32[11][11]); 267 is_float_tol (shift->data.F32[11][12], +0.208878, 4*FLT_EPSILON, "point 11,12 should be %f : %f", +0.208878, shift->data.F32[11][12]); 268 is_float_tol (shift->data.F32[12][10], -0.064500, 4*FLT_EPSILON, "point 12,10 should be %f : %f", -0.064500, shift->data.F32[12][10]); 269 is_float_tol (shift->data.F32[12][11], +0.302066, 4*FLT_EPSILON, "point 12,11 should be %f : %f", +0.302066, shift->data.F32[12][11]); 270 is_float_tol (shift->data.F32[12][12], +0.041884, 4*FLT_EPSILON, "point 12,12 should be %f : %f", +0.041884, shift->data.F32[12][12]); 271 271 psFree(shift); 272 272 psFree(image); … … 313 313 314 314 // diag ("these require a tolerance of 100 epsilon"); 315 ok_float_tol (xo, 16.0, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.0, xo);316 ok_float_tol (xo, 16.0, 100*FLT_EPSILON, "y-centroid should be %f : %f", 16.0, yo);315 is_float_tol (xo, 16.0, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.0, xo); 316 is_float_tol (xo, 16.0, 100*FLT_EPSILON, "y-centroid should be %f : %f", 16.0, yo); 317 317 318 318 // fractional shifts introduce smoothing, … … 333 333 334 334 // diag ("these require a tolerance of 100 epsilon"); 335 ok_float_tol (xo, 16.2, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.2, xo);336 ok_float_tol (yo, 15.8, 100*FLT_EPSILON, "y-centroid should be %f : %f", 15.8, yo);335 is_float_tol (xo, 16.2, 100*FLT_EPSILON, "x-centroid should be %f : %f", 16.2, xo); 336 is_float_tol (yo, 15.8, 100*FLT_EPSILON, "y-centroid should be %f : %f", 15.8, yo); 337 337 338 338 psFits *fits = psFitsOpen ("gauss.fits", "w"); -
trunk/psLib/test/math/tap_psPolynomialUtils_Derivatives.c
r10848 r12607 42 42 ok(dX->nY == 2, "new y order is %d", dX->nY); 43 43 44 ok_float(dX->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", dX->coeff[0][0]);45 ok_float(dX->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", dX->coeff[1][0]);46 ok_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]);44 is_float(dX->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", dX->coeff[0][0]); 45 is_float(dX->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", dX->coeff[1][0]); 46 is_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]); 47 47 48 48 ok(!dX->mask[0][0], "x^0 y^0 coeff is unmasked"); … … 91 91 ok(dX->nY == 2, "new y order is %d", dX->nY); 92 92 93 ok_float(dX->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", dX->coeff[0][0]);94 ok_float(dX->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", dX->coeff[1][0]);95 ok_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]);93 is_float(dX->coeff[0][0], +2.0, "x^0 y^0 coeff is %f", dX->coeff[0][0]); 94 is_float(dX->coeff[1][0], -6.0, "x^1 y^0 coeff is %f", dX->coeff[1][0]); 95 is_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]); 96 96 97 97 ok(!dX->mask[0][0], "x^0 y^0 coeff is unmasked"); … … 172 172 ok(dY->nY == 1, "new y order is %d", dY->nY); 173 173 174 ok_float(dY->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", dY->coeff[0][0]);175 ok_float(dY->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", dY->coeff[1][0]);176 ok_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]);174 is_float(dY->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", dY->coeff[0][0]); 175 is_float(dY->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", dY->coeff[1][0]); 176 is_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]); 177 177 178 178 ok(!dY->mask[0][0], "x^0 y^0 coeff is unmasked"); … … 221 221 ok(dY->nY == 1, "new y order is %d", dY->nY); 222 222 223 ok_float(dY->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", dY->coeff[0][0]);224 ok_float(dY->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", dY->coeff[1][0]);225 ok_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]);223 is_float(dY->coeff[0][0], +3.0, "x^0 y^0 coeff is %f", dY->coeff[0][0]); 224 is_float(dY->coeff[1][0], +4.0, "x^1 y^0 coeff is %f", dY->coeff[1][0]); 225 is_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]); 226 226 227 227 ok(!dY->mask[0][0], "x^0 y^0 coeff is unmasked"); -
trunk/psLib/test/math/tap_psRandom.c
r10945 r12607 39 39 #define ERROR_TOLERANCE 0.2 40 40 #define VERBOSE 0 41 # define ok_float_tol_per(VALUE,EXPECT,TOL,COMMENT, ...)\41 # define is_float_tol_per(VALUE,EXPECT,TOL,COMMENT, ...)\ 42 42 ok((fabs((VALUE)-(EXPECT)) < (TOL)), COMMENT, ## __VA_ARGS__); 43 43 … … 102 102 103 103 // Verify mean and stdev 104 ok_float_tol_per(stats->sampleMean, UNIFORM_MEAN, ERROR_TOLERANCE, "Mean is within expected range");105 ok_float_tol_per(stats->sampleStdev, UNIFORM_STDEV, ERROR_TOLERANCE, "StDev is within expected range");104 is_float_tol_per(stats->sampleMean, UNIFORM_MEAN, ERROR_TOLERANCE, "Mean is within expected range"); 105 is_float_tol_per(stats->sampleStdev, UNIFORM_STDEV, ERROR_TOLERANCE, "StDev is within expected range"); 106 106 107 107 skip_end(); … … 143 143 144 144 // Verify mean and stdev 145 ok_float_tol_per(stats->sampleMean, GAUSSIAN_MEAN, ERROR_TOLERANCE, "Mean is within expected range");146 ok_float_tol_per(stats->sampleStdev, GAUSSIAN_STDEV, ERROR_TOLERANCE, "StDev is within expected range");145 is_float_tol_per(stats->sampleMean, GAUSSIAN_MEAN, ERROR_TOLERANCE, "Mean is within expected range"); 146 is_float_tol_per(stats->sampleStdev, GAUSSIAN_STDEV, ERROR_TOLERANCE, "StDev is within expected range"); 147 147 148 148 skip_end(); … … 185 185 stats = psVectorStats(stats, rans, NULL, NULL, 0); 186 186 // Verify mean and stdev 187 ok_float_tol_per(stats->sampleMean, POISSON_MEAN, ERROR_TOLERANCE, "Mean is within expected range");188 ok_float_tol_per(stats->sampleStdev, POISSON_STDEV, ERROR_TOLERANCE, "StDev is within expected range");187 is_float_tol_per(stats->sampleMean, POISSON_MEAN, ERROR_TOLERANCE, "Mean is within expected range"); 188 is_float_tol_per(stats->sampleStdev, POISSON_STDEV, ERROR_TOLERANCE, "StDev is within expected range"); 189 189 190 190 skip_end(); -
trunk/psLib/test/math/tap_psSparse.c
r12513 r12607 74 74 dS2 = sqrt (dS2/100.0 - dS*dS); 75 75 76 ok_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2);76 is_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2); 77 77 78 78 psFree (matrix); … … 147 147 dS2 = sqrt (dS2/100.0 - dS*dS); 148 148 149 ok_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2);149 is_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2); 150 150 151 151 psFree (matrix); … … 219 219 // test the support functions: LowerProduct 220 220 fVec = psSparseBorderLowerProduct (NULL, border, xRef); 221 ok_float (fVec->n, 1.0, "f dimen: %d", fVec->n);222 ok_float (fVec->data.F32[0], 0.3, "f(0): %f", fVec->data.F32[0]);221 is_float (fVec->n, 1.0, "f dimen: %d", fVec->n); 222 is_float (fVec->data.F32[0], 0.3, "f(0): %f", fVec->data.F32[0]); 223 223 psFree (fVec); 224 224 225 225 // test the support functions: Upper Product 226 226 fVec = psSparseBorderUpperProduct (NULL, border, yRef); 227 ok_float (fVec->n, 2.0, "f dimen: %d", fVec->n);228 ok_float (fVec->data.F32[0], 0.05, "f(0): %f", fVec->data.F32[0]);229 ok_float (fVec->data.F32[1], 0.10, "f(0): %f", fVec->data.F32[1]);227 is_float (fVec->n, 2.0, "f dimen: %d", fVec->n); 228 is_float (fVec->data.F32[0], 0.05, "f(0): %f", fVec->data.F32[0]); 229 is_float (fVec->data.F32[1], 0.10, "f(0): %f", fVec->data.F32[1]); 230 230 psFree (fVec); 231 231 232 232 // test the support functions: Square Product 233 233 fVec = psSparseBorderSquareProduct (NULL, border, yRef); 234 ok_float (fVec->n, 1.0, "f dimen: %d", fVec->n);235 ok_float (fVec->data.F32[0], 0.25, "f(0): %f", fVec->data.F32[0]);234 is_float (fVec->n, 1.0, "f dimen: %d", fVec->n); 235 is_float (fVec->data.F32[0], 0.25, "f(0): %f", fVec->data.F32[0]); 236 236 psFree (fVec); 237 237 … … 239 239 psVector *gVec = NULL; 240 240 psSparseBorderMultiply (&fVec, &gVec, border, xRef, yRef); 241 ok_float (fVec->data.F32[0], 1.15, "f(0): %f", fVec->data.F32[0]);242 ok_float (fVec->data.F32[1], 1.20, "f(1): %f", fVec->data.F32[1]);243 ok_float (gVec->data.F32[0], 0.55, "g(0): %f", gVec->data.F32[0]);241 is_float (fVec->data.F32[0], 1.15, "f(0): %f", fVec->data.F32[0]); 242 is_float (fVec->data.F32[1], 1.20, "f(1): %f", fVec->data.F32[1]); 243 is_float (gVec->data.F32[0], 0.55, "g(0): %f", gVec->data.F32[0]); 244 244 245 245 // supply the fVec and gVec data to the border … … 263 263 psVector *yFit = NULL; 264 264 psSparseBorderSolve (&xFit, &yFit, constraint, border, 4); 265 ok_float_tol (xFit->data.F32[0], 1.0, 1e-4, "f(0): %f", xFit->data.F32[0]);266 ok_float_tol (xFit->data.F32[1], 1.0, 1e-4, "f(1): %f", xFit->data.F32[1]);267 ok_float_tol (yFit->data.F32[0], 0.5, 1e-4, "g(0): %f", yFit->data.F32[0]);265 is_float_tol (xFit->data.F32[0], 1.0, 1e-4, "f(0): %f", xFit->data.F32[0]); 266 is_float_tol (xFit->data.F32[1], 1.0, 1e-4, "f(1): %f", xFit->data.F32[1]); 267 is_float_tol (yFit->data.F32[0], 0.5, 1e-4, "g(0): %f", yFit->data.F32[0]); 268 268 269 269 psFree (xFit); … … 321 321 } 322 322 } 323 ok_float(border->Bij->data.F32[0][0], 0.1, "set matrix element %d,%d", 0, 0);323 is_float(border->Bij->data.F32[0][0], 0.1, "set matrix element %d,%d", 0, 0); 324 324 325 325 // construct the Q component: … … 381 381 dS /= Nrows; 382 382 dS2 = sqrt (dS2/Nrows - dS*dS); 383 ok_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2);383 is_float_tol (dS2, 0.0, 1e-4, "scatter: %.20f", dS2); 384 384 385 385 // measure stdev between yFit and yRef 386 386 float dY = yRef->data.F32[0] - yFit->data.F32[0]; 387 387 // fprintf (stderr, "%5.3f %5.3f %5.3f %5.3f\n", gVec->data.F32[0], yRef->data.F32[0], yFit->data.F32[0], dS); 388 ok_float_tol (dY, 0.0, 2e-4, "scatter: %.20f", dY);388 is_float_tol (dY, 0.0, 2e-4, "scatter: %.20f", dY); 389 389 390 390 psFree (xRef); -
trunk/psLib/test/math/tap_psStats00.c
r12242 r12607 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-03- 05 23:23:38$11 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-03-27 22:52:03 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 120 120 ok(result, "psVectorStats suceeded (F32: no mask vector, no error vector)"); 121 121 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 122 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4,122 is_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, 123 123 "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF32); 124 124 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 131 131 ok(result, "psVectorStats suceeded (F32: no mask vector, with error vector)"); 132 132 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 133 ok_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskF32);133 is_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskF32); 134 134 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 135 135 } … … 144 144 ok(result, "psVectorStats suceeded (F32, no mask, no errors, with data range)"); 145 145 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 146 ok_float_tol(myStats->sampleMean, expectedMeanRangeNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeNoMaskF32);146 is_float_tol(myStats->sampleMean, expectedMeanRangeNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeNoMaskF32); 147 147 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 148 148 } … … 156 156 ok(result, "psVectorStats suceeded (F32, no mask, with errors and data range)"); 157 157 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 158 ok_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskRangeF32);158 is_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskRangeF32); 159 159 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 160 160 } … … 167 167 ok(result, "psVectorStats suceeded (F32, with mask, no errors)"); 168 168 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 169 ok_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32);169 is_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32); 170 170 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 171 171 } … … 177 177 ok(result, "psVectorStats suceeded (F32, with mask and errors)"); 178 178 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 179 ok_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskF32);179 is_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskF32); 180 180 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 181 181 } … … 188 188 ok(result, "psVectorStats suceeded (F32, with mask and data range)"); 189 189 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 190 ok_float_tol(myStats->sampleMean, expectedMeanRangeWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeWithMaskF32);190 is_float_tol(myStats->sampleMean, expectedMeanRangeWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeWithMaskF32); 191 191 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 192 192 } … … 198 198 ok(result, "psVectorStats suceeded (F32, withmask, errors, and data range)"); 199 199 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 200 ok_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskRangeF32);200 is_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskRangeF32); 201 201 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 202 202 } … … 214 214 ok(result, "psVectorStats suceeded (F32, with mask = 2, no errors)"); 215 215 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 216 ok_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32);216 is_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32); 217 217 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 218 218 } … … 230 230 ok(result, "psVectorStats suceeded (F32, with mask = 3, no errors)"); 231 231 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 232 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF32);232 is_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF32); 233 233 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); 234 234 } … … 276 276 ok(result, "psVectorStats suceeded (S8, no mask, no errors)"); 277 277 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 278 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskS8, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskS8);278 is_float_tol(myStats->sampleMean, expectedMeanNoMaskS8, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskS8); 279 279 psFree(myStats); 280 280 psFree(myVector); … … 297 297 ok(result, "psVectorStats suceeded (U16, no mask, no errors)"); 298 298 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 299 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskU16, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskU16);299 is_float_tol(myStats->sampleMean, expectedMeanNoMaskU16, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskU16); 300 300 psFree(myStats); 301 301 psFree(myVector); … … 317 317 ok(result, "psVectorStats suceeded (F64, no mask, no errors)"); 318 318 ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN"); 319 ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF64, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF64);319 is_float_tol(myStats->sampleMean, expectedMeanNoMaskF64, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF64); 320 320 psFree(myStats); 321 321 psFree(myVector); -
trunk/psLib/test/math/tap_psStats01.c
r11420 r12607 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2007-0 1-30 04:41:51$10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2007-03-27 22:52:03 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 63 63 ok(result, "psVectorStats suceeded"); 64 64 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 65 ok_float_tol(myStats->max, expectedMaxNoMaskF32, 1e-4,65 is_float_tol(myStats->max, expectedMaxNoMaskF32, 1e-4, 66 66 "The max was %f, should be %f", myStats->max, expectedMaxNoMaskF32); 67 67 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 74 74 ok(result, "psVectorStats suceeded"); 75 75 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 76 ok_float_tol(myStats->max, expectedMaxWithMaskF32, 1e-4,76 is_float_tol(myStats->max, expectedMaxWithMaskF32, 1e-4, 77 77 "The max was %f, should be %f", myStats->max, expectedMaxWithMaskF32); 78 78 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 88 88 ok(result, "psVectorStats suceeded"); 89 89 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 90 ok_float_tol(myStats->max, expectedMaxRangeNoMaskF32, 1e-4,90 is_float_tol(myStats->max, expectedMaxRangeNoMaskF32, 1e-4, 91 91 "The max was %f, should be %f", myStats->max, expectedMaxRangeNoMaskF32); 92 92 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 101 101 ok(result, "psVectorStats suceeded"); 102 102 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 103 ok_float_tol(myStats->max, expectedMaxRangeWithMaskF32, 1e-4,103 is_float_tol(myStats->max, expectedMaxRangeWithMaskF32, 1e-4, 104 104 "The max was %f, should be %f", myStats->max, expectedMaxRangeWithMaskF32); 105 105 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 136 136 ok(result, "psVectorStats suceeded"); 137 137 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 138 ok_float_tol(myStats->max, expectedMaxNoMaskS8, 1e-4,138 is_float_tol(myStats->max, expectedMaxNoMaskS8, 1e-4, 139 139 "The max was %f, should be %f", myStats->max, expectedMaxNoMaskS8); 140 140 psFree(myStats); … … 157 157 ok(result, "psVectorStats suceeded"); 158 158 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 159 ok_float_tol(myStats->max, expectedMaxNoMaskU16, 1e-4,159 is_float_tol(myStats->max, expectedMaxNoMaskU16, 1e-4, 160 160 "The max was %f, should be %f", myStats->max, expectedMaxNoMaskU16); 161 161 psFree(myStats); … … 178 178 ok(result, "psVectorStats suceeded"); 179 179 ok(!isnan(myStats->max), "psVectorStats() returned non-NAN"); 180 ok_float_tol(myStats->max, expectedMaxNoMaskF64, 1e-4,180 is_float_tol(myStats->max, expectedMaxNoMaskF64, 1e-4, 181 181 "The max was %f, should be %f", myStats->max, expectedMaxNoMaskF64); 182 182 psFree(myStats); -
trunk/psLib/test/math/tap_psStats02.c
r11420 r12607 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2007-0 1-30 04:41:51$13 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2007-03-27 22:52:03 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 67 67 ok(result, "psVectorStats suceeded"); 68 68 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 69 ok_float_tol(myStats->min, expectedMinNoMaskF32, 1e-4,69 is_float_tol(myStats->min, expectedMinNoMaskF32, 1e-4, 70 70 "The min was %f, should be %f", myStats->min, expectedMinNoMaskF32); 71 71 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 80 80 ok(result, "psVectorStats suceeded"); 81 81 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 82 ok_float_tol(myStats->min, expectedMinWithMaskF32, 1e-4,82 is_float_tol(myStats->min, expectedMinWithMaskF32, 1e-4, 83 83 "The min was %f, should be %f", myStats->min, expectedMinWithMaskF32); 84 84 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 94 94 ok(result, "psVectorStats suceeded"); 95 95 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 96 ok_float_tol(myStats->min, expectedMinRangeNoMaskF32, 1e-4,96 is_float_tol(myStats->min, expectedMinRangeNoMaskF32, 1e-4, 97 97 "The min was %f, should be %f", myStats->min, expectedMinRangeNoMaskF32); 98 98 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 107 107 ok(result, "psVectorStats succeeded"); 108 108 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 109 ok_float_tol(myStats->min, expectedMinRangeWithMaskF32, 1e-4,109 is_float_tol(myStats->min, expectedMinRangeWithMaskF32, 1e-4, 110 110 "The min was %f, should be %f", myStats->min, expectedMinRangeWithMaskF32); 111 111 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 142 142 ok(result, "psVectorStats succeeded"); 143 143 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 144 ok_float_tol(myStats->min, expectedMinNoMaskS8, 1e-4,144 is_float_tol(myStats->min, expectedMinNoMaskS8, 1e-4, 145 145 "The min was %f, should be %f", myStats->min, expectedMinNoMaskS8); 146 146 psFree(myStats); … … 163 163 ok(result, "psVectorStats succeeded"); 164 164 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 165 ok_float_tol(myStats->min, expectedMinNoMaskU16, 1e-4,165 is_float_tol(myStats->min, expectedMinNoMaskU16, 1e-4, 166 166 "The min was %f, should be %f", myStats->min, expectedMinNoMaskU16); 167 167 psFree(myStats); … … 184 184 ok(result, "psVectorStats succeeded"); 185 185 ok(!isnan(myStats->min), "psVectorStats() returned non-NAN"); 186 ok_float_tol(myStats->min, expectedMinNoMaskF64, 1e-4,186 is_float_tol(myStats->min, expectedMinNoMaskF64, 1e-4, 187 187 "The min was %f, should be %f", myStats->min, expectedMinNoMaskF64); 188 188 psFree(myStats); -
trunk/psLib/test/math/tap_psStats03.c
r11420 r12607 44 44 ok(result, "psVectorStats succeeded"); 45 45 ok(!isnan(myStats->sampleMedian), "psVectorStats() returned non-NAN"); 46 ok_float_tol(myStats->sampleMedian, realMedianNoMask, 1e-4,46 is_float_tol(myStats->sampleMedian, realMedianNoMask, 1e-4, 47 47 "The sample median was %f, should be %f", myStats->sampleMedian, realMedianNoMask); 48 48 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 55 55 ok(result, "psVectorStats succeeded"); 56 56 ok(!isnan(myStats->sampleMedian), "psVectorStats() returned non-NAN"); 57 ok_float_tol(myStats->sampleMedian, realMedianWithMask, 1e-4,57 is_float_tol(myStats->sampleMedian, realMedianWithMask, 1e-4, 58 58 "The sample median was %f, should be %f", myStats->sampleMedian, realMedianWithMask); 59 59 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); -
trunk/psLib/test/math/tap_psStats06.c
r11420 r12607 45 45 ok(result, "psVectorStats succeeded"); 46 46 ok(!isnan(myStats->sampleStdev), "psVectorStats() returned non-NAN"); 47 ok_float_tol(myStats->sampleStdev, realStdevNoMask, 1e-4,47 is_float_tol(myStats->sampleStdev, realStdevNoMask, 1e-4, 48 48 "The mean was %f, should be %f", myStats->sampleStdev, realStdevNoMask); 49 49 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 56 56 ok(result, "psVectorStats succeeded"); 57 57 ok(!isnan(myStats->sampleStdev), "psVectorStats() returned non-NAN"); 58 ok_float_tol(myStats->sampleStdev, realStdevWithMask, 1e-4,58 is_float_tol(myStats->sampleStdev, realStdevWithMask, 1e-4, 59 59 "The mean was %f, should be %f", myStats->sampleStdev, realStdevWithMask); 60 60 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); -
trunk/psLib/test/math/tap_psStats08.c
r11661 r12607 45 45 ok(result, "psVectorStats succeeded"); 46 46 ok(!isnan(myStats->sampleLQ), "psVectorStats() returned non-NAN"); 47 ok_float_tol(myStats->sampleLQ, realLQNoMask, 1e-4,47 is_float_tol(myStats->sampleLQ, realLQNoMask, 1e-4, 48 48 "The sampleLQ was %f, should be %f", myStats->sampleLQ, realLQNoMask); 49 49 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 56 56 ok(result, "psVectorStats succeeded"); 57 57 ok(!isnan(myStats->sampleUQ), "psVectorStats() returned non-NAN"); 58 ok_float_tol(myStats->sampleUQ, realUQNoMask, 1e-4,58 is_float_tol(myStats->sampleUQ, realUQNoMask, 1e-4, 59 59 "The sampleUQ was %f, should be %f", myStats->sampleUQ, realUQNoMask); 60 60 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); … … 67 67 ok(result, "psVectorStats succeeded"); 68 68 ok(!isnan(myStats->sampleLQ), "psVectorStats() returned non-NAN"); 69 ok_float_tol(myStats->sampleLQ, realLQWithMask, 1e-4,69 is_float_tol(myStats->sampleLQ, realLQWithMask, 1e-4, 70 70 "The sampleLQ was %f, should be %f", myStats->sampleLQ, 71 71 realLQWithMask); … … 79 79 ok(result, "psVectorStats succeeded"); 80 80 ok(!isnan(myStats->sampleUQ), "psVectorStats() returned non-NAN"); 81 ok_float_tol(myStats->sampleUQ, realUQWithMask, 1e-4,81 is_float_tol(myStats->sampleUQ, realUQWithMask, 1e-4, 82 82 "The sampleUQ was %f, should be %f", myStats->sampleUQ, 83 83 realUQWithMask); -
trunk/psLib/test/mathtypes/tap_psImageInterpolate.c
r12513 r12607 29 29 30 30 value = psImagePixelInterpolate (image, 10.5, 10.5, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 31 ok_float (value, 1.0, "pixel center value - %f", value);31 is_float (value, 1.0, "pixel center value - %f", value); 32 32 33 33 // diag ("why do I need to have tolerances of 4epsilon or so??"); 34 34 value = psImagePixelInterpolate (image, 10.9, 10.5, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 35 ok_float_tol (value, 0.6, 4.0*FLT_EPSILON, "pixel value - %.20f", value);35 is_float_tol (value, 0.6, 4.0*FLT_EPSILON, "pixel value - %.20f", value); 36 36 37 37 value = psImagePixelInterpolate (image, 10.5, 10.9, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 38 ok_float_tol (value, 0.6, 4.0*FLT_EPSILON, "pixel value - %.20f", value);38 is_float_tol (value, 0.6, 4.0*FLT_EPSILON, "pixel value - %.20f", value); 39 39 40 40 value = psImagePixelInterpolate (image, 10.1, 10.5, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 41 ok_float_tol (value, 0.6, 4.0*FLT_EPSILON, "pixel value - %.20f", value);41 is_float_tol (value, 0.6, 4.0*FLT_EPSILON, "pixel value - %.20f", value); 42 42 43 43 skip_end(); … … 69 69 70 70 value = psImagePixelInterpolate (image, 2.5, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 71 ok_float (value, 2.5, "pixel center value - %f", value);71 is_float (value, 2.5, "pixel center value - %f", value); 72 72 73 73 value = psImagePixelInterpolate (image, 2.2, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 74 ok_float (value, 2.2, "coord: 2.2, 2.5, value: %f", value);74 is_float (value, 2.2, "coord: 2.2, 2.5, value: %f", value); 75 75 76 76 value = psImagePixelInterpolate (image, 2.8, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 77 ok_float (value, 2.8, "coord: 2.8, value: %f", value);77 is_float (value, 2.8, "coord: 2.8, value: %f", value); 78 78 79 79 value = psImagePixelInterpolate (image, 2.8, 2.2, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 80 ok_float (value, 2.8, "coord: 2.8, value: %f", value);80 is_float (value, 2.8, "coord: 2.8, value: %f", value); 81 81 82 82 value = psImagePixelInterpolate (image, 2.8, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 83 ok_float (value, 2.8, "coord: 2.8, value: %f", value);83 is_float (value, 2.8, "coord: 2.8, value: %f", value); 84 84 85 85 value = psImagePixelInterpolate (image, 0.8, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 86 ok_float (value, 0.8, "coord: 0.8, value: %f", value);86 is_float (value, 0.8, "coord: 0.8, value: %f", value); 87 87 88 88 // no extrapolation 89 89 value = psImagePixelInterpolate (image, 0.3, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 90 ok_float (value, 0.5, "coord: 0.3, value: %f", value);90 is_float (value, 0.5, "coord: 0.3, value: %f", value); 91 91 92 92 value = psImagePixelInterpolate (image, -0.2, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 93 ok_float (value, 0.5, "coord: -0.2, value: %f", value);93 is_float (value, 0.5, "coord: -0.2, value: %f", value); 94 94 95 95 skip_end(); … … 121 121 122 122 value = psImagePixelInterpolate (image, 2.5, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 123 ok_float (value, 2.5, "pixel center value - %f", value);123 is_float (value, 2.5, "pixel center value - %f", value); 124 124 125 125 value = psImagePixelInterpolate (image, 2.2, 2.2, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 126 ok_float (value, 2.2, "coord: 2.2, 2.5, value: %f", value);126 is_float (value, 2.2, "coord: 2.2, 2.5, value: %f", value); 127 127 128 128 value = psImagePixelInterpolate (image, 2.5, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 129 ok_float (value, 2.8, "coord: 2.8, value: %f", value);129 is_float (value, 2.8, "coord: 2.8, value: %f", value); 130 130 131 131 value = psImagePixelInterpolate (image, 2.2, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 132 ok_float (value, 2.8, "coord: 2.8, value: %f", value);132 is_float (value, 2.8, "coord: 2.8, value: %f", value); 133 133 134 134 value = psImagePixelInterpolate (image, 2.8, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 135 ok_float (value, 2.8, "coord: 2.8, value: %f", value);135 is_float (value, 2.8, "coord: 2.8, value: %f", value); 136 136 137 137 skip_end(); … … 163 163 164 164 value = psImagePixelInterpolate (image, 2.5, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 165 ok_float (value, 2.5, "coord; 2.5, 2.5, value - %f", value);165 is_float (value, 2.5, "coord; 2.5, 2.5, value - %f", value); 166 166 167 167 value = psImagePixelInterpolate (image, 2.2, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 168 ok_float (value, 2.2, "coord: 2.2, 2.5, value: %f", value);168 is_float (value, 2.2, "coord: 2.2, 2.5, value: %f", value); 169 169 170 170 value = psImagePixelInterpolate (image, 2.8, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 171 ok_float (value, 2.8, "coord: 2.8, 2.5, value: %f", value);171 is_float (value, 2.8, "coord: 2.8, 2.5, value: %f", value); 172 172 173 173 value = psImagePixelInterpolate (image, 2.8, 2.2, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 174 ok_float (value, 2.8, "coord: 2.8, 2.2, value: %f", value);174 is_float (value, 2.8, "coord: 2.8, 2.2, value: %f", value); 175 175 176 176 value = psImagePixelInterpolate (image, 2.8, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 177 ok_float (value, 2.8, "coord: 2.8, 2.8, value: %f", value);177 is_float (value, 2.8, "coord: 2.8, 2.8, value: %f", value); 178 178 179 179 // diag ("coords outside of nominal range (1 < x < Nx - 2) return 'uncover'"); … … 181 181 // no extrapolation: these return the 'uncover' value 182 182 value = psImagePixelInterpolate (image, 0.8, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 183 ok_float (value, 0.0, "coord: 0.8, 2.8, value: %f", value);183 is_float (value, 0.0, "coord: 0.8, 2.8, value: %f", value); 184 184 185 185 value = psImagePixelInterpolate (image, 0.3, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 186 ok_float (value, 0.0, "coord: 0.3, 2.8, value: %f", value);186 is_float (value, 0.0, "coord: 0.3, 2.8, value: %f", value); 187 187 188 188 value = psImagePixelInterpolate (image, -0.2, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 189 ok_float (value, 0.0, "coord: -0.2, 2.8, value: %f", value);189 is_float (value, 0.0, "coord: -0.2, 2.8, value: %f", value); 190 190 191 191 skip_end(); … … 217 217 218 218 value = psImagePixelInterpolate (image, 2.5, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 219 ok_float (value, 2.5, "pixel center value - %f", value);219 is_float (value, 2.5, "pixel center value - %f", value); 220 220 221 221 value = psImagePixelInterpolate (image, 2.2, 2.2, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 222 ok_float (value, 2.2, "coord: 2.2, 2.5, value: %f", value);222 is_float (value, 2.2, "coord: 2.2, 2.5, value: %f", value); 223 223 224 224 value = psImagePixelInterpolate (image, 2.5, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 225 ok_float (value, 2.8, "coord: 2.8, value: %f", value);225 is_float (value, 2.8, "coord: 2.8, value: %f", value); 226 226 227 227 value = psImagePixelInterpolate (image, 2.2, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 228 ok_float (value, 2.8, "coord: 2.8, value: %f", value);228 is_float (value, 2.8, "coord: 2.8, value: %f", value); 229 229 230 230 value = psImagePixelInterpolate (image, 2.8, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 231 ok_float (value, 2.8, "coord: 2.8, value: %f", value);231 is_float (value, 2.8, "coord: 2.8, value: %f", value); 232 232 233 233 skip_end(); … … 259 259 260 260 value = psImagePixelInterpolate (image, 2.5, 2.5, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 261 ok_float (value, 4.0625, "pixel center value - %f", value);261 is_float (value, 4.0625, "pixel center value - %f", value); 262 262 263 263 value = psImagePixelInterpolate (image, 2.2, 2.2, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 264 ok_float (value, 3.41, "coord: 2.2, 2.5, value: %f", value);264 is_float (value, 3.41, "coord: 2.2, 2.5, value: %f", value); 265 265 266 266 value = psImagePixelInterpolate (image, 2.5, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 267 ok_float (value, 4.3625002, "coord: 2.5, 2.8, value: %f", value);267 is_float (value, 4.3625002, "coord: 2.5, 2.8, value: %f", value); 268 268 269 269 value = psImagePixelInterpolate (image, 2.2, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 270 ok_float (value, 4.010000229, "coord: 2.2, 2.8, value: %f", value);270 is_float (value, 4.010000229, "coord: 2.2, 2.8, value: %f", value); 271 271 272 272 value = psImagePixelInterpolate (image, 2.8, 2.8, NULL, 0, 0.0, PS_INTERPOLATE_BICUBE); 273 ok_float (value, 4.75999975, "coord: 2.8, 2.8, value: %f", value);273 is_float (value, 4.75999975, "coord: 2.8, 2.8, value: %f", value); 274 274 275 275 skip_end(); -
trunk/psLib/test/pstap/src/pstap.h
r12410 r12607 25 25 26 26 // use to test the value of a float 27 # define ok_float(VALUE, EXPECT, ...) \27 # define is_float(VALUE, EXPECT, ...) \ 28 28 { \ 29 29 bool status = false; \ … … 42 42 43 43 // use to test the value of a float within a defined tolerance 44 # define ok_float_tol(VALUE,EXPECT,TOL,...)\44 # define is_float_tol(VALUE,EXPECT,TOL,...)\ 45 45 { \ 46 46 bool status = false; \ … … 59 59 60 60 // use to test the value of a double 61 # define ok_double(VALUE,EXPECT,...)\61 # define is_double(VALUE,EXPECT,...)\ 62 62 { \ 63 63 bool status = false; \ … … 76 76 77 77 // use to test the value of a double 78 # define ok_double_tol(VALUE,EXPECT,TOL, ...)\78 # define is_double_tol(VALUE,EXPECT,TOL, ...)\ 79 79 { \ 80 80 bool status = false; \ … … 92 92 93 93 94 # define ok_str(VALUE, EXPECT, ...) \94 # define is_str(VALUE, EXPECT, ...) \ 95 95 { \ 96 96 int cmp = (strcmp(VALUE, EXPECT) == 0); \ … … 103 103 104 104 105 # define ok_strn(VALUE, EXPECT, N, ...)\105 # define is_strn(VALUE, EXPECT, N, ...)\ 106 106 { \ 107 107 int cmp = (strncmp(VALUE, EXPECT, N) == 0); \ -
trunk/psLib/test/sys/tap_psString.c
r12513 r12607 20 20 * @author Eric Van Alst, MHPCC 21 21 * 22 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $23 * @date $Date: 2007-03-2 0 03:57:25$22 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2007-03-27 22:52:03 $ 24 24 * 25 25 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 313 313 // test null-op 314 314 psStringAppend(&str, "%s", ""); 315 ok_str(str, STR_0, "Failed test point");315 is_str(str, STR_0, "Failed test point"); 316 316 psFree(str); 317 317 -
trunk/psLib/test/types/tap_psLookupTable_all.c
r12385 r12607 273 273 skip_start( vec == NULL, 1, 274 274 "Skipping 1 tests because psLookupTableInterpolateAll failed"); 275 ok_double(vec->data.F64[0], 1.0,275 is_double(vec->data.F64[0], 1.0, 276 276 "psLookupTableInterpolateAll: return correct output vector for valid inputs."); 277 277 skip_end(); -
trunk/psLib/test/types/tap_psMetadataConfigFormat.c
r12472 r12607 102 102 char configTest[32]; 103 103 strncpy(configTest, "time TAI NULL", 31); 104 ok_strn(configTest, out, 31,104 is_strn(configTest, out, 31, 105 105 "psMetadataConfigFormat: return correct output string."); 106 106 psFree(time); … … 124 124 char configTest[62]; 125 125 strncpy(configTest, "new_S32 MULTI\nnew_S32 S32 666", 61); 126 ok_strn(configTest, out, strlen(configTest),126 is_strn(configTest, out, strlen(configTest), 127 127 "psMetadataConfigFormat: return correct output string."); 128 128 psFree(out); … … 150 150 "\nf32 S32 666 # f32_3" 151 151 "\nf32 S32 665 # f32_2", 200); 152 ok_strn(configTest, out, strlen(configTest),152 is_strn(configTest, out, strlen(configTest), 153 153 "psMetadataConfigFormat: return correct output string."); 154 154 psFree(out); -
trunk/psLib/test/types/tap_psMetadataConfigParse.c
r12473 r12607 61 61 ok(item->type == PS_TYPE_S32, "return correcot metdataItem type"); 62 62 is_int(item->data.S32, 666, "return correct metadataItem data"); 63 ok_str(item->name, "new", "return correct metadataItem name");64 ok_str(item->comment, "", "return correct metadataItem comment");63 is_str(item->name, "new", "return correct metadataItem name"); 64 is_str(item->comment, "", "return correct metadataItem comment"); 65 65 skip_end(); 66 66 … … 81 81 "Skipping 1 tests because metadata container is empty!"); 82 82 ok(item->type == PS_DATA_F64, "return correct metadataItem type"); 83 ok_float(6.28, item->data.F64, "return correct metadataItem data");84 ok_str(item->name, "item4", "return correct metadataItem name");85 ok_str(item->comment, "", "return correct metadataItem comment");83 is_float(6.28, item->data.F64, "return correct metadataItem data"); 84 is_str(item->name, "item4", "return correct metadataItem name"); 85 is_str(item->comment, "", "return correct metadataItem comment"); 86 86 skip_end(); 87 87 … … 106 106 ok(item->type == PS_TYPE_S8, "metdataItem type"); 107 107 is_int(item->data.S8, 3, "metdataItem value"); 108 ok_str(item->name, "item8", "return correct metadataItem name");109 ok_str(item->comment, "", "return correct metadataItem comment");108 is_str(item->name, "item8", "return correct metadataItem name"); 109 is_str(item->comment, "", "return correct metadataItem comment"); 110 110 skip_end(); 111 111 psFree(md); … … 128 128 is_int(((psVector*)(item->data.V))->data.U8[0], 1, 129 129 "return correct metadataItem data (Vector)"); 130 ok_str(item->name, "vector6",130 is_str(item->name, "vector6", 131 131 "return correct metadataItem name (Vector)"); 132 ok_str(item->comment, "I am a vector", "return correct metadataItem comment");132 is_str(item->comment, "I am a vector", "return correct metadataItem comment"); 133 133 skip_end(); 134 134 -
trunk/psLib/test/types/tap_psMetadataConfigPrint.c
r10701 r12607 96 96 fread(fileStr2, 1, 31, mdcfg); 97 97 98 ok_strn(fileStr2, "\nnew S32 S32 666 ", 30,98 is_strn(fileStr2, "\nnew S32 S32 666 ", 30, 99 99 "return correct output."); 100 100 -
trunk/psLib/test/types/tap_psMetadataConfigWrite.c
r10698 r12607 62 62 strncpy(configTest, 63 63 "item1-1 BOOL T # I am a boolean", 60); 64 ok_strn(configTest, fileStr, 60,64 is_strn(configTest, fileStr, 60, 65 65 "return correct output."); 66 66 fclose(mdcfg); -
trunk/psLib/test/types/tap_psMetadataConfig_input.c
r12477 r12607 88 88 psMetadataItem *item = psMetadataGet(md, PS_LIST_HEAD); 89 89 // XXX shouldn't assume item isn't NULL 90 ok_str(item->name, "item1", "metadataItem name");90 is_str(item->name, "item1", "metadataItem name"); 91 91 ok(item->type == PS_DATA_BOOL, "metadataItem type"); 92 92 is_bool(item->data.B, true, "metdataItem value"); 93 ok_str(item->comment, "I am a boolean", "metadataItem comment.");93 is_str(item->comment, "I am a boolean", "metadataItem comment."); 94 94 95 95 // look at the last item 96 96 item = psMetadataGet(md, PS_LIST_TAIL); 97 97 // XXX shouldn't assume item isn't NULL 98 ok_str(item->name, "M2", "metadataItem name");98 is_str(item->name, "M2", "metadataItem name"); 99 99 ok(item->type == PS_DATA_S32, "metdataItem type"); 100 100 is_int(item->data.S32, 666, "metdataItem value"); 101 ok_str(item->comment, "this line is \"GOOD\" but parsed in the top level", "metadataItem comment.");101 is_str(item->comment, "this line is \"GOOD\" but parsed in the top level", "metadataItem comment."); 102 102 103 103 skip_end(); … … 123 123 // note that item1 gets added to the "tail" of the metdata was it's 124 124 // replaced 125 ok_str(item->name, "item2", "metadataItem name");125 is_str(item->name, "item2", "metadataItem name"); 126 126 ok(item->type == PS_DATA_S32, "metdataItem type"); 127 127 is_bool(item->data.S32, 55, "metadataItem value"); 128 ok_str(item->comment, "I am int", "metadataItem value");128 is_str(item->comment, "I am int", "metadataItem value"); 129 129 130 130 // look at the last item … … 132 132 // XXX shouldn't assume item isn't NULL 133 133 // meta1 is from "the bad section" 134 ok_str(item->name, "meta1", "metadataItem name");134 is_str(item->name, "meta1", "metadataItem name"); 135 135 ok(item->type == PS_DATA_METADATA, "metadataItem type"); 136 136 137 ok_str(item->comment, "", "metadataItem comment");137 is_str(item->comment, "", "metadataItem comment"); 138 138 139 139 skip_end(); -
trunk/psLib/test/types/tap_psMetadataItemParse.c
r10822 r12607 110 110 "psMetadataItem input." ); 111 111 //Return 1.666 for string with "1.666" 112 ok_float( psMetadataItemParseF32(itemString2), 1.666,112 is_float( psMetadataItemParseF32(itemString2), 1.666, 113 113 "psMetadataItemParse: return 1.666 in F32 for string-item with " 114 114 "value '1.666'." ); 115 115 //Return 0.0 for F32 value 0.0 116 ok_float( psMetadataItemParseF32(itemF32), 0.0,116 is_float( psMetadataItemParseF32(itemF32), 0.0, 117 117 "psMetadataItemParse: return 0.0 in F32 for F32-item with " 118 118 "value '0.0'." ); 119 119 //Return 0.5 for F64 value 0.5 120 ok_float( psMetadataItemParseF32(itemF64), 0.5,120 is_float( psMetadataItemParseF32(itemF64), 0.5, 121 121 "psMetadataItemParse: return 0.5 in F32 for F64-item with " 122 122 "value '0.5'." ); 123 123 //Return 1.0 for S8 value 1 124 ok_float( psMetadataItemParseF32(itemS8), 1.0,124 is_float( psMetadataItemParseF32(itemS8), 1.0, 125 125 "psMetadataItemParse: return 1.0 in F32 for S8-item with " 126 126 "value '1'." ); 127 127 //Return 0.0 for S16 value 0 128 ok_float( psMetadataItemParseF32(itemS16), 0.0,128 is_float( psMetadataItemParseF32(itemS16), 0.0, 129 129 "psMetadataItemParse: return 0.0 in F32 for S16-item with " 130 130 "value '0'." ); 131 131 //Return 1.0 for S32 value 1 132 ok_float( psMetadataItemParseF32(itemS32), 1.0,132 is_float( psMetadataItemParseF32(itemS32), 1.0, 133 133 "psMetadataItemParse: return 1.0 in F32 for S32-item with " 134 134 "value '1'." ); 135 135 //Return 2.0 for U8 value 2 136 ok_float( psMetadataItemParseF32(itemU8), 2.0,136 is_float( psMetadataItemParseF32(itemU8), 2.0, 137 137 "psMetadataItemParse: return 2.0 in F32 for U8-item with " 138 138 "value '2'." ); 139 139 //Return 0.0 for U16 value 0 140 ok_float( psMetadataItemParseF32(itemU16), 0.0,140 is_float( psMetadataItemParseF32(itemU16), 0.0, 141 141 "psMetadataItemParse: return 0.0 in F32 for U16-item with " 142 142 "value '0'." ); 143 143 //Return 1.0 for U32 value 1 144 ok_float( psMetadataItemParseF32(itemU32), 1.0,144 is_float( psMetadataItemParseF32(itemU32), 1.0, 145 145 "psMetadataItemParse: return 1.0 in F32 for U32-item with " 146 146 "value '1'." ); … … 157 157 "psMetadataItem input." ); 158 158 //Return 1.666 for string with "1.666" 159 ok_double_tol( psMetadataItemParseF64(itemString2), 1.666, 0.00001,159 is_double_tol( psMetadataItemParseF64(itemString2), 1.666, 0.00001, 160 160 "psMetadataItemParse: return 1.666 in F64 for string-item with " 161 161 "value '1.666'." ); 162 162 //Return 0.0 for F32 value 0.0 163 ok_double( psMetadataItemParseF64(itemF32), 0.0,163 is_double( psMetadataItemParseF64(itemF32), 0.0, 164 164 "psMetadataItemParse: return 0.0 in F64 for F32-item with " 165 165 "value '0.0'." ); 166 166 //Return 0.5 for F64 value 0.5 167 ok_double( psMetadataItemParseF64(itemF64), 0.5,167 is_double( psMetadataItemParseF64(itemF64), 0.5, 168 168 "psMetadataItemParse: return 0.5 in F64 for F64-item with " 169 169 "value '0.5'." ); 170 170 //Return 1.0 for S8 value 1 171 ok_double( psMetadataItemParseF64(itemS8), 1.0,171 is_double( psMetadataItemParseF64(itemS8), 1.0, 172 172 "psMetadataItemParse: return 1.0 in F64 for S8-item with " 173 173 "value '1'." ); 174 174 //Return 0.0 for S16 value 0 175 ok_double( psMetadataItemParseF64(itemS16), 0.0,175 is_double( psMetadataItemParseF64(itemS16), 0.0, 176 176 "psMetadataItemParse: return 0.0 in F64 for S16-item with " 177 177 "value '0'." ); 178 178 //Return 1.0 for S32 value 1 179 ok_double( psMetadataItemParseF64(itemS32), 1.0,179 is_double( psMetadataItemParseF64(itemS32), 1.0, 180 180 "psMetadataItemParse: return 1.0 in F64 for S32-item with " 181 181 "value '1'." ); 182 182 //Return 2.0 for U8 value 2 183 ok_double( psMetadataItemParseF64(itemU8), 2.0,183 is_double( psMetadataItemParseF64(itemU8), 2.0, 184 184 "psMetadataItemParse: return 2.0 in F64 for U8-item with " 185 185 "value '2'." ); 186 186 //Return 0.0 for U16 value 0 187 ok_double( psMetadataItemParseF64(itemU16), 0.0,187 is_double( psMetadataItemParseF64(itemU16), 0.0, 188 188 "psMetadataItemParse: return 0.0 in F64 for U16-item with " 189 189 "value '0'." ); 190 190 //Return 1.0 for U32 value 1 191 ok_double( psMetadataItemParseF64(itemU32), 1.0,191 is_double( psMetadataItemParseF64(itemU32), 1.0, 192 192 "psMetadataItemParse: return 1.0 in F64 for U32-item with " 193 193 "value '1'." ); … … 448 448 //Return "true" for STRING of value "true" 449 449 psString tempString = psMetadataItemParseString(itemString1); 450 ok_strn( tempString, "true", 6,450 is_strn( tempString, "true", 6, 451 451 "psMetadataItemParse: return 'true' in STRING for STRING with " 452 452 "value 'true'." ); … … 455 455 //Return 0.000000 for F32 of value 0.000000 456 456 tempString = psMetadataItemParseString(itemF32); 457 ok_strn( tempString, "0.000000", 4,457 is_strn( tempString, "0.000000", 4, 458 458 "psMetadataItemParse: return '0.000000' in STRING for F32 with " 459 459 "value '0.000000'. (actual result=%s)", tempString); … … 462 462 //Return 0.500000 for F64 value 0.5 463 463 tempString = psMetadataItemParseString(itemF64); 464 ok_strn( tempString, "0.500000", 10,464 is_strn( tempString, "0.500000", 10, 465 465 "psMetadataItemParse: return '0.500000' in STRING for F64 with " 466 466 "value '0.5'. (actual result=%s)", tempString); … … 469 469 //Return 1 for S8 value 1 470 470 tempString = psMetadataItemParseString(itemS8); 471 ok_strn( tempString, "1", 3,471 is_strn( tempString, "1", 3, 472 472 "psMetadataItemParse: return '1' in STRING for S8 with " 473 473 "value '1'. (actual result=%s)", tempString); … … 476 476 //Return 0 for S16 value 0 477 477 tempString = psMetadataItemParseString(itemS16); 478 ok_strn( tempString, "0", 3,478 is_strn( tempString, "0", 3, 479 479 "psMetadataItemParse: return '0' in STRING for S8 with " 480 480 "value '0'. (actual result=%s)", tempString); … … 483 483 //Return 1 for S32 value 1 484 484 tempString = psMetadataItemParseString(itemS32); 485 ok_strn( tempString, "1", 3,485 is_strn( tempString, "1", 3, 486 486 "psMetadataItemParse: return '1' in STRING for S8 with " 487 487 "value '1'. (actual result=%s)", tempString); … … 490 490 //Return 2 for U8 value 2 491 491 tempString = psMetadataItemParseString(itemU8); 492 ok_strn( tempString, "2", 3,492 is_strn( tempString, "2", 3, 493 493 "psMetadataItemParse: return '2' in STRING for S8 with " 494 494 "value '2'. (actual result=%s)", tempString); … … 497 497 //Return 0 for U16 value 0 498 498 tempString = psMetadataItemParseString(itemU16); 499 ok_strn( tempString, "0", 3,499 is_strn( tempString, "0", 3, 500 500 "psMetadataItemParse: return '0' in STRING for S8 with " 501 501 "value '0'. (actual result=%s)", tempString); … … 504 504 //Return 1 for U32 value 1 505 505 tempString = psMetadataItemParseString(itemU32); 506 ok_strn( tempString, "1", 3,506 is_strn( tempString, "1", 3, 507 507 "psMetadataItemParse: return '1' in STRING for S8 with " 508 508 "value '1'. (actual result=%s)", tempString); -
trunk/psLib/test/types/tap_psMetadata_copying.c
r12476 r12607 221 221 222 222 ok(copy->type == PS_DATA_S64, "item type"); 223 ok_str(copy->name, "itemS64", "item name");223 is_str(copy->name, "itemS64", "item name"); 224 224 is_long(copy->data.S64, 4, "item data"); 225 ok_str(copy->comment, "", "item comment");225 is_str(copy->comment, "", "item comment"); 226 226 227 227 psFree(copy); -
trunk/psLib/test/types/tap_psMetadata_polynomials.c
r10822 r12607 69 69 ok(status, 70 70 "psPolynomial1DtoMetadata: found VAL_X00"); 71 ok_double(val, 1.1,71 is_double(val, 1.1, 72 72 "psPolynomial1DtoMetadata: VAL_X00 is %lf", val); 73 73 … … 75 75 ok(status, 76 76 "psPolynomial1DtoMetadata: found VAL_X01"); 77 ok_double(val, 2.2,77 is_double(val, 2.2, 78 78 "psPolynomial1DtoMetadata: VAL_X01 is %lf", val); 79 79 skip_end(); … … 278 278 ok(status, 279 279 "psPolynomial2DtoMetadata: found VAL_X00_Y00"); 280 ok_double(val, 1.1,280 is_double(val, 1.1, 281 281 "psPolynomial2DtoMetadata: VAL_X00_Y00 is %lf", val); 282 282 … … 284 284 ok(status, 285 285 "psPolynomial2DtoMetadata: found VAL_X01_Y01"); 286 ok_double(val, 4.4,286 is_double(val, 4.4, 287 287 "psPolynomial2DtoMetadata: VAL_X01_Y01 is %lf", val); 288 288
Note:
See TracChangeset
for help on using the changeset viewer.
