Changeset 12607 for trunk/psLib/test/astro/tap_psSphereOps_all.c
- Timestamp:
- Mar 27, 2007, 12:52:03 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astro/tap_psSphereOps_all.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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);
Note:
See TracChangeset
for help on using the changeset viewer.
