Index: /trunk/psLib/test/astronomy/tst_psCoord.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3359)
+++ /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3360)
@@ -6,6 +6,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-03-01 21:40:28 $
+*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-03-02 03:40:37 $
 *
 *  XXX: Must test psSpherePrecess.
@@ -36,4 +36,5 @@
 static psS32 testSphereTransformICRSToGalactic( void );
 static psS32 testSphereTransformGalacticToICRS( void );
+static psS32 testSphereTransformPrecess(void);
 //static psS32 test20( void );
 //static psS32 test21( void );
@@ -57,4 +58,5 @@
                               {testSphereTransformICRSToGalactic, 824, "psSphereTransformICRSToGalactic()", 0, false},
                               {testSphereTransformGalacticToICRS, 823, "psSphereTransformGalacticToICRS()", 0, false},
+                              {testSphereTransformPrecess, 825, "psSphereTransformPrecess()", 0, false},
                               //         {test20, 0000, "psProject()", 0, false},
                               //         {test21, 0000, "psDeProject()", 0, false},
@@ -102,4 +104,5 @@
 #define DELTA_P 2.0
 #define PHI_P 3.0
+
 psS32 testSphereTransformAlloc( void )
 {
@@ -850,5 +853,4 @@
 psS32 testSphereTransformApply5( void)
 {
-
     psSphereTransform*  testTransform;
     psSphere*           inputCoord = psSphereAlloc();
@@ -956,4 +958,119 @@
     psFree(inputCoord);
     psFree(inverseOutputCoord);
+
+    return 0;
+}
+
+#define SPHERE_PRECESS_TP1_R            0.0               //    0.0       degrees
+#define SPHERE_PRECESS_TP1_D            0.0               //    0.0       degrees
+#define SPHERE_PRECESS_TP1_EXPECT_R     6.238453          //  357.437     degrees
+#define SPHERE_PRECESS_TP1_EXPECT_D    -0.019426          //   -1.113     degrees
+#define SPHERE_PRECESS_TP2_R            0.0               //    0.0       degrees
+#define SPHERE_PRECESS_TP2_D            1.570796          //   90.0       degrees
+#define SPHERE_PRECESS_TP2_EXPECT_R     6.260828          //  358.719     degrees
+#define SPHERE_PRECESS_TP2_EXPECT_D     1.551353          //   88.886     degrees
+#define SPHERE_PRECESS_TP3_R            3.141593          //  180.0       degrees
+#define SPHERE_PRECESS_TP3_D            0.523599          //   30.0       degrees
+#define SPHERE_PRECESS_TP3_EXPECT_R     3.096616          //  177.423     degrees
+#define SPHERE_PRECESS_TP3_EXPECT_D     0.543024          //   31.113     degrees
+
+psS32 testSphereTransformPrecess( void )
+{
+    psSphere*     inputCoord  = psSphereAlloc();
+    psSphere*     outputCoord = NULL;
+    psTime*       fromTime    = psTimeFromMJD(MJD_2100);
+    psTime*       toTime      = psTimeFromMJD(MJD_1900);
+
+    // Set input coordinate
+    inputCoord->r = SPHERE_PRECESS_TP1_R;
+    inputCoord->d = SPHERE_PRECESS_TP1_D;
+    inputCoord->rErr = 0.0;
+    inputCoord->dErr = 0.0;
+
+    // Calculate precess
+    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
+    // Verify return with expected values
+    if( fabs(outputCoord->r - SPHERE_PRECESS_TP1_EXPECT_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
+                outputCoord->r,SPHERE_PRECESS_TP1_EXPECT_R);
+        return 1;
+    }
+    if( fabs(outputCoord->d - SPHERE_PRECESS_TP1_EXPECT_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
+                outputCoord->d,SPHERE_PRECESS_TP1_EXPECT_D);
+        return 2;
+    }
+    psFree(outputCoord);
+
+    // Set input coordinate
+    inputCoord->r = SPHERE_PRECESS_TP2_R;
+    inputCoord->d = SPHERE_PRECESS_TP2_D;
+    inputCoord->rErr = 0.0;
+    inputCoord->dErr = 0.0;
+
+    // Calculate precess
+    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
+    // Verify return with expected values
+    if( fabs(outputCoord->r - SPHERE_PRECESS_TP2_EXPECT_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
+                outputCoord->r,SPHERE_PRECESS_TP2_EXPECT_R);
+        return 3;
+    }
+    if( fabs(outputCoord->d - SPHERE_PRECESS_TP2_EXPECT_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
+                outputCoord->d,SPHERE_PRECESS_TP2_EXPECT_D);
+        return 4;
+    }
+    psFree(outputCoord);
+
+    // Set input coordinate
+    inputCoord->r = SPHERE_PRECESS_TP3_R;
+    inputCoord->d = SPHERE_PRECESS_TP3_D;
+    inputCoord->rErr = 0.0;
+    inputCoord->dErr = 0.0;
+
+    // Calculate precess
+    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
+    // Verify return with expected values
+    if( fabs(outputCoord->r - SPHERE_PRECESS_TP3_EXPECT_R) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
+                outputCoord->r,SPHERE_PRECESS_TP3_EXPECT_R);
+        return 5;
+    }
+    if( fabs(outputCoord->d - SPHERE_PRECESS_TP3_EXPECT_D) > ERROR_TOL) {
+        psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
+                outputCoord->d,SPHERE_PRECESS_TP3_EXPECT_D);
+        return 6;
+    }
+    psFree(outputCoord);
+
+    // Invoke precess with invalid parameter
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
+    outputCoord = psSpherePrecess(inputCoord, fromTime, NULL);
+    if(outputCoord != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
+        return 7;
+    }
+
+    // Invoke precess with invalid parameter
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
+    outputCoord = psSpherePrecess(inputCoord, NULL, toTime);
+    if(outputCoord != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
+        return 8;
+    }
+
+    // Invoke precess with invalid parameter
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
+    outputCoord = psSpherePrecess(NULL, fromTime, toTime);
+    if(outputCoord != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
+        return 9;
+    }
+
+    // Free objects
+    psFree(fromTime);
+    psFree(toTime);
+    psFree(inputCoord);
 
     return 0;
Index: /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3359)
+++ /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3360)
@@ -179,4 +179,25 @@
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psCoord.c                                              *
+*            TestPoint: psCoord{psSphereTransformPrecess()}                        *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<DATE><TIME>|<HOST>|I|testSphereTransformPrecess
+    Following should generate an error message
+<DATE><TIME>|<HOST>|E|psSpherePrecess (FILE:LINENO)
+    Unallowable operation: toTime is NULL.
+<DATE><TIME>|<HOST>|I|testSphereTransformPrecess
+    Following should generate an error message
+<DATE><TIME>|<HOST>|E|psSpherePrecess (FILE:LINENO)
+    Unallowable operation: fromTime is NULL.
+<DATE><TIME>|<HOST>|I|testSphereTransformPrecess
+    Following should generate an error message
+<DATE><TIME>|<HOST>|E|psSpherePrecess (FILE:LINENO)
+    Unallowable operation: coords is NULL.
+
+---> TESTPOINT PASSED (psCoord{psSphereTransformPrecess()} | tst_psCoord.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psCoord.c                                              *
 *            TestPoint: psCoord{psSphereGetOffset()}                               *
 *             TestType: Positive                                                   *
