Index: trunk/psLib/test/astro/tst_psSphereOps.c
===================================================================
--- trunk/psLib/test/astro/tst_psSphereOps.c	(revision 6268)
+++ trunk/psLib/test/astro/tst_psSphereOps.c	(revision 6309)
@@ -5,6 +5,6 @@
 *  @author d-Rob, MHPCC
 *
-*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-01-27 20:08:58 $
+*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-02-02 23:19:58 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -64,10 +64,10 @@
     double a2 = (ALPHA_P + PHI_P)/2.0;
     double a3 = (ALPHA_P + PHI_P)/2.0;
-
+    //From Mathworld, this is another way to calculate the quaternions of a rotation
     double q0 = sin(a0)*sin(DELTA_P/2);
     double q1 = cos(a1)*sin(DELTA_P/2);
     double q2 = sin(a2)*cos(DELTA_P/2);
     double q3 = cos(a3)*cos(DELTA_P/2);
-
+    //Check that the quaternion components all match
     if (DBL_EPSILON < fabs(q0 - myST->q0)) {
         psError(PS_ERR_UNKNOWN,true,"myST->q0 is %lf, should be %lf\n", myST->q0, q0);
@@ -99,5 +99,5 @@
     double a2 = (ALPHA_P + PHI_P)/2.0;
     double a3 = (ALPHA_P + PHI_P)/2.0;
-
+    //From Mathworld, this is another way to calculate the quaternions of a rotation
     double q0 = sin(a0)*sin(DELTA_P/2);
     double q1 = cos(a1)*sin(DELTA_P/2);
@@ -111,5 +111,5 @@
         return 1;
     }
-
+    //Check that the quaternion components all match
     if (FLT_EPSILON < fabs(q0 - myST->q0)) {
         psError(PS_ERR_UNKNOWN,true,"myST->q0 is %lf, should be %lf\n", myST->q0, q0);
@@ -135,9 +135,7 @@
 }
 
