Index: trunk/psLib/test/astro/tst_psEarthOrientation.c
===================================================================
--- trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5716)
+++ trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 5749)
@@ -5,6 +5,6 @@
 *  @author d-Rob, MHPCC
 *
-*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-12-07 02:13:40 $
+*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-12-08 02:49:04 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -66,7 +66,13 @@
 {
     if (obj == NULL) {
-        obj = psSphereAlloc();
-        obj->r = objR;
-        obj->d = objD;
+        //        obj = psSphereAlloc();
+        //        obj->r = objR;
+        //        obj->d = objD;
+        psCube *tempCube = psCubeAlloc();
+        tempCube->x = -0.3598480726985338;
+        tempCube->y = 0.5555012823608123;
+        tempCube->z = 0.7496183628158023;
+        obj = psCubeToSphere(tempCube);
+        psFree(tempCube);
     }
 }
@@ -544,13 +550,9 @@
         return 2;
     }
-    printf("\nOutput sphere rotation = %.13g, %.13g, %.13g, %.13g\n\n",
-           teoceo->q0, teoceo->q1, teoceo->q2, teoceo->q3);
 
     objSetup();
     psSphereRot *earthRot = psSphereRotConjugate(NULL, teoceo);
     psSphere *result = psSphereRotApply(NULL, earthRot, obj);
-    //    psCube *cube = psSphereToCube(obj);
     psCube *cube = psSphereToCube(result);
-
 
     double x, y, z;
@@ -558,6 +560,6 @@
     y = -0.6616523084626379;
     z = 0.7496183628158023;
-    if ( fabs(x-cube->x) > DBL_EPSILON  || fabs(y-cube->y) > DBL_EPSILON ||
-            fabs(z-cube->z) > DBL_EPSILON) {
+    if ( fabs(x-cube->x) > FLT_EPSILON  || fabs(y-cube->y) > FLT_EPSILON ||
+            fabs(z-cube->z) > FLT_EPSILON) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, false,
                 "psSphereRot_TEOtoCEO returned incorrect values.\n");
@@ -570,4 +572,6 @@
     }
     //    psFree(now);
+    psFree(rot);
+    psFree(empty);
     psFree(result);
     psFree(obj);
@@ -615,4 +619,27 @@
     }
 
+    //    psCube *tempCube = psCubeAlloc();
+    //    tempCube->x = -0.35963388069046304;
+    //    tempCube->y = 0.5555192509816625;
+    //    tempCube->z = 0.749078321908413;
+    //    obj = psCubeToSphere(tempCube);
+    //    psFree(tempCube);
+    obj = psSphereAlloc();
+    obj->r = objR;
+    obj->d = objD;
+    psSphereRot *precessionNutation = psSphereRotConjugate(NULL, rot);
+    psSphere *result = psSphereRotApply(NULL, precessionNutation, obj);
+    psCube *cube = psSphereToCube(result);
+    double x, y, z;
+    x = -0.3598480726985338;
+    y = 0.5555012823608123;
+    z = 0.7496183628158023;
+    printf("\nOutput cube = x,y,z = %.13g, %.13g, %.13g\n", cube->x, cube->y, cube->z);
+    printf("Expected cube = x,y,z = %.13g, %.13g, %.13g\n", x, y, z);
+    printf("A difference of:   %.13g, %.13g, %.13g\n\n",
+           (x-cube->x), (y-cube->y), (z-cube->z));
+    psFree(obj);
+
+
     if (fabs(rot->q0-q0) > DBL_EPSILON || fabs(rot->q1-q1) > DBL_EPSILON ||
             fabs(rot->q2-q2) > DBL_EPSILON || fabs(rot->q3-q3) > DBL_EPSILON) {
@@ -635,4 +662,8 @@
     printf("\n  Sphere -test- has values r,d = %.8g, %.8g \n", test->r, test->d);
 
+    psFree(precessionNutation);
+    psFree(result);
+    psFree(cube);
+
     psFree(test);
     psFree(rot);
