Index: /trunk/psLib/test/astronomy/tst_psCoord.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3330)
+++ /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3331)
@@ -6,6 +6,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-25 02:47:53 $
+*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-25 20:50:35 $
 *
 *  XXX: Must test psSpherePrecess.
@@ -30,5 +30,5 @@
 static psS32 testSphereTransformApply2( void );
 static psS32 testSphereTransformICRSToEcliptic( void );
-static psS32 test6( void );
+static psS32 testSphereTransformEclipticToICRS( void );
 static psS32 test7( void );
 static psS32 test8( void );
@@ -47,6 +47,6 @@
                               {testSphereTransformApply1, 820, "psPSphereTransformApply()", 0, false},
                               {testSphereTransformApply2, 820, "psPSphereTransformApply()", 0, false},
-                              {testSphereTransformICRSToEcliptic, 0000, "psSphereTransformICRSToEcliptic()", 0, false},
-                              {test6, 0000, "psSphereTransformEclipticToICRS()", 0, false},
+                              {testSphereTransformICRSToEcliptic, 821, "psSphereTransformICRSToEcliptic()", 0, false},
+                              {testSphereTransformEclipticToICRS, 822, "psSphereTransformEclipticToICRS()", 0, false},
                               {test7, 0000, "psSphereTransformICRSToGalatic()", 0, false},
                               {test8, 0000, "psSphereTransformGalaticToICRS()", 0, false},
@@ -589,7 +589,7 @@
 // Thes values calculated from ADD-09 equations
 #define EXPECT_COS_DELTAP_2000    0.917482
-#define EXPECT_SIN_DELTAP_2000   -0.397777
+#define EXPECT_SIN_DELTAP_2000    0.397777
 #define EXPECT_COS_DELTAP_2100    0.917572
-#define EXPECT_SIN_DELTAP_2100   -0.397567
+#define EXPECT_SIN_DELTAP_2100    0.397567
 
 #define ERROR_TOL   0.0001
@@ -600,5 +600,5 @@
     psF64  expectedAlphaP = 0.0;
     psF64  expectedCosDeltaP = EXPECT_COS_DELTAP_2000;
-    psF64  expectedSinDeltaP = EXPECT_SIN_DELTAP_2000;
+    psF64  expectedSinDeltaP = -EXPECT_SIN_DELTAP_2000;
 
     // Set test date time to 1/1/2000 00:00:00
@@ -633,5 +633,5 @@
 
     expectedCosDeltaP = EXPECT_COS_DELTAP_2100;
-    expectedSinDeltaP = EXPECT_SIN_DELTAP_2100;
+    expectedSinDeltaP = -EXPECT_SIN_DELTAP_2100;
 
     // Set test date time to 1/1/2100 00:00:00
@@ -687,58 +687,93 @@
 
 
-psS32 test6( void )
-{
-    psS32 testStatus = 0;
-    psTime* now = psTimeGetTime(PS_TIME_UTC);
-    struct tm *tm_time = psTimeToTM(now);
-    psF64 MJD = psTimeToMJD(now);
-    struct tm *tmTime = psTimeToTM(now);
-    psF64 year = (psF64)(1900 - MJD + tmTime->tm_year);
-    psF64 T = year / 100.0;
-    psF64 expectedAlphaP = 0.0;
-    psF64 expectedDeltaP = DEG_TO_RAD(23.0) +
-                           SEC_TO_RAD(27.0) +
-                           MIN_TO_RAD(8.0) -
-                           (SEC_TO_RAD(46.845) * T) -
-                           (SEC_TO_RAD(0.0059) * T * T) +
-                           (SEC_TO_RAD(0.00181) * T * T * T);
-    psF64 expectedPhiP = 0.0;
-    psSphereTransform *myST = psSphereTransformEclipticToICRS(now);
-
-    if (FLT_EPSILON < fabs(sin(expectedDeltaP) - myST->sinDeltaP)) {
-        printf("ERROR: myST->sinDeltaP is %f, should be %f\n", myST->sinDeltaP, sin(expectedDeltaP));
-        testStatus = 1;
-    }
-
-    if (FLT_EPSILON < fabs(cos(expectedDeltaP) - myST->cosDeltaP)) {
-        printf("ERROR: myST->cosDeltaP is %f, should be %f\n", myST->cosDeltaP, cos(expectedDeltaP));
-        testStatus = 1;
-    }
-
-    if (FLT_EPSILON < fabs(expectedAlphaP - myST->alphaP)) {
-        printf("ERROR: myST->alphaP is %f, should be %f\n", myST->alphaP, expectedAlphaP);
-        testStatus = 3;
-    }
-
-    if (FLT_EPSILON < fabs(expectedPhiP - myST->phiP)) {
-        printf("ERROR: myST->phiP is %f, should be %f\n", myST->phiP, expectedPhiP);
-        testStatus = 4;
-    }
-
+psS32 testSphereTransformEclipticToICRS( void )
+{
+    psF64  expectedPhiP = 0.0;
+    psF64  expectedAlphaP = 0.0;
+    psF64  expectedCosDeltaP = EXPECT_COS_DELTAP_2000;
+    psF64  expectedSinDeltaP = EXPECT_SIN_DELTAP_2000;
+
+    // Set test date time to 1/1/2000 00:00:00
+    psTime* testDateTime = psTimeFromMJD(MJD_2000);
+
+    // Invoke function to set psSphereTransforma object
+    psSphereTransform *myST = psSphereTransformEclipticToICRS(testDateTime);
+
+    // Verify expected values for the specified time
+    if (ERROR_TOL < fabs(expectedSinDeltaP - myST->sinDeltaP)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->sinDeltaP is %f, should be %f",
+                myST->sinDeltaP, expectedSinDeltaP);
+        return 1;
+    }
+    if (ERROR_TOL < fabs(expectedCosDeltaP - myST->cosDeltaP)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->cosDeltaP is %f, should be %f",
+                myST->cosDeltaP, expectedCosDeltaP);
+        return 2;
+    }
+    if (ERROR_TOL < fabs(expectedAlphaP - myST->alphaP)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->alphaP is %f, should be %f",
+                myST->alphaP, expectedAlphaP);
+        return 3;
+    }
+    if (ERROR_TOL < fabs(expectedPhiP - myST->phiP)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->phiP is %f, should be %f",
+                myST->phiP, expectedPhiP);
+        return 4;
+    }
     psFree(myST);