-
 // We do a simple identity transformation on a few RA, DEC pairs.
 psS32 testSphereRotApply1( void )
 {
-
     psSphere *in = psSphereAlloc();
     psSphere *out = psSphereAlloc();
@@ -145,5 +143,4 @@
     psSphere *rc = NULL;
     psSphere *temp2 = psSphereAlloc();
-    //        psSphereRot *myST = psSphereRotAlloc(0.0, 0.0, 0.0);
     psSphereRot *myST = psSphereRotAlloc(ALPHA_P, DELTA_P, PHI_P);
     psSphereRot *yourST =  psSphereRotInvert(ALPHA_P, DELTA_P, PHI_P);
@@ -155,8 +152,8 @@
             in->rErr = 0.0;
             in->dErr = 0.0;
-
+            //Here we apply the sphere rotation, then the inverse
             temp2 = psSphereRotApply(temp2, myST, in);
             out = psSphereRotApply(out, yourST, temp2);
-
+            //Check that out matches in
             if (ERROR_TOL < fabs(out->r - in->r)) {
                 psError(PS_ERR_UNKNOWN,true,"out->r is %f, should be %f\n", out->r, in->r);
@@ -206,4 +203,5 @@
 psS32 testSphereRotApplyCelestial( void)
 {
+    //Test cases below were provided in ADD.
     int numTestPoints = 3;
     // ICRS coordinates
@@ -220,5 +218,5 @@
 
     for (int x = 0; x < numTestPoints; x++) {
-
+        //Setup the appropriate rotations
         psTime* time = psTimeFromMJD(t[x]);
         psSphereRot* toEcliptic = psSphereRotICRSToEcliptic(time);
@@ -246,4 +244,5 @@
             return 1;
         }
+        //The second condition here (d - 90) is used b/c 90 is a pole.
         if ( (fabs(RAD_TO_DEG(icrsFromEcliptic->r) - alpha[x]) > TOLERANCE &&
                 fabs(RAD_TO_DEG(icrsFromEcliptic->d) - 90.0) > TOLERANCE ) ||
@@ -258,11 +257,5 @@
         psFree(icrsFromEcliptic);
 
-        // apply/unapply Galactic
-        //        if (x == 1){
-        //             psSphereRot *temp = psSphereRotICRSToGalactic();
-        //             *fromGalactic = *temp;
-        //             fromGalactic->q3 *= -1.0;
-        //             psFree(temp);
-        //        }
+        //Setup galactic transformations
         psSphere* galactic = psSphereRotApply(NULL, toGalactic, icrs);
         psSphere* icrsFromGalactic = psSphereRotApply(NULL, fromGalactic, galactic);
@@ -277,4 +270,5 @@
             return 3;
         }
+        //The second condition here (d - 90) is used b/c 90 is a pole.
         if ( (fabs(RAD_TO_DEG(icrsFromGalactic->r) - alpha[x]) > TOLERANCE &&
                 fabs(RAD_TO_DEG(icrsFromGalactic->d) - 90.0) > TOLERANCE ) ||
@@ -306,4 +300,5 @@
 
     //Test Set for NULL position
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
     output = psSphereSetOffset(empty, offset, PS_SPHERICAL, PS_DEGREE);
     if (output != NULL) {
@@ -313,4 +308,5 @@
     }
     //Test Set for NULL offset
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
     output = psSphereSetOffset(offset, empty, PS_SPHERICAL, PS_DEGREE);
     if (output != NULL) {
@@ -320,4 +316,5 @@
     }
     //Test Get for NULL position1
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
     output = psSphereGetOffset(empty, origin, PS_LINEAR, PS_RADIAN);
     if (output != NULL) {
@@ -327,4 +324,5 @@
     }
     //Test Get for NULL position2
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
     output = psSphereGetOffset(origin, empty, PS_LINEAR, PS_RADIAN);
     if (output != NULL) {
@@ -354,14 +352,5 @@
     offset->d = 1.0;
     output = psSphereSetOffset(origin, offset, PS_LINEAR, PS_RADIAN);
-    /*    if ( fabs(output->r - 1.0) > 0.0001 || fabs(output->d - 1.0) > 0.0001 ) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereSetOffset failed to return correct linear offset values.\n");
-        printf("\n SphereSetOffset should be %lf, %lf and is %lf, %lf\n", offset->r, offset->d,
-            output->r, output->d);
-            return 6;
-        }
-    */
-    //    output->r *= -1.0;
-    //    output->d *= -1.0;
+
     empty = psSphereGetOffset(origin, output, PS_LINEAR, PS_RADIAN);
     if ( fabs(offset->r - empty->r) > 0.0001 || fabs(offset->d - empty->d) > 0.0001 ) {
Index: trunk/psLib/test/astro/verified/tst_psSphereOps.stderr
===================================================================
--- trunk/psLib/test/astro/verified/tst_psSphereOps.stderr	(revision 6268)
+++ trunk/psLib/test/astro/verified/tst_psSphereOps.stderr	(revision 6309)
@@ -49,10 +49,18 @@
 \**********************************************************************************/
 
+<HOST>|I|testSphereOffset
+    Following should generate an error
 <HOST>|E|psSphereSetOffset (FILE:LINENO)
     Unallowable operation: position is NULL.
+<HOST>|I|testSphereOffset
+    Following should generate an error
 <HOST>|E|psSphereSetOffset (FILE:LINENO)
     Unallowable operation: offset is NULL.
+<HOST>|I|testSphereOffset
+    Following should generate an error
 <HOST>|E|psSphereGetOffset (FILE:LINENO)
     Unallowable operation: position1 is NULL.
+<HOST>|I|testSphereOffset
+    Following should generate an error
 <HOST>|E|psSphereGetOffset (FILE:LINENO)
     Unallowable operation: position2 is NULL.
