Changeset 12607 for trunk/psLib/test/astro
- Timestamp:
- Mar 27, 2007, 12:52:03 PM (19 years ago)
- Location:
- trunk/psLib/test/astro
- Files:
-
- 6 edited
-
tap_psEarthOrientation_corrections.c (modified) (1 diff)
-
tap_psEarthOrientation_motion.c (modified) (9 diffs)
-
tap_psSphereOps_all.c (modified) (13 diffs)
-
tap_psTime_01.c (modified) (20 diffs)
-
tap_psTime_02.c (modified) (4 diffs)
-
tap_psTime_03.c (modified) (11 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
Note:
See TracChangeset
for help on using the changeset viewer.