-    psFree(tm_time);
-    psFree(tmTime);
-    psFree(now);
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereTransformEclipticToICRS() with NULL input.  Should generate error, return NULL.\n");
+    psFree(testDateTime);
+
+    expectedCosDeltaP = EXPECT_COS_DELTAP_2100;
+    expectedSinDeltaP = EXPECT_SIN_DELTAP_2100;
+
+    // Set test date time to 1/1/2100 00:00:00
+    testDateTime = psTimeFromMJD(MJD_2100);
+
+    // Invoke function to set psSphereTransforma objec
+    myST = psSphereTransformEclipticToICRS(testDateTime);
+
+    // Verify expected values for the specified time
+    if (ERROR_TOL < fabs(expectedSinDeltaP - myST->sinDeltaP)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->sinDeltaP is %f, should be %f",
+                myST->sinDeltaP, expectedSinDeltaP);
+        return 5;
+    }
+    if (ERROR_TOL < fabs(expectedCosDeltaP - myST->cosDeltaP)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->cosDeltaP is %f, should be %f",
+                myST->cosDeltaP, expectedCosDeltaP);
+        return 6;
+    }
+    if (ERROR_TOL < fabs(expectedAlphaP - myST->alphaP)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->alphaP is %f, should be %f",
+                myST->alphaP, expectedAlphaP);
+        return 7;
+    }
+    if (ERROR_TOL < fabs(expectedPhiP - myST->phiP)) {
+        psError(PS_ERR_UNKNOWN,true,"myST->phiP is %f, should be %f",
+                myST->phiP, expectedPhiP);
+        return 8;
+    }
+    psFree(myST);
+    psFree(testDateTime);
+
+    // Verify if argument psTime is NULL, function returns NULL and error message generated
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
     myST = psSphereTransformEclipticToICRS(NULL);
     if (myST != NULL) {
-        printf("TEST ERROR: psSphereTransformApply() did not return NULL.\n");
-        testStatus = false;
-        myST = NULL;
-    }
-
-    return(testStatus);
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformEclipticICRS() did not return NULL.");
+        return 9;
+    }
+
+    // Verify if argument psTime is less than 1900, function return NULL and error msg generated
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
+    testDateTime = psTimeFromMJD(MJD_1900 - 1.0);
+    myST = psSphereTransformEclipticToICRS(testDateTime);
+    if (myST != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"psSphereTransformEclipticToICRS() did not return NULL.");
+        return 10;
+    }
+    psFree(testDateTime);
+
+    return 0;
 }
 
Index: /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3330)
+++ /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3331)
@@ -121,6 +121,12 @@
 \**********************************************************************************/
 
+<DATE><TIME>|<HOST>|I|testSphereTransformEclipticToICRS
+    Following should generate an error message
 <DATE><TIME>|<HOST>|E|psSphereTransformEclipticToICRS (FILE:LINENO)
     Unallowable operation: time is NULL.
+<DATE><TIME>|<HOST>|I|testSphereTransformEclipticToICRS
+    Following should generate an error message
+<DATE><TIME>|<HOST>|E|psSphereTransformEclipticToICRS (FILE:LINENO)
+    Specified time is less than 1900.
 
 ---> TESTPOINT PASSED (psCoord{psSphereTransformEclipticToICRS()} | tst_psCoord.c)
Index: /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout	(revision 3330)
+++ /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout	(revision 3331)
@@ -32,6 +32,4 @@
 -------------------------------------------------------------------
 -------------------------------------------------------------------
-Calling psSphereTransformEclipticToICRS() with NULL input.  Should generate error, return NULL.
--------------------------------------------------------------------
 Calling psSphereGetOffset() with NULL position1.  Should generate error, return NULL.
 -------------------------------------------------------------------
