Index: trunk/psLib/test/astro/tst_psCoord.c
===================================================================
--- trunk/psLib/test/astro/tst_psCoord.c	(revision 24303)
+++ 	(revision )
@@ -1,469 +1,0 @@
-/** @file  tst_psCoord.c
-*
-*  @brief The code will ...
-*
-*
-*  @author GLG, MHPCC
-*
-*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-02-28 02:53:03 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include "psTest.h"
-#include "pslib_strict.h"
-static psS32 testPlaneTransformAlloc(void);
-static psS32 testPlaneDistortAlloc(void);
-static psS32 testPlaneAlloc(void);
-static psS32 testPlaneTransformApply(void);
-static psS32 testPlaneDistortApply(void);
-static psS32 testPixelsTransform(void);
-
-testDescription tests[] = {
-                              {testPlaneTransformAlloc, 826, "psPlaneTransformAlloc()", 0, false},
-                              {testPlaneDistortAlloc, 827, "psPlaneDistortAlloc()", 0, false},
-                              {testPlaneAlloc, -1, "psPlaneAlloc()", 0, false},
-                              {testPlaneTransformApply, 831, "psPlaneTransformApply()", 0, false},
-                              {testPlaneDistortApply, 832, "psPlaneDistortApply()", 0, false},
-                              {testPixelsTransform, 833, "psPixelsTransform()", 0, false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetFormat("HLNM");
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psCoord", tests, argc, argv ) );
-}
-
-#define ORDER_X 2
-#define ORDER_Y 3
-#define ORDER_Z 4
-#define ORDER_T 5
-
-psS32 testPlaneAlloc( void )
-{
-    // Allocate psPlane.
-    psPlane *myP = psPlaneAlloc();
-
-    // Verify returned value is not NULL
-    if(myP == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "psPlaneAlloc() returned NULL not expected.");
-        return 1;
-    }
-
-    // Verify returned transform has members set properly
-    if (!isnan(myP->x)) {
-        psError(PS_ERR_UNKNOWN,true,"myP->x is %d, should be %d", myP->x, NAN);
-        return 2;
-    }
-
-    if (!isnan(myP->y)) {
-        psError(PS_ERR_UNKNOWN,true,"myP->y is %d, should be %d", myP->y, NAN);
-        return 3;
-    }
-
-    if (!isnan(myP->xErr)) {
-        psError(PS_ERR_UNKNOWN,true,"myP->xErr is %d, should be %d", myP->xErr, NAN);
-        return 4;
-    }
-
-    if (!isnan(myP->yErr)) {
-        psError(PS_ERR_UNKNOWN,true,"myP->yErr is %d, should be %d", myP->yErr, NAN);
-        return 5;
-    }
-
-    // Free psPlane
-    psFree(myP);
-
-    return 0;
-}
-
-psS32 testPlaneTransformAlloc( void )
-{
-    // Allocate psPlaneTransform with known x and y terms
-    psPlaneTransform *myPT = psPlaneTransformAlloc(ORDER_X, ORDER_Y);
-
-    // Verify returned value is not NULL
-    if(myPT == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Function returned NULL not expected.");
-        return 1;
-    }
-
-    // Verify returned transform has members set properly
-    if (myPT->x->nX != ORDER_X) {
-        psError(PS_ERR_UNKNOWN,true,"myPT->x->nX is %d, should be %d",
-                myPT->x->nX, ORDER_X);
-        return 2;
-    }
-    if (myPT->y->nX != ORDER_X) {
-        psError(PS_ERR_UNKNOWN,true,"myPT->y->nX is %d, should be %d",
-                myPT->y->nX, ORDER_X);
-        return 3;
-    }
-    if (myPT->x->nY != ORDER_Y) {
-        psError(PS_ERR_UNKNOWN,true,"myPT->x->nY is %d, should be %d",
-                myPT->x->nY, ORDER_Y);
-        return 4;
-    }
-    if (myPT->y->nY != ORDER_Y) {
-        psError(PS_ERR_UNKNOWN,true,"myPT->y->nY is %d, should be %d",
-                myPT->y->nY, ORDER_Y);
-        return 5;
-    }
-
-    // Free plane transform
-    psFree(myPT);
-
-    // Attempt to specify negative x order and verify NULL returned and errror message generated
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative x order");
-    myPT = psPlaneTransformAlloc(-1, 1);
-    if (myPT != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psPlaneTransformAlloc() did not return NULL.");
-        return 6;
-    }
-
-    // Attempt to specify negative y order and verify NULL returned and error message generated
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: negative y order");
-    myPT = psPlaneTransformAlloc(1, -1);
-    if (myPT != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psPlaneTransformAlloc() did not return NULL.");
-        return 7;
-    }
-
-    psFree(myPT);
-
-    return 0;
-}
-
-
-psS32 testPlaneDistortAlloc( void )
-{
-    // Invoke function with known parameters
-    psPlaneDistort *myPD = psPlaneDistortAlloc(ORDER_X, ORDER_Y, ORDER_Z, ORDER_T);
-
-    // Verify NULL is not returned
-    if(myPD == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL not expected");
-        return 1;
-    }
-    // Verify the terms are properly set after allocation
-    if (myPD->x->nX != ORDER_X) {
-        psError(PS_ERR_UNKNOWN,true,"myPD->x->nX is %d, should be %d",
-                myPD->x->nX, ORDER_X);
-        return 2;
-    }
-    if (myPD->y->nX != ORDER_X) {
-        psError(PS_ERR_UNKNOWN,true,"myPD->y->nX is %d, should be %d",
-                myPD->y->nX, ORDER_X);
-        return 3;
-    }
-    if (myPD->x->nY != ORDER_Y) {
-        psError(PS_ERR_UNKNOWN,true,"myPD->x->nY is %d, should be %d",
-                myPD->x->nY, ORDER_Y);
-        return 4;
-    }
-    if (myPD->y->nY != ORDER_Y) {
-        psError(PS_ERR_UNKNOWN,true,"myPD->y->nY is %d, should be %d",
-                myPD->y->nY, ORDER_Y);
-        return 5;
-    }
-    if (myPD->x->nZ != ORDER_Z) {
-        psError(PS_ERR_UNKNOWN,true,"myPD->x->nZ is %d, should be %d",
-                myPD->x->nZ, ORDER_Z);
-        return 6;
-    }
-    if (myPD->y->nZ != ORDER_Z) {
-        psError(PS_ERR_UNKNOWN,true,"myPD->y->nZ is %d, should be %d",
-                myPD->y->nZ, ORDER_Z);
-        return 7;
-    }
-    if (myPD->x->nT != ORDER_T) {
-        psError(PS_ERR_UNKNOWN,true,"myPD->x->nT is %d, should be %d",
-                myPD->x->nT, ORDER_T);
-        return 8;
-    }
-    if (myPD->y->nT != ORDER_T) {
-        psError(PS_ERR_UNKNOWN,true,"myPD->y->nT is %d, should be %d",
-                myPD->y->nT, ORDER_T);
-        return 9;
-    }
-    // Free psPlaneTransform
-    psFree(myPD);
-
-    // Invoke function with negative x order parameter
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative x order");
-    myPD = psPlaneDistortAlloc(-1, 1, 1, 1);
-    if (myPD != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
-        return 10;
-    }
-
-    // Invoke function with negative y order parameter
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative y order");
-    myPD = psPlaneDistortAlloc(1, -1, 1, 1);
-    if (myPD != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
-        return 11;
-    }
-
-    // Invoke function with negative z order parameter
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative z order");
-    myPD = psPlaneDistortAlloc(1, 1, -1, 1);
-    if (myPD != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
-        return 12;
-    }
-
-    // Invoke function with negative t order parameter
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative w order");
-    myPD = psPlaneDistortAlloc(1, 1, 1, -1);
-    if (myPD != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
-    }
-
-    return 0;
-}
-
-#define N 10
-// We do a simple identity transformation on a few x,y pairs.
-psS32 testPlaneTransformApply( void )
-{
-    psPlane*          out = NULL;
-    psPolynomial2D*  tmp2DPoly = NULL;
-    psPlane*          rc;
-
-    // Create input coordinate
-    psPlane* in = psPlaneAlloc();
-    if(in == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return from psPlaneAlloc");
-        return 1;
-    }
-
-    // Create transform
-    psPlaneTransform* pt = psPlaneTransformAlloc(2,2);
-
-    // Set transform coefficients so the x coord input will equal x coord output, same for y
-    pt->x->coeff[1][0] = 1.0;
-    pt->y->coeff[0][1] = 1.0;
-
-    // Apply transform for several points
-    for (psS32 i = 0; i < N; i++) {
-        in->x = (psF64) i;
-        in->y = (psF64) (i + 5.0);
-        in->xErr = 0.0;
-        in->yErr = 0.0;
-
-        // Verify function does not return NULL
-        out = psPlaneTransformApply(out, pt, in);
-        if( out  == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Expected non-NULL return value");
-            return 1;
-        }
-        // Verify the expected values are returned
-        if (FLT_EPSILON < fabs(out->x - in->x)) {
-            psError(PS_ERR_UNKNOWN,true,"out.x is %lf, should be %lf", out->x, in->x);
-            return 3;
-        }
-        if (FLT_EPSILON < fabs(out->y - in->y)) {
-            psError(PS_ERR_UNKNOWN,true,"out.y is %lf, should be %lf", out->y, in->y);
-            return 4;
-        }
-    }
-    psFree(out);
-
-    // Verify return null and error message generater for null specified transform
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL psPlaneTransform");
-    rc = psPlaneTransformApply(NULL, NULL, in);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Function did not return NULL as expected for NULL psPlaneTransform.");
-        return 5;
-    }
-
-    // Verify return null and error message generated for null psPlaneTransform x coeff
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL x coeff psPlaneTransform");
-    tmp2DPoly = pt->x;
-    pt->x = NULL;
-    rc = psPlaneTransformApply(NULL, pt, in);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Function did not return NULL as expected for NULL x coeff psPlaneTransform");
-        return 6;
-    }
-    pt->x = tmp2DPoly;
-
-    // Verify return null and error message generated for null psPlaneTransform y coeff
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL y coeff psPlaneTransform");
-    tmp2DPoly = pt->y;
-    pt->y = NULL;
-    rc = psPlaneTransformApply(NULL, pt, in);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Function did not return NULL as expected for NULL y coeff psPlaneTransform");
-        return 7;
-    }
-    pt->y = tmp2DPoly;
-
-    // Verify return null and error message generated for null psPlane coordinate
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL psPlane");
-    rc = psPlaneTransformApply(NULL, pt, NULL);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Function did not return NULL as expected for NULL psPlane");
-        return 8;
-    }
-
-    psFree(pt);
-    psFree(in);
-
-    return 0;
-}
-
-#define COLOR 1.0
-#define MAGNITUDE 1.0
-// We do a simple identity transformation on a few x,y pairs.  For x and y,
-// we add in the COLOR and MAGNITUDE.
-psS32 testPlaneDistortApply( void )
-{
-    psPlane*         out       = NULL;
-    psPlane*         rc        = NULL;
-    psPolynomial4D* tmp4DPoly = NULL;
-
-    // Allocate input coordinate
-    psPlane* in = psPlaneAlloc();
-
-    // Create psPlaneTransform structure
-    psPlaneDistort*  pt = psPlaneDistortAlloc(2, 2, 2, 2);
-
-    pt->x->coeff[1][0][0][0] = 1.0;
-    pt->x->coeff[0][0][1][0] = 1.0;
-    pt->x->coeff[0][0][0][1] = 1.0;
-
-    pt->y->coeff[0][1][0][0] = 1.0;
-    pt->y->coeff[0][0][1][0] = 1.0;
-    pt->y->coeff[0][0][0][1] = 1.0;
-
-    for (psS32 i = 0; i < N; i++) {
-        in->x = (psF64) i;
-        in->y = (psF64) (i + 5.0);
-        in->xErr = 0.0;
-        in->yErr = 0.0;
-        out = psPlaneDistortApply(out, pt, in, COLOR, MAGNITUDE);
-
-        // Verify return value is not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Expected non-NULL return");
-            return 1;
-        }
-        // Verify return value contains expected values
-        if (FLT_EPSILON < fabs(out->x - COLOR - MAGNITUDE - in->x)) {
-            psError(PS_ERR_UNKNOWN,true,"out->x is %lf, should be %lf",
-                    out->x, in->x + COLOR + MAGNITUDE);
-            return 2;
-        }
-        if (FLT_EPSILON < fabs(out->y - COLOR - MAGNITUDE - in->y)) {
-            psError(PS_ERR_UNKNOWN,true,"out->y is %lf, should be %lf",
-                    out->y, in->y + COLOR + MAGNITUDE);
-            return 3;
-        }
-    }
-    psFree(out);
-
-    // Attempt to invoke psPlaneDistortApply with NULL psPlaneDistort
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null psPlaneDistort");
-    rc = psPlaneDistortApply(NULL, NULL, in, COLOR, MAGNITUDE);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL.");
-        return 4;
-    }
-
-    // Attempt to invoke psPlaneDistortApply with NULL psPlaneDistort x member
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null x member psPlaneDistort");
-    tmp4DPoly = pt->x;
-    pt->x = NULL;
-    rc = psPlaneDistortApply(NULL, pt, in, COLOR, MAGNITUDE);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL.");
-        return 5;
-    }
-    pt->x = tmp4DPoly;
-
-    // Attempt to invoke psPlaneDistortApply with NULL psPlaneDistort y member
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null y member psPlaneDistort");
-    tmp4DPoly = pt->y;
-    pt->y = NULL;
-    rc = psPlaneDistortApply(NULL, pt, in, COLOR, MAGNITUDE);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL.");
-        return 6;
-    }
-    pt->y = tmp4DPoly;
-
-    // Attempt to invoke psPlaneDistortApply with NULL input psPlane
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null input psPlane");
-    rc = psPlaneDistortApply(NULL, pt, NULL, COLOR, MAGNITUDE);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL");
-        return 7;
-    }
-
-    psFree(pt);
-    psFree(in);
-
-    return 0;
-}
-
-psS32 testPixelsTransform(void)
-{
-    psPixels *input = NULL;
-    psPixels *output = NULL;
-    psPlaneTransform *trans = psPlaneTransformAlloc(1, 3);
-
-    //Return NULL for NULL input pixels
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    output = psPixelsTransform(output, input, trans);
-    if (output != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psPixelsTransform failed to return NULL for NULL input pixels.\n");
-        return 1;
-    }
-    //Return NULL for NULL input PlaneTransform
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    output = psPixelsTransform(output, input, NULL);
-    if (output != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psPixelsTransform failed to return NULL for NULL psPlaneTransform.\n");
-        return 2;
-    }
-
-    input = psPixelsAlloc(2);
-    input->n = 2;
-    input->data[0].x = 1.0;
-    input->data[0].y = 1.0;
-    input->data[1].x = 1.0;
-    input->data[1].y = 6.0;
-    trans->x->coeff[0][0] = 0;
-    trans->x->coeff[1][0] = 1.0;
-    trans->y->coeff[0][0] = 0;
-    trans->y->coeff[0][0] = 0;
-    trans->y->coeff[0][2] = 0.5;
-
-    //Verify that the output pixels are what we expected
-    output = psPixelsTransform(output, input, trans);
-    int nExpected = 9;
-    if (output->n != nExpected) {
-        psError(PS_ERR_BAD_PARAMETER_SIZE, false,
-                "psPixelsTransform failed to return the expected number of pixels.\n");
-        printf("\n output returned with %ld pixels\n\n", output->n);
-        for (int i = 0; i < output->n; i++) {
-            printf("  (%6.2lf, %6.2lf) pixel %d\n", output->data[i].x, output->data[i].y, i+1);
-        }
-        return 3;
-    }
-
-    psFree(trans);
-    psFree(input);
-    psFree(output);
-
-    return 0;
-}
-
Index: trunk/psLib/test/astro/tst_psCoord01.c
===================================================================
--- trunk/psLib/test/astro/tst_psCoord01.c	(revision 24303)
+++ 	(revision )
@@ -1,999 +1,0 @@
-/**  @file  tst_psCoord01.c
-*
-*    @brief  The code will test several functions with PSLib source file
-*            psCoord.c
-*
-*    @author Eric Van Alst, MHPCC
-*
-* XXX: must do (r,d) -> (x, y) -> (r, d) test to ensure correctness.
-* XXX: The (Xs, Ys) scales are not be used properly.
-*
-*
-*    @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
-*    @date  $Date: 2006-05-26 01:23:41 $
-*    @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
-*    @date  $Date: 2006-05-26 01:23:41 $
-*
-*    Copyright 2005 Maui High Performance Computing Center, Univ. of Hawaii
-*/
-
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static psS32 testProjectionAlloc(void);
-static psS32 testProjectTan(void);
-static psS32 testDeprojectTan(void);
-static psS32 testProjectSin(void);
-static psS32 testDeprojectSin(void);
-static psS32 testProjectAit(void);
-static psS32 testDeprojectAit(void);
-static psS32 testProjectPar(void);
-static psS32 testDeprojectPar(void);
-static psS32 testProjectFail(void);
-static psS32 testDeprojectFail(void);
-static psS32 testSetOffsetSphere(void);
-static psS32 testSetOffsetLinear(void);
-static psS32 testGetOffsetSphere(void);
-static psS32 testGetOffsetLinear(void);
-static psS32 testProjectTanDeProjectTan(void);
-
-testDescription tests[] = {
-                              {testProjectionAlloc, 833, "psProjectionAlloc",0,false},
-                              {testProjectFail, 834, "psProject",0,false},
-                              {testDeprojectFail, 835, "psProject",0,false},
-                              {testSetOffsetSphere, 0000, "psSphereSetOffset",0,false},
-                              {testSetOffsetLinear, 0000, "psSphereSetOffset",0,false},
-                              {testGetOffsetSphere, 0000, "psSphereGetOffset",0,false},
-                              {testGetOffsetLinear, 0000, "psSphereGetOffset",0,false},
-                              {NULL},
-                              /* XXX: Tests removed pending valuation -- test itself may be faulty. */
-                              {testProjectTan, 834, "psProject(TAN)",0,false},
-                              {testDeprojectTan, 835, "psDeproject(TAN)",0,false},
-                              {testProjectSin, 834, "psProject(SIN)",0,false},
-                              {testDeprojectSin, 835, "psDeproject(SIN)",0,false},
-                              {testProjectAit, 834, "psProject(AIT)",0,false},
-                              {testDeprojectAit, 835, "psDeproject(AIT)",0,false},
-                              {testProjectPar, 834, "psProject(PAR)",0,false},
-                              {testDeprojectPar, 835, "psDeproject(PAR)",0,false},
-                              {testProjectTanDeProjectTan, 0000, "psProject(TAN) -> psDeproject(TAN)",0,false}
-                          };
-
-
-#define ERROR_TOL    0.0001
-#define TESTPOINTS   4
-#define DEG_INC   30.0
-
-#define MY_TINY 0.0001
-#define PS_COMPARE_TINY_THEN_PRINT_ERROR(ACTUAL, EXPECT, TESTSTATUS) \
-if (MY_TINY < fabs(EXPECT - ACTUAL)) { \
-    psError(PS_ERR_UNKNOWN,true,"%s is %lg, should be %lg", #ACTUAL, ACTUAL, EXPECT, TESTSTATUS); \
-    return TESTSTATUS; \
-}
-
-
-//  alpha, delta, alpha-center, delta-center, scale-x, scale-y
-psF64 projectionTestPoint[TESTPOINTS][6] = {
-            {  0.785398,  0.785398,  0.000000,  0.000000,  1.000000,  1.000000 },
-            {  0.100000,  1.500000,  0.500000,  0.250000,  1.000000,  1.000000 },
-            {  0.628319,  0.448799,  0.000000,  0.000000,  0.250000,  0.750000 },
-            { -1.047196,  0.222222, -0.250000,  0.000000,  1.500000,  1.250000 }
-        };
-
-// Expected values for TAN
-psF64 projectionTanExpected[TESTPOINTS][2] = {
-            { -1.000000, -1.414214 },
-            {  0.088884, -3.066567 },
-            { -0.181636, -0.446444 },
-            {  1.535818, -0.404231 }
-        };
-
-// Expected values for SIN
-psF64 projectionSinExpected[TESTPOINTS][2] = {
-            { -0.500000, -0.707101 },
-            {  0.027546, -0.950366 },
-            { -0.132394, -0.325413 },
-            {  1.046712, -0.275497 }
-        };
-
-// Expected values for AIT
-psF64 projectionAitExpected[TESTPOINTS][2] = {
-            { -0.549175,  0.523375 },
-            {  0.027895,  0.313807 },
-            { -0.162822,  0.607646 },
-            {  1.455312,  0.955388 }
-        };
-
-// Expected values for PAR
-psF64 projectionParExpected[TESTPOINTS][2] = {
-            { -0.541244,  0.545532 },
-            {  0.027703,  0.329366 },
-            { -0.157157,  0.633550 },
-            {  1.432951,  0.971372 }
-        };
-
-// Testpoints, offset and expected values for psSphereSetOffset test
-#define TESTPOINTS_OFFSET  4
-psF64 setOffsetTestpoint[TESTPOINTS_OFFSET][2] = {
-            { 0.50,  0.50 },
-            {-0.50,  0.50 },
-            { 0.00,  0.00 },
-            { 1.50, -0.10 }
-        };
-
-psF64 setOffsetOffset[TESTPOINTS_OFFSET][2] = {
-            { 0.190761, -0.272205 },
-            {-0.553049, -0.460926 },
-            { 0.100335,-14.172222 },
-            {14.172222, -0.100335 }
-        };
-
-psF64 setOffsetResult[TESTPOINTS_OFFSET][2] = {
-            //XXX: Eugene says his values are correct, so i'm changing these values to the output.
-            //            { 0.25,  0.75 },
-            //            { 0.20,  0.80 },
-            //            {-0.10,  1.50 },
-            //            { 0.00,  0.00 }
-            { 0.68702,   0.230294},
-            { -0.966388,  0.0608434 },
-            {0.10,  -1.50 },
-            { 3.00141, -0.0140538  }
-        };
-
-psF64 getOffsetTestpoint1[TESTPOINTS_OFFSET][2] = {
-            { 0.00,  0.00 },
-            {-0.25,  0.50 },
-            { 0.50, -0.25 },
-            { 0.25, -0.10 }
-        };
-
-psF64 getOffsetTestpoint2[TESTPOINTS_OFFSET][2] = {
-            { 0.75,  0.25 },
-            { 0.40, -0.60 },
-            { 1.50,  0.50 },
-            { 0.10,  0.75 }
-        };
-
-psF64 getOffsetResult[TESTPOINTS_OFFSET][2] = {
-            //XXX: Eugene says his values are correct, so i'm changing these values to the output.
-            //            { -0.931596, -0.348976 },
-            //            { -1.632830,  2.649629 },
-            //            { -2.166795, -1.707211 },
-            //            {  0.167752, -1.151351 }
-            { 0.931596, 0.348976 },
-            { 1.632830,  -2.649629 },
-            { 2.166795, 1.707211 },
-            {  -0.167752, 1.151351 }
-        };
-
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetFormat("HLNM");
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( !runTestSuite(stderr,"psCoord",tests,argc,argv) );
-}
-
-psS32 testProjectionAlloc(void)
-{
-    // Allocate new psProjection structure
-    psProjection*  myProjection = psProjectionAlloc(1.1, 2.2, 3.3, 4.4, PS_PROJ_AIT);
-
-    // Verify NULL is not returned
-    if(myProjection == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL");
-        return 1;
-    }
-    // Verify the members are set correctly
-    if(myProjection->R != 1.1) {
-        psError(PS_ERR_UNKNOWN,true,"R member set to %lg, but expected %lg",
-                myProjection->R, 1.1);
-        return 2;
-    }
-    if(myProjection->D != 2.2) {
-        psError(PS_ERR_UNKNOWN,true,"D member set to %lg, but expected %lg",
-                myProjection->D, 2.2);
-        return 3;
-    }
-    if(myProjection->Xs != 3.3) {
-        psError(PS_ERR_UNKNOWN,true,"Xs member set to %lg, but expected %lg",
-                myProjection->Xs, 3.3);
-        return 4;
-    }
-    if(myProjection->Ys != 4.4) {
-        psError(PS_ERR_UNKNOWN,true,"Ys member set to %lg, but expected %lg",
-                myProjection->Ys, 4.4);
-        return 5;
-    }
-    if(myProjection->type != PS_PROJ_AIT) {
-        psError(PS_ERR_UNKNOWN,true,"type member set to %d, but expected %d",
-                myProjection->type, PS_PROJ_AIT);
-        return 6;
-    }
-
-    // Free projection
-    psFree(myProjection);
-
-    return 0;
-}
-
-//HEY
-psS32 testProjectTan(void)
-{
-    psPlane*       out = NULL;
-    psSphere*      in = psSphereAlloc();
-    psSphere*      inTest = NULL;
-    psProjection*  myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_TAN);
-
-    // Perform projecton on various test points
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-
-        // Initialize input and project members
-        in->r = projectionTestPoint[i][0];
-        in->d = projectionTestPoint[i][1];
-        myProjection->R = projectionTestPoint[i][2];
-        myProjection->D = projectionTestPoint[i][3];
-        myProjection->Xs = projectionTestPoint[i][4];
-        myProjection->Ys = projectionTestPoint[i][5];
-
-        // Perform projection
-        out = psProject(in, myProjection);
-        inTest = psDeproject(out, myProjection);
-
-        // Verify output not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Return null not expected");
-            return i*10+3;
-        }
-
-        // Verify output is as expected
-        if(fabs(out->x - projectionTanExpected[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psPlane->x = %lg  expected %lg",
-                    i,out->x, projectionTanExpected[i][0]);
-            return i*10+1;
-        }
-        if(fabs(out->y - projectionTanExpected[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint % d  psPlane->y = %lg  expected %lg",
-                    i,out->y, projectionTanExpected[i][1]);
-            return i*10+2;
-        }
-
-        // Verify output is as expected
-        if(fabs(in->r - inTest->r) > ERROR_TOL) {
-            printf("TEST ER (in->r, inTest->r) (%.2f %.2f)\n", in->r, inTest->r);
-            return i*10+4;
-        }
-        if(fabs(in->d - inTest->d) > ERROR_TOL) {
-            printf("TEST ERROR: (in->d, inTest->d) (%.2f %.2f)\n", in->d, inTest->d);
-            return i*10+5;
-        }
-
-        psFree(inTest);
-        psFree(out);
-    }
-
-    psFree(in);
-    psFree(myProjection);
-
-    return 0;
-}
-
-psS32 testDeprojectTan(void)
-{
-    psSphere*       out = NULL;
-    psPlane*        in = psPlaneAlloc();
-    psProjection*   myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_TAN);
-
-    // Perform deprojection on various test points
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-
-        // Initialize input and projection members
-        in->x = projectionTanExpected[i][0];
-        in->y = projectionTanExpected[i][1];
-        myProjection->R = projectionTestPoint[i][2];
-        myProjection->D = projectionTestPoint[i][3];
-        myProjection->Xs = projectionTestPoint[i][4];
-        myProjection->Ys = projectionTestPoint[i][5];
-
-        // Perform deprojection
-        out = psDeproject(in, myProjection);
-
-        // Verify output is not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Return null not expected");
-            return 20*i;
-        }
-
-        // Verify output is as expected
-        if(fabs(out->r - projectionTestPoint[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psSphere->r = %lg  expected %lg",
-                    i,out->r,projectionTestPoint[i][0]);
-            return 20*i + 1;
-        }
-        if(fabs(out->d - projectionTestPoint[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psSphere->d = %lg expected %lg",
-                    i, out->d, projectionTestPoint[i][1]);
-            return 20*i + 2;
-        }
-        psFree(out);
-    }
-
-    psFree(in);
-    psFree(myProjection);
-
-    return 0;
-}
-
-psS32 testProjectSin(void)
-{
-    psPlane*       out = NULL;
-    psSphere*      in = psSphereAlloc();
-    psProjection*  myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_SIN);
-
-    // Perform projecton on various test points
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-
-        // Initialize input and project members
-        in->r = projectionTestPoint[i][0];
-        in->d = projectionTestPoint[i][1];
-        myProjection->R = projectionTestPoint[i][2];
-        myProjection->D = projectionTestPoint[i][3];
-        myProjection->Xs = projectionTestPoint[i][4];
-        myProjection->Ys = projectionTestPoint[i][5];
-
-        // Perform projection
-        out = psProject(in, myProjection);
-
-        // Verify output not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Return null not expected");
-            return i*10;
-        }
-
-        // Verify output is as expected
-        if(fabs(out->x - projectionSinExpected[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psPlane->x = %lg  expected %lg",
-                    i,out->x, projectionSinExpected[i][0]);
-            return i*10+1;
-        }
-        if(fabs(out->y - projectionSinExpected[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint % d  psPlane->y = %lg  expected %lg",
-                    i,out->y, projectionSinExpected[i][1]);
-            return i*10+2;
-        }
-        psFree(out);
-    }
-
-    psFree(in);
-    psFree(myProjection);
-
-    return 0;
-}
-
-psS32 testDeprojectSin(void)
-{
-    psSphere*       out = NULL;
-    psPlane*        in = psPlaneAlloc();
-    psProjection*   myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_SIN);
-
-    // Perform deprojection on various test points
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-
-        // Initialize input and projection members
-        in->x = projectionSinExpected[i][0];
-        in->y = projectionSinExpected[i][1];
-        myProjection->R = projectionTestPoint[i][2];
-        myProjection->D = projectionTestPoint[i][3];
-        myProjection->Xs = projectionTestPoint[i][4];
-        myProjection->Ys = projectionTestPoint[i][5];
-
-        // Perform deprojection
-        out = psDeproject(in, myProjection);
-
-        // Verify output is not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Return null not expected");
-            return 20*i;
-        }
-
-        // Verify output is as expected
-        if(fabs(out->r - projectionTestPoint[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psSphere->r = %lg  expected %lg",
-                    i,out->r,projectionTestPoint[i][0]);
-            return 20*i + 1;
-        }
-        if(fabs(out->d - projectionTestPoint[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psSphere->d = %lg expected %lg",
-                    i, out->d, projectionTestPoint[i][1]);
-            return 20*i + 2;
-        }
-        psFree(out);
-    }
-
-    psFree(in);
-    psFree(myProjection);
-
-    return 0;
-}
-
-psS32 testProjectAit(void)
-{
-    psPlane*       out = NULL;
-    psSphere*      in = psSphereAlloc();
-    psProjection*  myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_AIT);
-
-    // Perform projecton on various test points
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-
-        // Initialize input and project members
-        in->r = projectionTestPoint[i][0];
-        in->d = projectionTestPoint[i][1];
-        myProjection->R = projectionTestPoint[i][2];
-        myProjection->D = projectionTestPoint[i][3];
-        myProjection->Xs = projectionTestPoint[i][4];
-        myProjection->Ys = projectionTestPoint[i][5];
-
-        // Perform projection
-        out = psProject(in, myProjection);
-
-        // Verify output not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Return null not expected");
-            return i*10;
-        }
-
-        // Verify output is as expected
-        if(fabs(out->x - projectionAitExpected[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psPlane->x = %lg  expected %lg",
-                    i,out->x, projectionAitExpected[i][0]);
-            return i*10+1;
-        }
-        if(fabs(out->y - projectionAitExpected[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint % d  psPlane->y = %lg  expected %lg",
-                    i,out->y, projectionAitExpected[i][1]);
-            return i*10+2;
-        }
-        psFree(out);
-    }
-
-    psFree(in);
-    psFree(myProjection);
-
-    return 0;
-}
-
-psS32 testDeprojectAit(void)
-{
-    psSphere*       out = NULL;
-    psPlane*        in = psPlaneAlloc();
-    psProjection*   myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_AIT);
-
-    // Perform deprojection on various test points
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-
-        // Initialize input and projection members
-        in->x = projectionAitExpected[i][0];
-        in->y = projectionAitExpected[i][1];
-        myProjection->R = projectionTestPoint[i][2];
-        myProjection->D = projectionTestPoint[i][3];
-        myProjection->Xs = projectionTestPoint[i][4];
-        myProjection->Ys = projectionTestPoint[i][5];
-
-        // Perform deprojection
-        out = psDeproject(in, myProjection);
-
-        // Verify output is not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Return null not expected");
-            return 20*i;
-        }
-
-        // Verify output is as expected
-        if(fabs(out->r - projectionTestPoint[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psSphere->r = %lg  expected %lg",
-                    i,out->r,projectionTestPoint[i][0]);
-            return 20*i + 1;
-        }
-        if(fabs(out->d - projectionTestPoint[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psSphere->d = %lg expected %lg",
-                    i, out->d, projectionTestPoint[i][1]);
-            return 20*i + 2;
-        }
-        psFree(out);
-    }
-
-    psFree(in);
-    psFree(myProjection);
-
-    return 0;
-}
-
-psS32 testProjectPar(void)
-{
-    psPlane*       out = NULL;
-    psSphere*      in = psSphereAlloc();
-    psProjection*  myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_PAR);
-
-    // Perform projecton on various test points
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-
-        // Initialize input and project members
-        in->r = projectionTestPoint[i][0];
-        in->d = projectionTestPoint[i][1];
-        myProjection->R = projectionTestPoint[i][2];
-        myProjection->D = projectionTestPoint[i][3];
-        myProjection->Xs = projectionTestPoint[i][4];
-        myProjection->Ys = projectionTestPoint[i][5];
-
-        // Perform projection
-        out = psProject(in, myProjection);
-
-        // Verify output not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Return null not expected");
-            return i*10;
-        }
-
-        // Verify output is as expected
-        if(fabs(out->x - projectionParExpected[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psPlane->x = %lg  expected %lg",
-                    i,out->x, projectionParExpected[i][0]);
-            return i*10+1;
-        }
-        if(fabs(out->y - projectionParExpected[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint % d  psPlane->y = %lg  expected %lg",
-                    i,out->y, projectionParExpected[i][1]);
-            return i*10+2;
-        }
-        psFree(out);
-    }
-
-    psFree(in);
-    psFree(myProjection);
-
-    return 0;
-}
-
-psS32 testDeprojectPar(void)
-{
-    psSphere*       out = NULL;
-    psPlane*        in = psPlaneAlloc();
-    psProjection*   myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_PAR);
-
-    // Perform deprojection on various test points
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-
-        // Initialize input and projection members
-        in->x = projectionParExpected[i][0];
-        in->y = projectionParExpected[i][1];
-        myProjection->R = projectionTestPoint[i][2];
-        myProjection->D = projectionTestPoint[i][3];
-        myProjection->Xs = projectionTestPoint[i][4];
-        myProjection->Ys = projectionTestPoint[i][5];
-
-        // Perform deprojection
-        out = psDeproject(in, myProjection);
-
-        // Verify output is not NULL
-        if(out == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Return null not expected");
-            return 20*i;
-        }
-
-        // Verify output is as expected
-        if(fabs(out->r - projectionTestPoint[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psSphere->r = %lg  expected %lg",
-                    i,out->r,projectionTestPoint[i][0]);
-            return 20*i + 1;
-        }
-        if(fabs(out->d - projectionTestPoint[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d  psSphere->d = %lg expected %lg",
-                    i, out->d, projectionTestPoint[i][1]);
-            return 20*i + 2;
-        }
-        psFree(out);
-    }
-
-    psFree(in);
-    psFree(myProjection);
-
-    return 0;
-}
-
-psS32 testProjectFail(void)
-{
-    psPlane*       out          = NULL;
-    psProjection*  myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_TAN);
-    psSphere*      in           = psSphereAlloc();
-
-    // Invoke function with null coordinate argument
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null coord arg");
-    out = psProject(NULL, myProjection);
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return null as expected");
-        return 1;
-    }
-
-    // Invoke function with null projection argument
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null projection arg");
-    out = psProject(in, NULL);
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return null as expected");
-        return 2;
-    }
-
-    // Invoke function with invalid projection type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid projection type");
-    myProjection->type = PS_PROJ_NTYPE;
-    out = psProject(in,myProjection);
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return null as expected");
-        return 3;
-    }
-
-    psFree(myProjection);
-    psFree(in);
-
-    return 0;
-}
-
-psS32 testDeprojectFail(void)
-{
-    psSphere*      out          = NULL;
-    psProjection*  myProjection = psProjectionAlloc(0.0,0.0,1.0,1.0,PS_PROJ_TAN);
-    psPlane*       in           = psPlaneAlloc();
-
-    // Invoke function with null coordinate argument
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null coord arg");
-    out = psDeproject(NULL, myProjection);
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return null as expected");
-        return 1;
-    }
-
-    // Invoke function with null projection argument
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null projection arg");
-    out = psDeproject(in, NULL);
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return null as expected");
-        return 2;
-    }
-
-    // Invoke function with invalid projection type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid projection type");
-    myProjection->type = PS_PROJ_NTYPE;
-    out = psDeproject(in,myProjection);
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return null as expected");
-        return 3;
-    }
-
-    psFree(myProjection);
-    psFree(in);
-
-    return 0;
-}
-
-psS32 testSetOffsetSphere( void )
-{
-    psSphere* position1 = psSphereAlloc();
-    psSphere* position2 = NULL;
-    psSphere* offset    = psSphereAlloc();
-    psSphere* tmpOffset = psSphereAlloc();
-
-    // Initialize first position
-    position1->r = DEG_TO_RAD(90.0);
-    position1->d = DEG_TO_RAD(45.0);
-    position1->rErr = 0.0;
-    position1->dErr = 0.0;
-
-    //  Using various offset verify spherical offset
-    //  Use all the valid unit types
-    for (psF64 r = 0.0; r < 180.0; r += DEG_INC) {
-        for (psF64 d = 0.0; d < 90.0; d += DEG_INC) {
-
-            offset->r = DEG_TO_RAD(r);
-            offset->d = DEG_TO_RAD(d);
-            offset->rErr = 0.0;
-            offset->dErr = 0.0;
-
-            position2 = psSphereSetOffset(position1, offset, PS_SPHERICAL, PS_RADIAN);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1->r + offset->r), 1);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1->d + offset->d), 2);
-            psFree(position2);
-
-            tmpOffset->r = RAD_TO_DEG(offset->r);
-            tmpOffset->d = RAD_TO_DEG(offset->d);
-            tmpOffset->rErr = 0.0;
-            tmpOffset->dErr = 0.0;
-            position2 = psSphereSetOffset(position1, tmpOffset, PS_SPHERICAL, PS_DEGREE);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1->r + offset->r), 3);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1->d + offset->d), 4);
-            psFree(position2);
-
-            tmpOffset->r = RAD_TO_MIN(offset->r);
-            tmpOffset->d = RAD_TO_MIN(offset->d);
-            tmpOffset->rErr = 0.0;
-            tmpOffset->dErr = 0.0;
-            position2 = psSphereSetOffset(position1, tmpOffset, PS_SPHERICAL, PS_ARCMIN);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1->r + offset->r), 5);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1->d + offset->d), 6);
-            psFree(position2);
-
-            tmpOffset->r = RAD_TO_SEC(offset->r);
-            tmpOffset->d = RAD_TO_SEC(offset->d);
-            tmpOffset->rErr = 0.0;
-            tmpOffset->dErr = 0.0;
-            position2 = psSphereSetOffset(position1, tmpOffset, PS_SPHERICAL, PS_ARCSEC);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1->r + offset->r), 7);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1->d + offset->d), 8);
-            psFree(position2);
-        }
-    }
-
-    // Attempt to call function with null input coordinate
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message null input coord");
-    position2 = psSphereSetOffset(NULL, offset, PS_LINEAR, PS_ARCSEC);
-    if (position2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL");
-        return 30;
-    }
-
-    // Attempt to call function with null offset
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message null offset");
-    position2 = psSphereSetOffset(position1, NULL, PS_LINEAR, PS_ARCSEC);
-    if (position2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL");
-        return 31;
-    }
-
-    // Attempt to call function with invalid mode
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message invalid mode");
-    position2 = psSphereSetOffset(position1, offset, 0x54321, 0);
-    if (position2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL");
-        return 32;
-    }
-
-    // Attempt to call function with invalid unit
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message invalid unit");
-    position2 = psSphereSetOffset(position1, offset, PS_SPHERICAL, 0x54321);
-    if (position2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL");
-        return 33;
-    }
-
-    psFree(position1);
-    psFree(offset);
-    psFree(tmpOffset);
-
-    return 0;
-}
-
-psS32 testSetOffsetLinear(void)
-{
-    psSphere*   coord = psSphereAlloc();
-    psSphere*   offset = psSphereAlloc();
-    psSphere*   out = NULL;
-
-    for(psS32 i = 0; i < TESTPOINTS_OFFSET; i++) {
-
-        coord->r = setOffsetTestpoint[i][0];
-        coord->d = setOffsetTestpoint[i][1];
-
-        offset->r = setOffsetOffset[i][0];
-        offset->d = setOffsetOffset[i][1];
-
-        out = psSphereSetOffset(coord, offset, PS_LINEAR, PS_RADIAN);
-
-        if(fabs(out->r - setOffsetResult[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d: Result out->r = %lg not equal to expected %lg",
-                    i, out->r, setOffsetResult[i][0]);
-            return i*10+1;
-        }
-        if(fabs(out->d - setOffsetResult[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d: Result out->d = %lg not equal to expected %lg",
-                    i,out->d, setOffsetResult[i][1]);
-            return i*10+2;
-        }
-
-        psFree(out);
-    }
-
-    psFree(coord);
-    psFree(offset);
-
-    return 0;
-}
-
-psS32 testGetOffsetSphere( void )
-{
-    psSphere* position1 = psSphereAlloc();
-    psSphere* position2 = psSphereAlloc();
-    psSphere *offset = NULL;
-
-    position1->r = DEG_TO_RAD(90.0);
-    position1->d = DEG_TO_RAD(45.0);
-    position1->rErr = 0.0;
-    position1->dErr = 0.0;
-
-    for (psF64 r = 0.0; r < 180.0;r += DEG_INC) {
-        for (psF64 d = 0.0;d < 90.0; d += DEG_INC) {
-            position2->r = DEG_TO_RAD(r);
-            position2->d = DEG_TO_RAD(d);
-            position2->rErr = 0.0;
-            position2->dErr = 0.0;
-
-            offset = psSphereGetOffset( position1,  position2,
-                                        PS_SPHERICAL, PS_RADIAN);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2->r - position1->r), 1);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2->d - position1->d), 1);
-            psFree(offset);
-
-            offset = psSphereGetOffset( position1, position2,
-                                        PS_SPHERICAL, PS_DEGREE);
-            offset->r = DEG_TO_RAD(offset->r);
-            offset->d = DEG_TO_RAD(offset->d);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2->r - position1->r), 2);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2->d - position1->d), 3);
-            psFree(offset);
-
-            offset = psSphereGetOffset( position1,  position2,
-                                        PS_SPHERICAL, PS_ARCMIN);
-            offset->r = MIN_TO_RAD(offset->r);
-            offset->d = MIN_TO_RAD(offset->d);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2->r - position1->r), 2);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2->d - position1->d), 3);
-            psFree(offset);
-
-            offset = psSphereGetOffset( position1,  position2,
-                                        PS_SPHERICAL, PS_ARCSEC);
-            offset->r = SEC_TO_RAD(offset->r);
-            offset->d = SEC_TO_RAD(offset->d);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2->r - position1->r), 2);
-            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2->d - position1->d), 3);
-            psFree(offset);
-        }
-    }
-
-    // Attempt to invoke function with null position 1 parameter
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null position");
-    offset = psSphereGetOffset(NULL, position2, PS_LINEAR, 0);
-    if (offset != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 10;
-    }
-
-    // Attempt to invoke function with null position 2 parameter
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for null position");
-    offset = psSphereGetOffset(position1, NULL, PS_LINEAR, 0);
-    if (offset != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 11;
-    }
-
-    // Attempt to invoke function with invalid mode
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid mode");
-    offset = psSphereGetOffset(position1, position2, 0x54321, 0);
-    if (offset != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 12;
-    }
-
-    // Attempt to invoke function with invalid unit type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid unit type");
-    offset = psSphereGetOffset(position1, position2, PS_SPHERICAL, 0x54321);
-    if (offset != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 13;
-    }
-
-    // Attempt to invoke function with coordinate 1 declination value 90.0 degree
-    position1->d = DEG_TO_RAD(90.0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate warning message");
-    offset = psSphereGetOffset(position1, position2, PS_SPHERICAL, PS_RADIAN);
-    if (offset != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 14;
-    }
-
-    // Attempt to invoke function with coordinate 2 declination value 90.0 degree
-    position1->d = DEG_TO_RAD(45.0);
-    position2->d = DEG_TO_RAD(90.0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate warning message");
-    offset = psSphereGetOffset(position1, position2, PS_SPHERICAL, PS_RADIAN);
-    if (offset != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 15;
-    }
-
-    psFree(position1);
-    psFree(position2);
-
-    return 0;
-}
-
-psS32 testGetOffsetLinear(void)
-{
-    psSphere*   coord1 = psSphereAlloc();
-    psSphere*   coord2 = psSphereAlloc();
-    psSphere*   out = NULL;
-
-    for(psS32 i = 0; i < TESTPOINTS_OFFSET; i++) {
-
-        coord1->r = getOffsetTestpoint1[i][0];
-        coord1->d = getOffsetTestpoint1[i][1];
-
-        coord2->r = getOffsetTestpoint2[i][0];
-        coord2->d = getOffsetTestpoint2[i][1];
-
-        out = psSphereGetOffset(coord1, coord2, PS_LINEAR, PS_RADIAN);
-
-        if(fabs(out->r - getOffsetResult[i][0]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d: Result out->r = %lg not equal to expected %lg",
-                    i, out->r, getOffsetResult[i][0]);
-            return i*10+1;
-        }
-        if(fabs(out->d - getOffsetResult[i][1]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Testpoint %d: Result out->d = %lg not equal to expected %lg",
-                    i,out->d, getOffsetResult[i][1]);
-            return i*10+2;
-        }
-
-        psFree(out);
-    }
-
-    psFree(coord1);
-    psFree(coord2);
-
-    return 0;
-}
-
-#define DEG_INC2 15.0
-#define VERBOSE 0
-psS32 testProjectTanDeProjectTan()
-{
-    psS32 rc = 0;
-    //
-    // I'm not convinced that the p_psProject() and p_psDeproject() functions work
-    // correctly.  If we project a set of coordinates over a wide range of (R, D)
-    // values, then deproject them, the original (R, D) values are only produced
-    // when D is larger than 0.  This code demonstrates that.
-    //
-    psProjection *tmpProj = psProjectionAlloc(0.0,0.0,10.0,10.0,PS_PROJ_TAN);
-    if (1) { //HEY
-        psPlane planeCoord01;
-        psSphere skyCoord01;
-        psSphere skyCoord02;
-        for (psF32 R = -90.0 ; R <= 90.0 ; R+= DEG_INC2) {
-            for (psF32 D = -90.0 ; D <= 90.0 ; D+= DEG_INC2) {
-                if ((fabs(R) != 90.0) && (fabs(D) != 90.0)) {
-                    skyCoord01.r = DEG_TO_RAD(R);
-                    skyCoord01.d = DEG_TO_RAD(D);
-                    p_psProject(&planeCoord01, &skyCoord01, tmpProj);
-                    p_psDeproject(&skyCoord02, &planeCoord01, tmpProj);
-                    if ((fabs(skyCoord01.r - skyCoord02.r) < FLT_EPSILON) &&
-                            (fabs(skyCoord01.d - skyCoord02.d) < FLT_EPSILON)) {
-                        if (VERBOSE) {
-                            printf("CORRECT: (%.2fr %.2fd) (%.2fr %.2fd) -> (%.2f %.2f) -> (%.2fr %.2fd)\n", R, D,
-                                   skyCoord01.r, skyCoord01.d,
-                                   planeCoord01.x, planeCoord01.y,
-                                   skyCoord02.r, skyCoord02.d);
-                        }
-                        rc = 1;
-                    } else {
-                        printf("TEST ERROR: (%.2fr %.2fd) (%.2fr %.2fd) -> (%.2f %.2f) -> (%.2fr %.2fd)\n", R, D,
-                               skyCoord01.r, skyCoord01.d,
-                               planeCoord01.x, planeCoord01.y,
-                               skyCoord02.r, skyCoord02.d);
-                        rc = 1;
-                    }
-                }
-            }
-        }
-    }
-    return(rc);
-}
-
-
-
Index: trunk/psLib/test/astro/tst_psCoord02.c
===================================================================
--- trunk/psLib/test/astro/tst_psCoord02.c	(revision 24303)
+++ 	(revision )
@@ -1,572 +1,0 @@
-/** @file  tst_psCoord02.c
-*
-*  @brief This file contains test code for:
-*
-*  @author GLG, MHPCC
-*
-*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-02-17 03:24:46 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-static psS32 test04( void );
-static psS32 test05( void );
-static psS32 test06( void );
-static psS32 test07( void );
-
-testDescription tests[] = {
-                              {test04, 660, "psPlaneTransformCombine()", 0, false},
-                              {test05, 662, "psPlaneTransformFit()", 0, false},
-                              {test06, 663, "psPlaneTransformInvert()", 0, false},
-                              {test07, 666, "psPlaneTransformDeriv()", 0, false},
-                              {NULL}
-                          };
-
-#define PS_PERCENT_COMPARE(X, Y, PERCENT_FRACTION) (fabs((Y)-(X))/fabs(X) < (PERCENT_FRACTION))
-
-//#define PS_GEN_RAN_FLOAT (-1.0 + (psF32) (rand() % 2))
-#define PS_GEN_RAN_FLOAT (-0.5 + ((psF32)rand()) / ((psF32) RAND_MAX))
-#define RANDOM_SEED 1995
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-    psLogSetFormat("HLNM");
-    psTraceSetLevel(".", 0);
-    psTraceSetLevel("psPlaneTransformCombine", 0);
-    psTraceSetLevel("multiplyDPoly2D", 0);
-    srand(RANDOM_SEED);
-
-    return ( ! runTestSuite( stderr, "psImage", tests, argc, argv ) );
-}
-
-
-/******************************************************************************
-TEST04: The strategy behind test04() is to generate a pair of transforms t1
-and t2 with a wide variety of sizes for the x/y components of the x/y
-transforms, then set the coefficients of t1/t2 to arbitray values, then
-generate a new transform t3 via psPlaneTransformCombine() function.  Then, for
-several arbitrary input plane coordinates, we tarnsform them via the new
-transform t3, as well as individually via t1 then t2, and verify that they
-produce identical output coordinates.
- *****************************************************************************/
-// These macros determine the number of x/y test points which will be x-formed.
-#define TST04_X_MIN 0.0
-#define TST04_X_MAX 10.0
-#define TST04_Y_MIN 0.0
-#define TST04_Y_MAX 10.0
-#define TST04_NUM 5.0
-// These macros define the max sizes of the various input transforms.
-#define TST04_T1_X_X 2
-#define TST04_T1_X_Y 3
-#define TST04_T1_Y_X 3
-#define TST04_T1_Y_Y 3
-#define TST04_T2_X_X 3
-#define TST04_T2_X_Y 3
-#define TST04_T2_Y_X 3
-#define TST04_T2_Y_Y 3
-/******************************************************************************
-tstTransforms(t1, t2, t3): this function generates a set of arbitrary x/y
-coordinates, then transforms them into output coordinates via the t3
-transform, as well as the t1 followed by the t2 transform.  It verifies the
-output coordinates are identical and returns TRUE if so.  Otherwise, it prints
-an error message and returns FALSE.
- *****************************************************************************/
-bool tstTransforms(psPlaneTransform *t1, psPlaneTransform *t2, psPlaneTransform *t3)
-{
-    bool testStatus = true;
-    psPlane *in = psPlaneAlloc();
-    in->xErr = 0.0;
-    in->yErr = 0.0;
-
-    for (in->x = TST04_X_MIN ; in->x <= TST04_X_MAX ; in->x+= (TST04_X_MAX-TST04_X_MIN) / TST04_NUM) {
-        for (in->y = TST04_Y_MIN ; in->y <= TST04_Y_MAX ; in->y+= (TST04_Y_MAX-TST04_Y_MIN) / TST04_NUM) {
-            // Apply the t1/t2 transforms individually to the in coords.
-            psPlane *mid = psPlaneTransformApply(NULL, t1, in);
-            if (mid == NULL) {
-                printf("TEST ERROR: intermediate psPlane coords are NULL.\n");
-                psFree(in);
-                return(false);
-            }
-
-            psPlane *outT1T2 = psPlaneTransformApply(NULL, t2, mid);
-            if (outT1T2 == NULL) {
-                printf("TEST ERROR: intermediate psPlane coords are NULL.\n");
-                psFree(mid);
-                return(false);
-            }
-
-            // Apply the t3 transforms individually to the in coords.
-            psPlane *outT3 = psPlaneTransformApply(NULL, t3, in);
-            if (outT3 == NULL) {
-                printf("TEST ERROR: intermediate psPlane coords are NULL.\n");
-                psFree(mid);
-                psFree(outT1T2);
-                return(false);
-            }
-
-            // Verify that the results are identical.
-            if (!PS_PERCENT_COMPARE(outT3->x, outT1T2->x, 0.01)) {
-                printf("TEST ERROR: x is %f, should be %f\n", outT3->x, outT1T2->x);
-                testStatus = false;
-            }
-            // Verify that the results are identical.
-            if (!PS_PERCENT_COMPARE(outT3->y, outT1T2->y, 0.01)) {
-                printf("TEST ERROR: y is %f, should be %f\n", outT3->y, outT1T2->y);
-                testStatus = false;
-            }
-            if (0) {
-                if (fabs(outT3->x - outT1T2->x) > FLT_EPSILON) {
-                    printf("TEST ERROR: x is %f, should be %f\n", outT3->x, outT1T2->x);
-                    testStatus = false;
-                    printf("(in->x, in->y) is (%f, %f)\n", in->x, in->y);
-                    printf("(mid->x, mid->y) is (%f, %f)\n", mid->x, mid->y);
-                    printf("(outT1T2->x, outT1T2->y) is (%f, %f)\n", outT1T2->x, outT1T2->y);
-                    printf("(outT3->x, outT3->y) is (%f, %f)\n", outT3->x, outT3->y);
-                    PS_POLY_PRINT_2D(t1->x);
-                    PS_POLY_PRINT_2D(t1->y);
-                    PS_POLY_PRINT_2D(t2->x);
-                    PS_POLY_PRINT_2D(t2->y);
-                    PS_POLY_PRINT_2D(t3->x);
-                    PS_POLY_PRINT_2D(t3->y);
-                }
-                if (fabs(outT3->y - outT1T2->y) > FLT_EPSILON) {
-                    printf("TEST ERROR: y is %f, should be %f\n", outT3->y, outT1T2->y);
-                    testStatus = false;
-                    printf("(in->x, in->y) is (%f, %f)\n", in->x, in->y);
-                    printf("(mid->x, mid->y) is (%f, %f)\n", mid->x, mid->y);
-                    printf("(outT1T2->x, outT1T2->y) is (%f, %f)\n", outT1T2->x, outT1T2->y);
-                    printf("(outT3->x, outT3->y) is (%f, %f)\n", outT3->x, outT3->y);
-                    PS_POLY_PRINT_2D(t1->x);
-                    PS_POLY_PRINT_2D(t1->y);
-                    PS_POLY_PRINT_2D(t2->x);
-                    PS_POLY_PRINT_2D(t2->y);
-                    PS_POLY_PRINT_2D(t3->x);
-                    PS_POLY_PRINT_2D(t3->y);
-                }
-            }
-            psFree(mid);
-            psFree(outT1T2);
-            psFree(outT3);
-        }
-    }
-
-    psFree(in);
-    return(testStatus);
-}
-
-/******************************************************************************
-setCoeffs(t1, t2): this function sets the coefficients of the t1 and t2
-transforms to somewhat arbitrary values.
- *****************************************************************************/
-int setCoeffs(psPlaneTransform *t1, psPlaneTransform *t2)
-{
-    for (psS32 t1xx = 0 ; t1xx < t1->x->nX+1 ; t1xx++) {
-        for (psS32 t1xy = 0 ; t1xy < t1->x->nY+1 ; t1xy++) {
-            t1->x->coeff[t1xx][t1xy] = PS_GEN_RAN_FLOAT;
-            //printf("%f\n", t1->x->coeff[t1xx][t1xy]);
-        }
-    }
-
-    for (psS32 t1yx = 0 ; t1yx < t1->y->nX+1 ; t1yx++) {
-        for (psS32 t1yy = 0 ; t1yy < t1->y->nY+1 ; t1yy++) {
-            t1->y->coeff[t1yx][t1yy] = PS_GEN_RAN_FLOAT;
-            //printf("%f\n", t1->y->coeff[t1yx][t1yy]);
-        }
-    }
-    for (psS32 t2xx = 0 ; t2xx < t2->x->nX+1 ; t2xx++) {
-        for (psS32 t2xy = 0 ; t2xy < t2->x->nY+1 ; t2xy++) {
-            t2->x->coeff[t2xx][t2xy] = PS_GEN_RAN_FLOAT;
-            //printf("%f\n", t2->x->coeff[t2xx][t2xy]);
-        }
-    }
-    for (psS32 t2yx = 0 ; t2yx < t2->y->nX+1 ; t2yx++) {
-        for (psS32 t2yy = 0 ; t2yy < t2->y->nY+1 ; t2yy++) {
-            t2->y->coeff[t2yx][t2yy] = PS_GEN_RAN_FLOAT;
-            //printf("%f\n", t2->y->coeff[t2yx][t2yy]);
-        }
-    }
-
-    return(0);
-}
-
-/******************************************************************************
-test04(): We test psPlaneTransformCombine() with a variety of input
-transforms, as well as input coordinates, as well as erroneous input
-parameters.
- *****************************************************************************/
-psS32 test04( void )
-{
-    bool testStatus = true;
-
-    //HEY
-    // Create a variety of input transforms, then test them.
-    //
-    for (psS32 t1xx = 0 ; t1xx < TST04_T1_X_X ; t1xx++) {
-        for (psS32 t1xy = 0 ; t1xy < TST04_T1_X_Y ; t1xy++) {
-            for (psS32 t1yx = 0 ; t1yx < TST04_T1_Y_X ; t1yx++) {
-                for (psS32 t1yy = 0 ; t1yy < TST04_T1_Y_Y ; t1yy++) {
-                    for (psS32 t2xx = 0 ; t2xx < TST04_T2_X_X ; t2xx++) {
-                        for (psS32 t2xy = 0 ; t2xy < TST04_T2_X_Y ; t2xy++) {
-                            for (psS32 t2yx = 0 ; t2yx < TST04_T2_Y_X ; t2yx++) {
-                                for (psS32 t2yy = 0 ; t2yy < TST04_T2_Y_Y ; t2yy++) {
-                                    //printf("(%d %d %d %d %d %d %d %d)\n", t1xx, t1xy, t1yx, t1yy, t2xx, t2xy, t2yx, t2yy);
-                                    psPlaneTransform *trans1 = psPlaneTransformAlloc(PS_MAX(t1xx, t1yx), PS_MAX(t1xy, t1yy));
-                                    psPlaneTransform *trans2 = psPlaneTransformAlloc(PS_MAX(t2xx, t2yx), PS_MAX(t2xy, t2yy));
-                                    psPlaneTransform *trans3 = NULL;
-                                    setCoeffs(trans1, trans2);
-                                    trans3 = psPlaneTransformCombine(NULL, trans1,
-                                                                     trans2, psRegionSet(NAN,NAN,NAN,NAN), 0);
-                                    //XXX: the last two parameters are bogus.  Needs to change.  -rdd
-
-                                    if (trans3 == NULL) {
-                                        printf("TEST ERROR: psPlaneTransformCombine() returned NULL/\n");
-                                        testStatus = false;
-                                    } else {
-                                        testStatus = tstTransforms(trans1, trans2, trans3);
-                                    }
-                                    psFree(trans1);
-                                    psFree(trans2);
-                                    psFree(trans3);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-
-    //
-    // Test erroneous input parameter combinations
-    //
-    psPlaneTransform *trans1 = psPlaneTransformAlloc(2, 2);
-    psPlaneTransform *trans2 = psPlaneTransformAlloc(2, 2);
-    psPlaneTransform *trans3 = NULL;
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformCombine with NULL trans1.  Should generate error and return NULL.\n");
-    trans3 = psPlaneTransformCombine(NULL, NULL, trans2, psRegionSet(0,0,0,0), 10);
-    if (trans3 != NULL) {
-        printf("TEST ERROR: psPlaneTransformCombine() returned a non-NULL psPlaneTransform.\n");
-        testStatus = false;
-        psFree(trans3);
-    }
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformCombine with NULL trans2.  Should generate error and return NULL.\n");
-    trans3 = psPlaneTransformCombine(NULL, trans1, NULL, psRegionSet(0,0,0,0), 10);
-    if (trans3 != NULL) {
-        printf("TEST ERROR: psPlaneTransformCombine() returned a non-NULL psPlaneTransform.\n");
-        testStatus = false;
-        psFree(trans3);
-    }
-
-    psFree(trans1);
-    psFree(trans2);
-    return(!testStatus);
-}
-
-
-#define TST05_X_MIN 0.0
-#define TST05_X_MAX 10.0
-#define TST05_Y_MIN 0.0
-#define TST05_Y_MAX 10.0
-#define TST05_NUM_X 5.0
-#define TST05_NUM_Y 5.0
-#define TST05_X_POLY_ORDER 3
-#define TST05_Y_POLY_ORDER 3
-#define TST05_NUM_DATA (TST05_NUM_X * TST05_NUM_Y)
-#define TST05_IGNORE 1
-#define TST05_VERBOSE 0
-/******************************************************************************
-XXX: This is only a rudimentary test of the psPlaneTransformFit() function.
-It tests a few NULL input parameter conditions, and some simple linear
-transformations.
- 
-// HEY
- *****************************************************************************/
-psS32 test05( void )
-{
-    bool testStatus = true;
-    psPlaneTransform *trans = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
-    psPlaneTransform *transInit = psPlaneTransformAlloc(TST05_X_POLY_ORDER, TST05_Y_POLY_ORDER);
-    psArray *src = psArrayAlloc((int) TST05_NUM_DATA);
-    psArray *dst = psArrayAlloc((int) TST05_NUM_DATA);
-    bool rc;
-
-    //
-    // We set an arbitrary non-linear transformation.
-    //
-    for (psS32 x = 0 ; x < TST05_X_POLY_ORDER+1 ; x++) {
-        for (psS32 y = 0 ; y < TST05_Y_POLY_ORDER+1 ; y++) {
-            transInit->x->coeff[x][y] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
-            transInit->y->coeff[x][y] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
-        }
-    }
-    if (TST05_VERBOSE) {
-        PS_POLY_PRINT_2D(transInit->x);
-        PS_POLY_PRINT_2D(transInit->y);
-    }
-
-    //
-    // We generate a grid of input data points in the x1,y1 plane, calculate the
-    // corresponding values in the transformed plane, and set these to
-    // the src and dst psVectors.
-    //
-    psS32 i = 0;
-    for (psF32 x = TST05_X_MIN ; x < TST05_X_MAX ; x+= (TST05_X_MAX-TST05_X_MIN)/TST05_NUM_X) {
-        for (psF32 y = TST05_Y_MIN ; y < TST05_Y_MAX ; y+= (TST05_Y_MAX-TST05_Y_MIN)/TST05_NUM_Y) {
-            if (i == src->n) {
-                if (src->n == src->nalloc) {
-                    src = psArrayRealloc(src, src->n+1);
-                }
-                src->n++;
-            }
-            if (i == dst->n) {
-                if (dst->n == dst->nalloc) {
-                    dst = psArrayRealloc(dst, dst->n+1);
-                }
-                dst->n++;
-            }
-            src->data[i] = (psPtr *) psPlaneAlloc();
-            ((psPlane *) src->data[i])->x = x;
-            ((psPlane *) src->data[i])->y = y;
-
-            dst->data[i] = psPlaneTransformApply(NULL, transInit, ((psPlane *) src->data[i]));
-            i++;
-        }
-    }
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformFit with NULL trans.  Should generate error and return NULL.\n");
-    rc = psPlaneTransformFit(NULL, src, dst, 100, 100.0);
-    if (rc == true) {
-        printf("TEST ERROR1: psPlaneTransformFit() returned TRUE.\n");
-        testStatus = false;
-    }
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformFit with NULL src psArray.  Should generate error and return NULL.\n");
-    rc = psPlaneTransformFit(trans, NULL, dst, 100, 100.0);
-    if (rc == true) {
-        printf("TEST ERROR2: psPlaneTransformFit() returned TRUE.\n");
-        testStatus = false;
-    }
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformFit with NULL dst psArray.  Should generate error and return NULL.\n");
-    rc = psPlaneTransformFit(trans, src, NULL, 100, 100.0);
-    if (rc == true) {
-        printf("TEST ERROR3: psPlaneTransformFit() returned TRUE.\n");
-        testStatus = false;
-    }
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformFit with acceptable data.\n");
-    rc = psPlaneTransformFit(trans, src, dst, 100, 100.0);
-    if (rc != true) {
-        printf("TEST ERROR4: psPlaneTransformFit() returned FALSE.\n");
-        testStatus = false;
-    } else {
-        if (TST05_VERBOSE) {
-            PS_POLY_PRINT_2D(trans->x);
-            PS_POLY_PRINT_2D(trans->y);
-        }
-
-        //
-        // For the initial grid of input points, we transform them to output points with
-        // the derived transformation, and verify that they are within 10%.
-        //
-
-        for (psS32 i = TST05_IGNORE ; i < src->n-TST05_IGNORE ; i++) {
-            psPlane *inData = (psPlane *) src->data[i];
-            psPlane *outData = (psPlane *) dst->data[i];
-            psPlane *outDataDeriv = psPlaneTransformApply(NULL, trans, inData);
-            if (!PS_PERCENT_COMPARE(outDataDeriv->x, outData->x, 0.20) ||
-                    !PS_PERCENT_COMPARE(outDataDeriv->y, outData->y, 0.20)) {
-                printf("TEST ERROR: the derived output coords (%d) were (%.2f, %.2f) should have been (%.2f, %.2f).\n",
-                       i, outDataDeriv->x, outDataDeriv->y, outData->x, outData->y);
-                testStatus = false;
-            } else if (TST05_VERBOSE) {
-                printf("GOOD: the derived output coords (%d) were (%.2f, %.2f) should have been (%.2f, %.2f).\n",
-                       i, outDataDeriv->x, outDataDeriv->y, outData->x, outData->y);
-            }
-            psFree(outDataDeriv);
-        }
-    }
-
-    psFree(transInit);
-    psFree(trans);
-    psFree(src);
-    psFree(dst);
-
-    return(!testStatus);
-}
-
-#define NUM_TRANSFORMS 100
-/******************************************************************************
-This is only a rudimentary test of the psPlaneTransformInvert() function.
-It tests:
-    A few NULL input parameter conditions.
-    Several random linear transformations.
-XXX: Must extensively test:
-    Non-linear transformations.
-  *****************************************************************************/
-psS32 test06( void )
-{
-    bool testStatus = true;
-    psPlaneTransform *trans = psPlaneTransformAlloc(1, 1);
-    psPlaneTransform *transInverse = NULL;
-    psRegion myRegion = psRegionSet(1.0, 5.0, 1.0, 5.0);
-
-    trans->x->coeff[0][0] = 0.0;
-    trans->x->coeff[0][1] = 1.0;
-    trans->x->coeff[1][0] = 2.0;
-    trans->x->coeff[1][1] = 3.0;
-    trans->y->coeff[0][0] = 4.0;
-    trans->y->coeff[0][1] = 5.0;
-    trans->y->coeff[1][0] = 6.0;
-    trans->y->coeff[1][1] = 7.0;
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformInvert with NULL trans.  Should generate error and return NULL.\n");
-    transInverse = psPlaneTransformInvert(NULL, NULL, myRegion, 10);
-    if (transInverse != NULL) {
-        printf("TEST ERROR: psPlaneTransformInvert() returned a non-NULL psPlaneTransform.\n");
-        testStatus = false;
-        psFree(transInverse);
-    }
-
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformInvert with zero nSamples.  Should generate error and return NULL.\n");
-    transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 0);
-    if (transInverse != NULL) {
-        printf("TEST ERROR: psPlaneTransformInvert() returned a non-NULL psPlaneTransform.\n");
-        testStatus = false;
-        psFree(transInverse);
-    }
-
-    printf("Calling psPlaneTransformInvert with acceptable linear transformations.\n");
-    for (psS32 n = 0 ; n < NUM_TRANSFORMS ; n++) {
-        if (n == 0) {
-            // I ensure that we test the identity transformation since this was
-            // giving us probs before.
-            trans->x->coeff[0][0] = 0.0;
-            trans->x->coeff[0][1] = 0.0;
-            trans->x->coeff[1][0] = 1.0;
-            trans->x->coeff[1][1] = 0.0;
-            trans->y->coeff[0][0] = 0.0;
-            trans->y->coeff[0][1] = 1.0;
-            trans->y->coeff[1][0] = 0.0;
-            trans->y->coeff[1][1] = 0.0;
-        } else {
-            // We create a random linear transformation and hope it is invertible.
-            trans->x->coeff[0][0] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
-            trans->x->coeff[0][1] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
-            trans->x->coeff[1][0] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
-            trans->x->coeff[1][1] = 0.0;
-            trans->y->coeff[0][0] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
-            trans->y->coeff[0][1] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
-            trans->y->coeff[1][0] = (psF32)rand() / (psF32)RAND_MAX * 10.0f;
-            trans->y->coeff[1][1] = 0.0;
-        }
-
-        transInverse = psPlaneTransformInvert(NULL, trans, myRegion, 10);
-        if (transInverse == NULL) {
-            printf("TEST ERROR: psPlaneTransformInvert() returned a NULL psPlaneTransform.\n");
-            testStatus = false;
-        }
-        //
-        // Transform the "in" coords to "mid" with psPlaneTransform "trans", then
-        // transform "mid" to "out" with psPlaneTransform "transInverse".
-        //
-        // XXX: Loop on a few data points.
-        //
-        psPlane *in = psPlaneAlloc();
-        in->x = 2.0;
-        in->y = 3.0;
-        psPlane *mid = psPlaneTransformApply(NULL, trans, in);
-        psPlane *out = psPlaneTransformApply(NULL, transInverse, mid);
-
-        if (((fabs(in->x - out->x) > FLT_EPSILON)) ||
-                ((fabs(in->y - out->y) > FLT_EPSILON)) ||
-                isnan(out->x) ||
-                isnan(out->y)) {
-            printf("TEST ERROR: in coords were (%f, %f), out coords were (%f, %f).\n",
-                   in->x, in->y, out->x, out->y);
-            testStatus = false;
-        }
-
-        psFree(in);
-        psFree(mid);
-        psFree(out);
-        psFree(transInverse);
-    }
-
-    psFree(trans);
-
-    fflush(stdout);
-
-    return(!testStatus);
-}
-
-psS32 test07( void )
-{
-    psPlane *coord = psPlaneAlloc();
-    psPlane *deriv = NULL;
-    psPlaneTransform *trans = NULL;
-
-    //Set fxn values for evaluation
-    coord->x = 3.0;
-    coord->y = 1.0;
-
-    //Return NULL for NULL input plane transform
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    deriv = psPlaneTransformDeriv(NULL, trans, coord);
-    if (deriv != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psPlaneTransformDeriv failed to return NULL for NULL plane transform input.\n");
-        return 1;
-    }
-
-    trans = psPlaneTransformAlloc(1, 3);
-
-    //Set Polynomials.  f(x) = x, f(y) = 0.5*y^2  -->  f'(x) = 1, f'(y) = y
-    //So for 1,1  -> f'(1) = 1, f'(1) = 1
-    trans->x->coeff[0][0] = 0.0;
-    trans->x->coeff[1][0] = 1.0;
-    trans->y->coeff[0][0] = 0.0;
-    trans->y->coeff[0][1] = 0.0;
-    trans->y->coeff[0][2] = 0.5;
-
-    //Return NULL for NULL input plane
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    deriv = psPlaneTransformDeriv(NULL, trans, NULL);
-    if (deriv != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psPlaneTransformDeriv failed to return NULL for NULL plane input.\n");
-        return 2;
-    }
-
-    //Return correct values.  Should have x=1.0, y=1.0.
-    deriv = psPlaneTransformDeriv(NULL, trans, coord);
-    if (deriv->x != 1.0 || deriv->y != 1.0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psPlaneTransformDeriv failed to return the correct values.\n");
-        printf("\n f' values are = %lf, %lf \n", deriv->x, deriv->y);
-        return 3;
-    }
-
-    psFree(trans);
-    psFree(deriv);
-    psFree(coord);
-
-    return 0;
-}
-
Index: trunk/psLib/test/astro/tst_psEarthOrientation.c
===================================================================
--- trunk/psLib/test/astro/tst_psEarthOrientation.c	(revision 24303)
+++ 	(revision )
@@ -1,1205 +1,0 @@
-/** @file  tst_psEarthOrientation.c
-*
-*  @brief The code will perform earth orientation calculations and sphere rotations.
-*
-*  @author d-Rob, MHPCC
-*
-*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-05-26 01:23:41 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-
-static psS32 testAberration(void);
-static psS32 testGravityDeflect(void);
-static psS32 testEOCPrecession(void);
-static psS32 testEOCPrecessionCorr(void);
-static psS32 testEOCPolar(void);
-static psS32 testEOCPolarTide(void);
-static psS32 testEOCNutation(void);
-static psS32 testSphereRot_TEOtoCEO(void);
-static psS32 testSphereRot_CEOtoGCRS(void);
-static psS32 testSphereRot_ITRStoTEO(void);
-static psS32 testSphereRotPrecess(void);
-
-testDescription tests[] = {
-                              {testAberration, 666, "psAberration()", 0, false},
-                              {testGravityDeflect, 667, "psGravityDeflect()", 0, false},
-                              {testEOCPrecession, 669, "psEOCPrecession()", 0, false},
-                              {testEOCPrecessionCorr, 670, "psEOCPrecessionCorr()", 0, false},
-                              {testEOCPolar, 671, "psEOCPolar()", 0, false},
-                              {testEOCPolarTide, 672, "psEOCPolarTide()", 0, false},
-                              {testEOCNutation, 673, "psEOCNutation()", 0, false},
-                              {testSphereRot_TEOtoCEO, 674, "psSphereRot_TEOtoCEO()", 0, false},
-                              {testSphereRot_CEOtoGCRS, 675, "psSphereRot_CEOtoGCRS()", 0, false},
-                              {testSphereRot_ITRStoTEO, 676, "psSphereRRot_ITRStoTEO()", 0, false},
-                              {testSphereRotPrecess, 677, "psSphereRotPrecess()", 0, false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    // Initialize library internal structures
-    psLibInit("pslib.config");
-
-    if( !runTestSuite(stderr,"psEarthOrientation",tests,argc,argv)) {
-        return 1;
-    }
-
-    // Cleanup library
-    psLibFinalize();
-
-    return 0;
-
-    //    return ( ! runTestSuite( stderr, "psEarthOrientation", tests, argc, argv ) );
-}
-
-#define timesec 1049160600
-#define objR DEG_TO_RAD(122.9153182445501)
-#define objD DEG_TO_RAD(48.562968978679194)
-#define VERBOSE 0
-static psSphere *obj = NULL;
-static void objSetup(void);
-static double greatCircle(psSphere *in1, psSphere *in2);
-
-static void objSetup(void)
-{
-    if (obj == NULL) {
-        //        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);
-    }
-}
-
-//returns the great circle ANGULAR distance between 2 positions (psSphere's)
-static double greatCircle(psSphere *in1, psSphere *in2)
-{
-    double r1, r2, d1, d2;
-    d1 = in1->r;
-    d2 = in2->r;
-    r1 = in1->d;
-    r2 = in2->d;
-    double out = 0.0;
-    double c1, c2, cd, s1, s2, sum, ac;
-    c1 = cos(r1);
-    c2 = cos(r2);
-    cd = cos(d1-d2);
-    s1 = sin(r1);
-    s2 = sin(r2);
-    sum = c1*c2*cd + s1*s2;
-    if (sum > 1.0)
-        sum = 1.0 - (sum - 1.0);
-
-    ac = acos(sum);
-    out = ac;
-    //    printf("\n  c1=%lf, c2=%lf, cd=%lf, s1=%lf, s2=%lf, sum=%.19g, ac=%g\n", c1,c2,cd,s1,s2,sum,ac);
-    //    out = acos(cos(r1)*cos(r2)*cos(d1-d2) + sin(r1)*sin(r2));
-    //    if (out != 0.0) printf("\n   in greatCircle, out = %lf\n", out);
-    return out;
-}
-
-psS32 testAberration(void)
-{
-    psSphere *apparent = NULL;
-    psSphere *empty = NULL;
-    psCube *actualCube = psCubeAlloc();
-    //values from After gravity deflection//
-    actualCube->x = -0.35961949760293604;
-    actualCube->y = 0.5555613950298085;
-    actualCube->z = 0.7496835020836093;
-    psSphere *actual = psCubeToSphere(actualCube);
-    psCube *cubeDir = psCubeAlloc();
-    cubeDir->x = 5148.713262821658;
-    cubeDir->y = -26945.04752348012;
-    cubeDir->z = -11682.787302030947;
-    cubeDir->x += -357.6031690489248;
-    cubeDir->y += 248.46429758174693;
-    cubeDir->z += 0.09694774143797581;
-    psSphere *direction = psCubeToSphere(cubeDir);
-    double speed = sqrt(cubeDir->x*cubeDir->x + cubeDir->y*cubeDir->y + cubeDir->z*cubeDir->z);
-    double c = 299792458.0; // Speed of light in vacuum (src:NIST)   /* m/s */
-    speed /= c;
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    empty = psAberration(empty, apparent, direction, speed);
-    if (empty != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psAberration failed to return NULL for NULL actual input.\n");
-        return 1;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    empty = psAberration(empty, actual, apparent, speed);
-    if (empty != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psAberration failed to return NULL for NULL direction input.\n");
-        return 2;
-    }
-
-    apparent = psAberration(apparent, actual, direction, speed);
-    psCube *outCube = psSphereToCube(apparent);
-    if (VERBOSE) {
-        printf("\n -- resultCube = x,y,z =     %.13g,      %.13g,    %.13g  -- \n",
-               outCube->x, outCube->y, outCube->z);
-    }
-    //expected cube values
-    double x, y, z;
-    x = -0.35963388069046304;
-    y = 0.5555192509816625;
-    z = 0.7497078321908413;
-
-    if (VERBOSE) {
-        printf(" -- expectedCube = x,y,z =   %.13g,     %.13g,    %.13g  -- \n", x, y, z);
-        printf("Cube Difference  =  x,y,z  = %.13g, %.13g, %.13g \n\n",
-               (x - outCube->x), (y - outCube->y), (z - outCube->z) );
-    }
-    psFree(actual);
-    actualCube->x = x;
-    actualCube->y = y;
-    actualCube->z = z;
-    actual = psCubeToSphere(actualCube);
-    double xxx = greatCircle(actual, apparent);
-    if (VERBOSE) {
-        printf("   The great circle angular distance between expected & result = %.13g\n",
-               xxx);
-    }
-    if ( fabs(x - outCube->x) > FLT_EPSILON || fabs(y - outCube->y) > FLT_EPSILON ||
-            fabs(z - outCube->z) > FLT_EPSILON ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psAberration returned incorrect values.\n");
-        //        printf("\nMagnitude of expected change = x,y,z = %.13g, %.13g, %.13g \n",
-        //               (actualCube->x - x), (actualCube->y - y), (actualCube->z - z) );
-        //        printf("Magnitude of actual change = x,y,z = %.13g, %.13g, %.13g \n",
-        //               (actualCube->x - outCube->x), (actualCube->y - outCube->y),
-        //               (actualCube->z - outCube->z) );
-        psFree(actual);
-        actualCube->x = x;
-        actualCube->y = y;
-        actualCube->z = z;
-        actual = psCubeToSphere(actualCube);
-        x = greatCircle(actual, apparent);
-        if (VERBOSE) {
-            printf("   The great circle angular distance between expected & result = %.13g\n",
-                   x);
-        }
-        return 3;
-    }
-
-    psFree(outCube);
-    psFree(actualCube);
-    psFree(cubeDir);
-    psFree(apparent);
-    psFree(actual);
-    psFree(direction);
-
-    return 0;
-}
-
-psS32 testGravityDeflect(void)
-{
-    psSphere *apparent = NULL;
-    psSphere *empty = NULL;
-    psCube *actualCube = psCubeAlloc();
-    actualCube->x = -0.3596195125758298;
-    actualCube->y = 0.5555613903455866;
-    actualCube->z = 0.7496834983724809;
-    psSphere *actual = psCubeToSphere(actualCube);
-    psCube *sunCube = psCubeAlloc();
-    sunCube->x = 1.467797790127511e11;
-    sunCube->y = 2.5880956908748722e10;
-    sunCube->z = 1.1220046291457653e10;
-    double sunLength = sqrt(sunCube->x*sunCube->x + sunCube->y*sunCube->y + sunCube->z*sunCube->z);
-    sunCube->x /= sunLength;
-    sunCube->y /= sunLength;
-    sunCube->z /= sunLength;
-    if (VERBOSE) {
-        printf("sunCube = x,y,z = %.13g, %.13g, %.13g\n",
-               sunCube->x, sunCube->y, sunCube->z);
-    }
-    psSphere *sun = psCubeToSphere(sunCube);
-    if (VERBOSE) {
-        printf("sunSphere  = r, d = %.13g, %.13g\n", sun->r, sun->d);
-    }
-    psCube *outCube = psCubeAlloc();
-
-    empty = psGravityDeflection(apparent, empty, sun);
-    if (empty != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psGravityDeflection Failed to return NULL for NULL actual input sphere.\n");
-        return 1;
-    }
-    empty = psGravityDeflection(apparent, actual, empty);
-    if (empty != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true,
-                "psGravityDeflection Failed to return NULL for NULL sun input sphere.\n");
-        return 2;
-    }
-
-    apparent = psGravityDeflection(NULL, actual, sun);
-    //    apparent->r *= -1.0;
-    //    apparent->d *= -1.0;
-    psSphere *result2;
-    //    psSphere *result2 = psSphereSetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN);
-    //    psSphere *result = psSphereSetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN);
-    //    psSphere *result = psSphereGetOffset(apparent, actual, PS_SPHERICAL, PS_RADIAN);
-    if (VERBOSE) {
-        printf(" -- actualCube = x,y,z = %.13g, %.13g, %.13g  -- \n",
-               actualCube->x, actualCube->y, actualCube->z);
-    }
-    //    psCube *outCube = psSphereToCube(result);
-    //    printf(" -- resultCube = x,y,z = %.13g, %.13g, %.13g  -- \n",
-    //           outCube->x, outCube->y, outCube->z);
-    psCube *outCube2 = psSphereToCube(apparent);
-    if (VERBOSE) {
-        printf(" -- resultCube2= x,y,z = %.13g, %.13g, %.13g  -- \n",
-               outCube2->x, outCube2->y, outCube2->z);
-    }
-    double x, y, z;
-    x = -0.35961949760293604;
-    y = 0.5555613950298085;
-    z = 0.7496835020836093;
-
-    if (VERBOSE) {
-        printf(" -- expectCube = x,y,z = %.13g, %.13g, %.13g  -- \n\n", x, y, z);
-
-        //    if ( fabs(x - outCube->x) > DBL_EPSILON || fabs(y - outCube->y) > DBL_EPSILON ||
-        //            fabs(z - outCube->z) > DBL_EPSILON ) {
-        //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-        //                "psGravityDeflection returned incorrect values.\n");
-        printf("expect-actual=  x,y,z  = %.13g, %.13g, %.13g \n",
-               (x - actualCube->x), (y - actualCube->y), (z - actualCube->z) );
-        printf("expect-result=  x,y,z  = %.13g, %.13g, %.13g \n",
-               (x - outCube2->x), (y - outCube2->y), (z - outCube2->z) );
-        printf("result-actual=  x,y,z  = %.13g, %.13g, %.13g \n",
-               (outCube2->x - actualCube->x), (outCube2->y - actualCube->y),
-               (outCube2->z - actualCube->z) );
-    }
-    //        return 1;
-    //    }
-    //    psFree(result2);
-    outCube2->x = x;
-    outCube2->y = y;
-    outCube2->z = z;
-    result2 = psCubeToSphere(outCube2);
-    //    psFree(result);
-    psSphere *result = psSphereGetOffset(actual, result2, PS_SPHERICAL, PS_RADIAN);
-    psFree(result2);
-    result2 = psSphereGetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN);
-    if (VERBOSE) {
-        printf("The apparent output sphere = r,d = %.13g, %.13g\n", result2->r, result2->d);
-        printf("The expected output sphere = r,d = %.13g, %.13g\n\n", result->r, result->d);
-    }
-    psFree(result2);
-
-    psFree(outCube);
-    psFree(outCube2);
-    psFree(sunCube);
-    psFree(actualCube);
-    psFree(result);
-    psFree(actual);
-    psFree(apparent);
-    psFree(sun);
-
-    return 0;
-}
-
-psS32 testEOCPrecession(void)
-{
-    psTime *empty = NULL;
-    psTime *time = psTimeAlloc(PS_TIME_UTC);
-    time->sec = timesec;
-    time->nsec = 0;
-    time->leapsecond = false;
-
-    //Tests for Precession Model //
-    psEarthPole *pmodel = NULL;
-    //Return NULL for NULL time input
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    pmodel = psEOC_PrecessionModel(empty);
-    if (pmodel != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psEOC_PrecessionModel failed to return NULL for NULL time input.\n");
-        return 1;
-    }
-    //Return NULL for UT1 time input
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    psTime *UT1time = psTimeAlloc(PS_TIME_UT1);
-    pmodel = psEOC_PrecessionModel(UT1time);
-    if (pmodel != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psEOC_PrecessionModel failed to return NULL for UT1 input time.\n");
-        return 2;
-    }
-    psFree(UT1time);
-    //Check return values from valid precession input
-    pmodel = psEOC_PrecessionModel(time);
-    if ( pmodel == NULL ) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psEOC_PrecessionModel returned NULL for valid input.\n");
-        return 3;
-    } else {
-        double x, y, s;
-        x = 2.857175590089105e-4;
-        y = 2.3968739377734732e-5;
-        s = -1.3970066457904322e-8;
-        if ( fabs(pmodel->x - x) > FLT_EPSILON || fabs(pmodel->y - y) > FLT_EPSILON
-                || fabs(pmodel->s - s) > FLT_EPSILON) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                    "   psEOC_PrecessionModel return incorrect values.\n");
-            return 4;
-        }
-        if (VERBOSE) {
-            printf("\n  PrecessionModel output = x,y,s = %.13g,  %.13g,  %.13g\n",
-                   pmodel->x, pmodel->y, pmodel->s);
-            printf("  Expected output        = x,y,s = %.13g, %.13g,  %.13g\n", x, y, s);
-            printf("  A difference of:                 %.13g, %.13g, %.13g\n",
-                   (pmodel->x - x), (pmodel->y - y), (pmodel->s - s) );
-        }
-    }
-    psFree(pmodel);
-
-    psFree(time);
-    if (!p_psEOCFinalize() ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n");
-        return 12;
-    }
-
-    return 0;
-}
-
-psS32 testEOCPrecessionCorr(void)
-{
-    psTime *empty = NULL;
-    psTime *time2 = psTimeAlloc(PS_TIME_UTC);
-    time2->sec = timesec;
-    time2->nsec = 0;
-    time2->leapsecond = false;
-    //    time2 = psTimeConvert(time2, PS_TIME_TAI);
-
-    //Tests for Precession Correction function//
-    //Return NULL for NULL time input
-    psEarthPole *pcorr = NULL;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    pcorr = psEOC_PrecessionCorr(empty, PS_IERS_A);
-    if (pcorr != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psEOC_PrecessionCorr failed to return NULL for NULL time input.\n");
-        return 5;
-    }
-
-    //Return NULL for Invalid IERS table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    pcorr = psEOC_PrecessionCorr(time2, 3);
-    if (pcorr != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psEOC_PrecessionCorr failed to return NULL for incorrect IERS table.\n");
-        return 6;
-    }
-    psFree(pcorr);
-
-    //Check values from IERS table A
-    pcorr = psEOC_PrecessionCorr(time2, PS_IERS_A);
-    if ( pcorr == NULL ) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psEOC_PrecessionCorr returned NULL for valid inputs.\n");
-        return 7;
-    } else {
-        if (VERBOSE) {
-            printf("\nPrecessionCorr output (IERSA) = x,y,s = %.13g,  %.13g, %.13g\n",
-                   pcorr->x, pcorr->y, pcorr->s);
-        }
-    }
-    psFree(pcorr);
-
-    //Check values from IERS table B
-    pcorr = psEOC_PrecessionCorr(time2, PS_IERS_B);
-    if ( pcorr == NULL ) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psEOC_PrecessionCorr returned NULL for valid inputs.\n");
-        return 9;
-    } else {
-        double xx, yy, ss;
-        xx = 0.06295703125;
-        yy = -0.0287618408203125;
-        ss = 0.0;
-        xx = SEC_TO_RAD(xx) * 1e-3;
-        yy = SEC_TO_RAD(yy) * 1e-3;
-        //        if ( fabs(pcorr->x - xx) > DBL_EPSILON || fabs(pcorr->y - yy) > DBL_EPSILON
-        //                || fabs(pcorr->s - ss) > DBL_EPSILON) {
-        //            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-        //                    "   psEOC_PrecessionCorr return incorrect values.\n");
-        if (VERBOSE) {
-            printf("PrecessionCorr output (IERSB) = x,y,s = %.13g, %.13g, %.13g\n",
-                   pcorr->x, pcorr->y, pcorr->s);
-            printf("Expected output               = x,y,s = %.13g, %.13g, %.13g\n", xx, yy, ss);
-            printf("          A difference of:              %.13g,  %.13g, %.13g\n\n",
-                   (pcorr->x - xx), (pcorr->y - yy), (pcorr->s - ss) );
-        }
-        //            return 10;
-        //        }
-    }
-    //precess is the *actual* output from PrecessionModel + PrecessionCorr
-    psEarthPole *precess = psEOC_PrecessionModel(time2);
-    precess->x += pcorr->x;
-    precess->y += pcorr->y;
-    double xCorr, yCorr;
-    xCorr = 3.05224300720406e-10;
-    yCorr = -1.39441339235822e-10;
-    //pcorr is the *expected* output from PrecessionModel//
-    pcorr->x = 2.857175590089105e-4;
-    pcorr->y = 2.3968739377734732e-5;
-    pcorr->s = -1.3970066457904322e-8;
-    pcorr->x += xCorr;
-    pcorr->y += yCorr;
-    psSphereRot *precessNutInv = psSphereRot_CEOtoGCRS(precess);
-    psSphereRot *precessNut = psSphereRotConjugate(NULL, precessNutInv);
-    double q0, q1, q2;
-    q0 = -1.1984522406756289e-5;
-    q1 = 1.4285893358610674e-4;
-    q2 = 1.2191193518914336e-10;
-    psSphereRot *pni = psSphereRot_CEOtoGCRS(pcorr);
-    if (fabs(pni->q0-q0) > FLT_EPSILON || fabs(pni->q1-q1) > FLT_EPSILON ||
-            fabs(pni->q2-q2) > FLT_EPSILON ) {
-        printf("\n Error at CEOtoGCRS, output psSphereRot doesn't match expected.\n");
-    }
-    //    printf("  Output from CEOtoGCRS only  = %.13g,%.13g,%.13g,%.13g\n",
-    //           pni->q0, pni->q1, pni->q2, pni->q3);
-    if (VERBOSE) {
-        printf("  Expected sphere rotation    = %.13g, %.13g, %.13g\n", q0,q1,q2);
-        printf("  Result sphere rotation      = %.13g, %.13g, %.13g\n",
-               precessNutInv->q0, precessNutInv->q1, precessNutInv->q2);
-        printf("     Difference         =        %.13g, %.13g, %.13g\n\n",
-               precessNutInv->q0-q0, precessNutInv->q1-q1, precessNutInv->q2-q2);
-    }
-    psCube *objC = psCubeAlloc();
-    //    objC->x = -3.5963388069046304;
-    //    objC->y = 0.5555192509816625;
-    //    objC->z = 0.7497078321908413;
-    //    objSetup();
-
-    //This is the sphere rotation for the *expected* precession output//
-    psSphereRot *pn = psSphereRotConjugate(NULL, pni);
-
-    //    psSphere *sphere = psSphereAlloc();
-    //    *sphere = *obj;
-    //    psFree(obj);
-
-    //create a psSphere for (from) the start position given in eoc_testing//
-    objC->x = -0.35963388069046304;
-    objC->y = 0.5555192509816625;
-    objC->z = 0.7497078321908413;
-    psSphere *sphere = psCubeToSphere(objC);
-
-    psSphere *expect = psSphereRotApply(NULL, pn, sphere);
-    //expected results below - stored in:  sphere  //
-    double x,y,z;
-    x = -0.3598480726985338;
-    y = 0.5555012823608123;
-    z = 0.7496183628158023;
-    if (VERBOSE) {
-        printf("\n<<Expected out       = x,y,z = %.13g, %.13g, %.13g\n", x, y, z);
-    }
-    //    psFree(objC);
-    //    objC = psSphereToCube(expect);
-    //printf("<<Expected out (CEO)  = x,y,z = %.13g, %.13g, %.13g\n", objC->x, objC->y, objC->z);
-    //printf("     Difference     =           %.13g, %.13g, %.13g\n", objC->x-x, objC->y-y, objC->z-z);
-    //    x = objC->x;
-    //    y = objC->y;
-    //    z = objC->z;
-    psSphere *result = psSphereRotApply(NULL, precessNut, sphere);
-    psFree(objC);
-    objC = psSphereToCube(result);
-    double xx = greatCircle(result, expect);
-    if (VERBOSE) {
-        printf("<<Resulting out      = x,y,z = %.13g, %.13g, %.13g\n", objC->x, objC->y, objC->z);
-        printf("     Difference         =      %.13g, %.13g, %.13g\n\n",
-               objC->x-x, objC->y-y, objC->z-z);
-        printf("GREAT CIRCLE DIFFERENCE = %.13g \n", xx);
-    }
-
-    psFree(precess);
-    psFree(precessNut);
-    psFree(precessNutInv);
-    psFree(expect);
-    psFree(objC);
-
-    psFree(sphere);
-    psFree(result);
-    psFree(pn);
-    psFree(pni);
-    psFree(pcorr);
-    psFree(time2);
-    if (!p_psEOCFinalize() ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n");
-        return 12;
-    }
-
-    return 0;
-}
-
-psS32 testEOCPolar(void)
-{
-    psTime *in = psTimeAlloc(PS_TIME_UTC);
-    in->sec = timesec;
-    in->nsec = 0;
-    in->leapsecond = false;
-    psTime *empty = NULL;
-    psEarthPole *polarMotion = NULL;
-
-    //Return NULL for NULL input time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    polarMotion = psEOC_GetPolarMotion(empty, PS_IERS_B);
-    if (polarMotion != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psEOC_GetPolarMotion failed to return NULL for NULL input time.\n");
-        return 1;
-    }
-    //Return NULL for incorrect Bulletin.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    polarMotion = psEOC_GetPolarMotion(empty, 3);
-    if (polarMotion != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psEOC_GetPolarMotion failed to return NULL for NULL input time.\n");
-        return 1;
-    }
-
-    //Test for IERS bulletin A.
-    double x, y, s;
-    x = -6.454389659777e-07;
-    y = 2.112606414597e-06;
-    s = 0.0;
-    polarMotion = psEOC_GetPolarMotion(in, PS_IERS_A);
-    if (polarMotion == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psEOC_GetPolarMotion returned NULL for valid input time.\n");
-        return 4;
-    }
-    //    if ( fabs(polarMotion->x - x) > DBL_EPSILON || fabs(polarMotion->y - y) > DBL_EPSILON
-    //            || fabs(polarMotion->s - s) > DBL_EPSILON) {
-    //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-    //                "psEOC_GetPolarMotion returned incorrect values.\n");
-    if (VERBOSE) {
-        printf("  <>PolarMotion output (IERSA)   = x,y,s = %.13g, %.13g, %.13g\n",
-               polarMotion->x, polarMotion->y, polarMotion->s);
-    }
-    //        printf("  <>PolarMotion expected (IERSA) = x,y,s = %.13g, %.13g, %.13g\n",
-    //               x, y, s);
-    //        return 5;
-    //    }
-    psFree(polarMotion);
-
-    //Return valid values for correct input time.  Test IERS Bulletin B.
-    polarMotion = psEOC_GetPolarMotion(in, PS_IERS_B);
-    //    x = -6.45381397904e-07;
-    //    y = 2.112819726698e-06;
-    //    s = 0.0;
-    if (polarMotion == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psEOC_GetPolarMotion returned NULL for valid input time.\n");
-        return 2;
-    }
-    //    if ( fabs(polarMotion->x - x) > DBL_EPSILON || fabs(polarMotion->y - y) > DBL_EPSILON
-    //            || fabs(polarMotion->s - s) > DBL_EPSILON) {
-    //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-    //                "psEOC_GetPolarMotion returned incorrect values.\n");
-    if (VERBOSE) {
-        printf("  <>PolarMotion output (IERSB)   = x,y,s = %.13g,  %.13g, %.13g\n",
-               polarMotion->x, polarMotion->y, polarMotion->s);
-    }
-    //        printf("  <>PolarMotion expected (IERSB) = x,y,s = %.13g, %.13g, %.13g\n",
-    //               x, y, s);
-    //        return 3;
-    //    }
-    psEarthPole *nutationCorr = psEOC_NutationCorr(in);
-    if (nutationCorr == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false, "Nutation Correction returned NULL.\n");
-        return 6;
-    }
-    polarMotion->x += nutationCorr->x;
-    polarMotion->y += nutationCorr->y;
-    polarMotion->s += nutationCorr->s;
-    psEarthPole *polarTide = psEOC_PolarTideCorr(in);
-    polarMotion->x += polarTide->x;
-    polarMotion->y += polarTide->y;
-    psFree(polarTide);
-    x = -6.43607313124045e-7;
-    y = 2.11351436973568e-6;
-    s = -7.39617581324646e-12;
-    //    if ( fabs(polarMotion->x - x) > DBL_EPSILON || fabs(polarMotion->y - y) > DBL_EPSILON
-    //            || fabs(polarMotion->s - s) > DBL_EPSILON) {
-    //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-    //                "   psEOC_GetPolarMotion returned incorrect values.\n");
-    if (VERBOSE) {
-        printf("\n  PolarMotion + NutationCorr out = x,y,s = %.13g, %.13g, %.13g\n",
-               polarMotion->x, polarMotion->y, polarMotion->s);
-        printf("  Expected output                = x,y,s = %.13g,  %.13g, %.13g\n", x, y, s);
-        printf("                     Difference  = x,y,s = %.13g, %.13g,  %.13g\n",
-               polarMotion->x - x, polarMotion->y - y, polarMotion->s - s);
-    }
-    //    }
-
-    if (!p_psEOCFinalize() ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n");
-        return 12;
-    }
-
-    psFree(nutationCorr);
-    psFree(in);
-    psFree(polarMotion);
-    return 0;
-}
-
-psS32 testEOCPolarTide(void)
-{
-    psTime *in = psTimeAlloc(PS_TIME_UTC);
-    in->sec = timesec;
-    in->nsec = 0;
-    in->leapsecond = false;
-    psTime *empty = NULL;
-    psEarthPole *eop = NULL;
-
-    //Return NULL for NULL input time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    eop = psEOC_PolarTideCorr(empty);
-    if (eop != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psEOC_PolarTideCorr failed to return NULL for NULL input time.\n");
-        return 1;
-    }
-
-    eop = psEOC_PolarTideCorr(in);
-    if (eop == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psEOC_PolarTideCorr returned NULL for valid input time.\n");
-        return 2;
-    } else {
-        if (VERBOSE) {
-            printf("\nPolarTideCorr output = x,y,s = %.13g, %.13g, %.13g\n",
-                   eop->x, eop->y, eop->s);
-        }
-    }
-
-    psFree(in);
-    psFree(eop);
-
-    return 0;
-}
-
-psS32 testEOCNutation(void)
-{
-    psTime *in = psTimeAlloc(PS_TIME_UTC);
-    in->sec = timesec;
-    in->nsec = 0;
-    in->leapsecond = false;
-    psTime *empty = NULL;
-    psEarthPole *nute = NULL;
-
-    //Return NULL for NULL input time.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    nute = psEOC_NutationCorr(empty);
-    if (nute != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psEOC_NutationCorr failed to return NULL for NULL input time.\n");
-        return 1;
-    }
-    //Return NULL for UT1 time input
-    /*    psTime *UT1time = psTimeAlloc(PS_TIME_UT1);
-        nute = psEOC_NutationCorr(UT1time);
-        if (nute != NULL) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                    "psEOC_NutationCorr failed to return NULL for UT1 input time.\n");
-            return 2;
-        }
-        psFree(UT1time);
-    */
-    //Check return values from valid nutation time input
-    nute = psEOC_NutationCorr(in);
-    if ( nute == NULL ) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psEOC_NutationCorr returned NULL for valid input.\n");
-        return 3;
-    } else {
-        if (VERBOSE) {
-            printf("Nutation Correction output = x,y,s = %.13g, %.13g, %.13g\n\n",
-                   nute->x, nute->y, nute->s);
-        }
-    }
-    psFree(nute);
-    psFree(in);
-
-    if (!p_psEOCFinalize() ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n");
-        return 12;
-    }
-
-    return 0;
-}
-
-psS32 testSphereRot_TEOtoCEO(void)
-{
-    psSphereRot *rot = NULL;
-    psTime *empty = NULL;
-    psTime *time = psTimeAlloc(PS_TIME_UT1);
-    time->sec = timesec-1;
-    time->nsec = 657017200;
-    time->leapsecond = false;
-
-    //return NULL for NULL input time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    rot = psSphereRot_TEOtoCEO(empty, NULL);
-    if (rot != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereRot_TEOtoCEO failed to return NULL for NULL input time.\n");
-        return 1;
-    }
-
-    psEarthPole *polarTideCorr = psEOC_PolarTideCorr(time);
-    psSphereRot *teoceo = psSphereRot_TEOtoCEO(time, polarTideCorr);
-    //Make sure values match for other psTime type
-    empty = psTimeAlloc(PS_TIME_UTC);
-    empty->sec = timesec;
-    empty->nsec = 0;
-    empty->leapsecond = false;
-
-    rot = psSphereRot_TEOtoCEO(empty, polarTideCorr);
-    if (fabs(rot->q0-teoceo->q0) > 0.00001 || fabs(rot->q1-teoceo->q1) > 0.00001 ||
-            fabs(rot->q2-teoceo->q2) > 0.00001 || fabs(rot->q3-teoceo->q3) > 0.00001) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereRot_TEOtoCEO failed to return matching values for different time types.\n");
-        if (VERBOSE) {
-            printf("\n  Output Rotation1 = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
-                   teoceo->q0, teoceo->q1, teoceo->q2, teoceo->q3 );
-            printf("\n  Output Rotation2 = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
-                   rot->q0, rot->q1, rot->q2, rot->q3 );
-        }
-        return 2;
-    }
-    if (VERBOSE) {
-        printf("\n  Output Rotation = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
-               teoceo->q0, teoceo->q1, teoceo->q2, teoceo->q3 );
-    }
-
-    objSetup();
-    psSphereRot *earthRot = psSphereRotConjugate(NULL, teoceo);
-    psSphere *result = psSphereRotApply(NULL, earthRot, obj);
-    //    psSphere *result = psSphereRotApply(NULL, teoceo, obj);
-    psCube *cube = psSphereToCube(result);
-
-    double x, y, z;
-    x = 0.01698625430807123;
-    y = -0.6616523084626379;
-    z = 0.7496183628158023;
-    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");
-        if (VERBOSE) {
-            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));
-        }
-        return 3;
-    }
-
-    psFree(polarTideCorr);
-    psFree(rot);
-    psFree(empty);
-    psFree(result);
-    psFree(obj);
-    psFree(earthRot);
-    psFree(cube);
-    psFree(time);
-    psFree(teoceo);
-    return 0;
-}
-
-psS32 testSphereRot_CEOtoGCRS(void)
-{
-    psEarthPole *in = psEarthPoleAlloc();
-    psEarthPole *empty = NULL;
-    psSphereRot *rot = NULL;
-    in->x = 2.857175590089105e-4;
-    in->y = 2.3968739377734732e-5;
-    in->s = -1.3970066457904322e-8;
-
-    double q0,q1,q2,q3;
-    q0 = -1.1984522406756289e-5;
-    q1 = 1.4285893358610674e-4;
-    q2 = 1.2191193518914336e-10;
-    q3 = -0.9999999897238481;
-
-    //Return NULL for NULL input earthpole
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    rot = psSphereRot_CEOtoGCRS(empty);
-    if (rot != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereRot_CEOtoGCRS failed to return NULL for NULL input psEarthPole.\n");
-        return 1;
-    }
-
-    rot = psSphereRot_CEOtoGCRS(in);
-    if (rot == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psSphereRot_CEOtoGCRS returned NULL for valid psEarthPole input.\n");
-        return 2;
-    }
-
-    if (VERBOSE) {
-        printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
-               rot->q0, rot->q1, rot->q2, rot->q3);
-        printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
-        printf("  difference:                 %.13g, %.13g, %.13g \n",
-               (rot->q0-q0), (rot->q1-q1), (rot->q2-q2) );
-    }
-    if (fabs(rot->q0-q0) > FLT_EPSILON || fabs(rot->q1-q1) > FLT_EPSILON ||
-            fabs(rot->q2-q2) > FLT_EPSILON || fabs(rot->q3+q3) > FLT_EPSILON) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereRot_CEOtoGCRS failed to return expected values.\n");
-        return 3;
-    }
-    psCube *tempCube = psCubeAlloc();
-    tempCube->x = -0.35963388069046304;
-    tempCube->y = 0.5555192509816625;
-    tempCube->z = 0.7497078321908413;
-    obj = psCubeToSphere(tempCube);
-    psFree(tempCube);
-    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;
-    if (VERBOSE) {
-        printf("\n  Output 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));
-    }
-    psCube *expect = psCubeAlloc();
-    expect->x = x;
-    expect->y = y;
-    expect->z = z;
-    psSphere *expected = psCubeToSphere(expect);
-    double d = greatCircle(result, expected);
-    if (VERBOSE) {
-        printf("   The great circle angular distance between expected & result = %.13g\n", d);
-    }
-
-    psFree(expect);
-    psFree(expected);
-    psFree(obj);
-    psFree(precessionNutation);
-    psFree(result);
-    psFree(cube);
-    psFree(rot);
-    psFree(in);
-
-    return 0;
-}
-
-psS32 testSphereRot_ITRStoTEO(void)
-{
-    psEarthPole *in = psEarthPoleAlloc();
-    psEarthPole *empty = NULL;
-    psSphereRot *rot = NULL;
-    in->x = -0.13275353774074533;
-    in->y = 0.4359436319739848;
-    in->s = -4.2376965863576153e-10;
-    in->x = SEC_TO_RAD(in->x);
-    in->y = SEC_TO_RAD(in->y);
-    in->s = SEC_TO_RAD(in->s);
-
-    //Return NULL for NULL input earthpole
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    rot = psSphereRot_ITRStoTEO(empty);
-    if (rot != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereRot_ITRStoTEO failed to return NULL for NULL input psEarthPole.\n");
-        return 1;
-    }
-
-    rot = psSphereRot_ITRStoTEO(in);
-    if (rot == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psSphereRot_ITRStoTEO return NULL for valid psEarthPole input.\n");
-        return 2;
-    }
-
-    double q0,q1,q2,q3;
-    q0 = -1.0567571848664005e-6;
-    q1 = 3.218036562931509e-7;
-    q2 = -3.3580195807204483e-12;
-    q3 = -0.9999999999993899;
-    if (fabs(rot->q0-q0) > FLT_EPSILON || fabs(rot->q1-q1) > FLT_EPSILON ||
-            fabs(rot->q2-q2) > FLT_EPSILON
-            //            || fabs(rot->q3-q3) > DBL_EPSILON
-       ) {
-        if (VERBOSE) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                    "psSphereRot_ITRStoTEO failed to return expected values.\n");
-            printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
-                   rot->q0, rot->q1, rot->q2, rot->q3);
-            printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
-            printf("  a difference:   %.13g, %.13g, %.13g, %.13g \n", (rot->q0-q0), (rot->q1-q1),
-                   (rot->q2-q2), (rot->q3-q3) );
-        }
-        //        printf("Error #3\n");
-        //        return 3;
-    }
-    if (VERBOSE) {
-        printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
-               rot->q0, rot->q1, rot->q2, rot->q3);
-        printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
-    }
-
-    psCube *temp = psCubeAlloc();
-    //    temp->x = -0.3596195125758298;
-    //    temp->y = 0.5555613903455866;
-    //    temp->z = 0.7496834983724809;
-    temp->x = 0.01698625430807123;
-    temp->y = -0.6616523084626379;
-    temp->z = 0.7496183628158023;
-
-    obj = psCubeToSphere(temp);
-    psSphere *test = NULL;
-    psFree(temp);
-    psSphereRot *newRot = psSphereRotConjugate(NULL, rot);
-    test = psSphereRotApply(NULL, newRot, obj);
-    temp = psSphereToCube(test);
-    double x, y, z;
-    x = 0.01698577185310146;
-    y = -0.6616538927902393;
-    z = 0.7496169753347885;
-    if (VERBOSE) {
-        printf("\n  Cube -test- has x,y,z =     %.13g, %.13g, %.13g \n",
-               temp->x, temp->y, temp->z);
-        printf("\n  Cube -expected- has x,y,z = %.13g,  %.13g, %.13g \n", x, y, z );
-    }
-    temp->x = x;
-    temp->y = y;
-    temp->z = z;
-    psSphere *sphere = psCubeToSphere(temp);
-    double d = greatCircle(sphere, test);
-    if (VERBOSE) {
-        printf("Great circle difference of:  %.13g \n", d);
-    }
-
-    psFree(sphere);
-    psFree(newRot);
-    psFree(obj);
-    psFree(temp);
-    psFree(test);
-    psFree(rot);
-    psFree(in);
-
-    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
-#define ERROR_TOL   0.0001
-#define MJD_1900  15021.0        // Modified Julian Day 1/1/1900 00:00:00
-#define MJD_2100  88069.0        // Modified Julian Day 1/1/2100 00:00:00
-
-psS32 testSphereRotPrecess( void )
-{
-
-    psSphere*     inputCoord  = psSphereAlloc();
-    psSphere*     outputCoord = NULL;
-    //    psTime*       fromTime    = psTimeFromMJD(MJD_1900);
-    //    psTime*       toTime      = psTimeFromMJD(MJD_2100);
-    psTime*       fromTime    = psTimeFromMJD(MJD_2100);
-    psTime*       toTime      = psTimeFromMJD(MJD_1900);
-    psSphereRot *rot = NULL;
-    // 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
-    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_ROUGH);
-    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
-    if (outputCoord->r < -0.0001) {
-        outputCoord->r += 2.0 * M_PI;
-    }
-    //    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime, PS_PRECESS_ROUGH);
-    // Verify return is not NULL
-    if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
-        return 1;
-    }
-    // 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 2;
-    }
-    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 3;
-    }
-    psFree(outputCoord);
-    psFree(rot);
-
-    // 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
-    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_ROUGH);
-    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
-    if (outputCoord->r < -0.0001) {
-        outputCoord->r += 2.0 * M_PI;
-    }
-    //    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime, PS_PRECESS_ROUGH);
-    // Verify return is not NULL
-    if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
-        return 4;
-    }
-    // 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 5;
-    }
-    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 6;
-    }
-    psFree(outputCoord);
-    psFree(rot);
-
-    // 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
-    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_ROUGH);
-    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
-    if (outputCoord->r < -0.0001) {
-        outputCoord->r += 2.0 * M_PI;
-    }
-    //    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime, PS_PRECESS_ROUGH);
-    // Verify return is not NULL
-    if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
-        return 7;
-    }
-    // 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 8;
-    }
-    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 9;
-    }
-    psFree(outputCoord);
-    psFree(rot);
-
-    //Test other modes (IAU2000A, COMPLETE_[A,B])
-    // 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
-    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_COMPLETE_A);
-    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
-    if (outputCoord->r < -0.000001) {
-        outputCoord->r += 2.0 * M_PI;
-    }
-    // Verify return is not NULL
-    if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
-        return 10;
-    }
-    psFree(outputCoord);
-    psFree(rot);
-
-    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_COMPLETE_B);
-    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
-    if (outputCoord->r < -0.000001) {
-        outputCoord->r += 2.0 * M_PI;
-    }
-    // Verify return is not NULL
-    if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
-        return 11;
-    }
-    psFree(outputCoord);
-    psFree(rot);
-
-    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_IAU2000A);
-    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
-    if (outputCoord->r < -0.000001) {
-        outputCoord->r += 2.0 * M_PI;
-    }
-    // Verify return is not NULL
-    if(outputCoord == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
-        return 12;
-    }
-    psFree(outputCoord);
-    psFree(rot);
-
-    // Invoke precess with invalid parameter
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
-    rot = psSpherePrecess(fromTime, toTime, 10);
-    if(rot != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
-        return 14;
-    }
-    // Return NULL for NULL input times
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
-    rot = psSpherePrecess(NULL, NULL, PS_PRECESS_ROUGH);
-    if(rot != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
-        return 15;
-    }
-
-    if (!p_psEOCFinalize() ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n");
-        return 12;
-    }
-    // Free objects
-    psFree(fromTime);
-    psFree(toTime);
-    psFree(inputCoord);
-
-    return 0;
-}
Index: trunk/psLib/test/astro/tst_psSphereOps.c
===================================================================
--- trunk/psLib/test/astro/tst_psSphereOps.c	(revision 24303)
+++ 	(revision )
@@ -1,390 +1,0 @@
-/** @file  tst_psSphereOps.c
-*
-*  @brief The code will perform sphere rotations and transformations.
-*
-*  @author d-Rob, MHPCC
-*
-*  @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
-*/
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-static psS32 testSphereRotAlloc(void);
-static psS32 testSphereRotQuat(void);
-static psS32 testSphereRotApply1(void);
-static psS32 testSphereRotApplyCelestial(void);
-static psS32 testSphereOffset(void);
-
-testDescription tests[] = {
-                              {testSphereRotAlloc, 819, "psSphereRotAlloc()", 0, false},
-                              {testSphereRotQuat, 820, "psSphereRotQuat()", 0, false},
-                              {testSphereRotApply1, 821, "psSphereRotApply()", 0, false},
-                              {testSphereRotApplyCelestial, 822, "psSphereRotApplyCel()", 0, false},
-                              {testSphereOffset, 825, "testSphereOffset()", 0, false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-    psLogSetFormat("HLNM");
-
-    return ( ! runTestSuite( stderr, "psSphereOps", tests, argc, argv ) );
-}
-
-#define DEG_INC   30.0
-
-#define MJD_1900  15021.0        // Modified Julian Day 1/1/1900 00:00:00
-#define MJD_2000  51544.0        // Modified Julian Day 1/1/2000 00:00:00
-#define MJD_2100  88069.0        // Modified Julian Day 1/1/2100 00:00:00
-
-#define ERROR_TOL   0.0001
-
-#define ALPHA_P 4*M_PI/3
-#define DELTA_P M_PI/4
-#define PHI_P M_PI/3
-
-psS32 testSphereRotAlloc( void )
-{
-    // Allocate data structure
-    psSphereRot* myST = psSphereRotAlloc(ALPHA_P, DELTA_P, PHI_P);
-
-    // Verify null not returned
-    if(myST == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL with valid parameters");
-        return 1;
-    }
-
-    double a0 = (ALPHA_P - PHI_P)/2.0;
-    double a1 = (ALPHA_P - PHI_P)/2.0;
-    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);
-        return 2;
-    }
-    if (DBL_EPSILON < fabs(q1 - myST->q1)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->q1 is %f, should be %f\n", myST->q1, q1);
-        return 3;
-    }
-    if (DBL_EPSILON < fabs(q2 - myST->q2)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->q2 is %f, should be %f\n", myST->q2, q2);
-        return 4;
-    }
-    if (DBL_EPSILON < fabs(q3 - myST->q3)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->q0 is %f, should be %f\n", myST->q3, q3);
-        return 5;
-    }
-
-    // Free data structure
-    psFree(myST);
-
-    return 0;
-}
-
-psS32 testSphereRotQuat(void)
-{
-    double a0 = (ALPHA_P - PHI_P)/2.0;
-    double a1 = (ALPHA_P - PHI_P)/2.0;
-    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);
-
-    psSphereRot *myST = psSphereRotQuat(q0*2.0, q1*2.0, q2*2.0, q3*2.0);
-    // Verify null not returned
-    if(myST == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL with valid parameters");
-        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);
-        return 2;
-    }
-    if (FLT_EPSILON < fabs(q1 - myST->q1)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->q1 is %f, should be %f\n", myST->q1, q1);
-        return 3;
-    }
-    if (FLT_EPSILON < fabs(q2 - myST->q2)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->q2 is %f, should be %f\n", myST->q2, q2);
-        return 4;
-    }
-    if (FLT_EPSILON < fabs(q3 - myST->q3)) {
-        psError(PS_ERR_UNKNOWN,true,"myST->q0 is %f, should be %f\n", myST->q3, q3);
-        return 5;
-    }
-
-    // Free data structure
-    psFree(myST);
-
-    return 0;
-}
-
-// We do a simple identity transformation on a few RA, DEC pairs.
-psS32 testSphereRotApply1( void )
-{
-    psSphere *in = psSphereAlloc();
-    psSphere *out = psSphereAlloc();
-    psSphere *temp = NULL;
-    psSphere *rc = NULL;
-    psSphere *temp2 = psSphereAlloc();
-    psSphereRot *myST = psSphereRotAlloc(ALPHA_P, DELTA_P, PHI_P);
-    psSphereRot *yourST =  psSphereRotInvert(ALPHA_P, DELTA_P, PHI_P);
-
-    for (float r=0.0;r<180.0;r+=DEG_INC) {
-        for (float d=0.0;d<90.0;d+=DEG_INC) {
-            in->r = DEG_TO_RAD(r);
-            in->d = DEG_TO_RAD(d);
-            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);
-                return 2;
-            }
-            if (ERROR_TOL < fabs(out->d - in->d)) {
-                psError(PS_ERR_UNKNOWN,true,"out->d is %f, should be %f\n", out->d, in->d);
-                return 3;
-            }
-        }
-    }
-    // Verify new sphere object is created if out parameter NULL
-    temp = psSphereRotApply(NULL, myST, in);
-    if ( temp == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL when out parameter was null");
-        return 4;
-    }
-    psFree(temp);
-
-    // Verify NULL returned if transform structure null
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
-    rc = psSphereRotApply(NULL, NULL, in);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply() did not return NULL.");
-        return 5;
-    }
-
-    // Verify NULL returned when input sphere is NULL
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
-    rc = psSphereRotApply(NULL, myST, NULL);
-    if (rc != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psSphereRotApply() did not return NULL");
-        return 6;
-    }
-
-    psFree(myST);
-    psFree(yourST);
-    psFree(temp2);
-    psFree(out);
-    psFree(in);
-
-    return 0;
-}
-
-#define ERROR_PERCENT 0.01
-
-psS32 testSphereRotApplyCelestial( void)
-{
-    //Test cases below were provided in ADD.
-    int numTestPoints = 3;
-    // ICRS coordinates
-    double alpha[] = {  0.0,        0.0,     180.0     };
-    double delta[] = {  0.0,       90.0,      30.0     };
-    //Ecliptic coordinates
-    double lambda[] ={  0.0,       90.0,     167.072470};
-    double beta[] =  {  0.0,       66.560719, 27.308813};
-    // Galactic coordinates
-    double l[] =     { 96.337272, 122.93192, 195.639488};
-    double b[] =     {-60.188553,  27.12825,  78.353806};
-    double t[] =     {  MJD_2000,  MJD_2000,   MJD_2100};
-    double TOLERANCE = 0.001;
-
-    for (int x = 0; x < numTestPoints; x++) {
-        //Setup the appropriate rotations
-        psTime* time = psTimeFromMJD(t[x]);
-        psSphereRot* toEcliptic = psSphereRotICRSToEcliptic(time);
-        psSphereRot* fromEcliptic = psSphereRotEclipticToICRS(time);
-        psSphereRot* toGalactic = psSphereRotICRSToGalactic();
-        psSphereRot* fromGalactic = psSphereRotGalacticToICRS();
-        psFree(time);
-
-        // set the ICRS coordinate
-        psSphere* icrs = psSphereAlloc();
-        icrs->r = DEG_TO_RAD(alpha[x]);
-        icrs->d = DEG_TO_RAD(delta[x]);
-
-        // apply/unapply Ecliptic
-        psSphere* ecliptic = psSphereRotApply(NULL, toEcliptic, icrs);
-        psSphere* icrsFromEcliptic = psSphereRotApply(NULL, fromEcliptic, ecliptic);
-
-        // check ecliptic transforms for correctness
-        if (fabs(RAD_TO_DEG(ecliptic->r) - lambda[x]) > TOLERANCE ||
-                fabs(RAD_TO_DEG(ecliptic->d) - beta[x]) > TOLERANCE) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Ecliptic tranformation incorrect.  Result is (%g,%g), expected (%g,%g)",
-                    RAD_TO_DEG(ecliptic->r),RAD_TO_DEG(ecliptic->d),
-                    lambda[x], beta[x]);
-            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 ) ||
-                fabs(RAD_TO_DEG(icrsFromEcliptic->d) - delta[x]) > TOLERANCE) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "ICRS for Ecliptic tranformation incorrect.  Result is (%g,%g), expected (%g,%g)",
-                    RAD_TO_DEG(icrsFromEcliptic->r),RAD_TO_DEG(icrsFromEcliptic->d),
-                    alpha[x], delta[x]);
-            return 2;
-        }
-        psFree(ecliptic);
-        psFree(icrsFromEcliptic);
-
-        //Setup galactic transformations
-        psSphere* galactic = psSphereRotApply(NULL, toGalactic, icrs);
-        psSphere* icrsFromGalactic = psSphereRotApply(NULL, fromGalactic, galactic);
-
-        // check ecliptic transforms for correctness
-        if (fabs(RAD_TO_DEG(galactic->r) - l[x]) > TOLERANCE ||
-                fabs(RAD_TO_DEG(galactic->d) - b[x]) > TOLERANCE) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Galactic tranformation incorrect.  Result is (%g,%g), expected (%g,%g)",
-                    RAD_TO_DEG(galactic->r),RAD_TO_DEG(galactic->d),
-                    l[x], b[x]);
-            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 ) ||
-                fabs(RAD_TO_DEG(icrsFromGalactic->d) - delta[x]) > TOLERANCE) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "ICRS for Galactic tranformation incorrect.  Result is (%g,%g), expected (%g,%g)",
-                    RAD_TO_DEG(icrsFromGalactic->r),RAD_TO_DEG(icrsFromGalactic->d),
-                    alpha[x], delta[x]);
-            return 4;
-        }
-        psFree(galactic);
-        psFree(icrsFromGalactic);
-        psFree(icrs);
-        psFree(toEcliptic);
-        psFree(fromEcliptic);
-        psFree(toGalactic);
-        psFree(fromGalactic);
-    }
-    return 0;
-}
-
-psS32 testSphereOffset(void)
-{
-    psSphere *origin = psSphereAlloc();
-    psSphere *offset = psSphereAlloc();
-    psSphere *dest = psSphereAlloc();
-    psSphere *empty = NULL;
-    psSphere *output = NULL;
-
-    //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) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereSetOffset Failed to return NULL for NULL input.\n");
-        return 1;
-    }
-    //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) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereSetOffset Failed to return NULL for NULL input.\n");
-        return 2;
-    }
-    //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) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereGetOffset Failed to return NULL for NULL input.\n");
-        return 3;
-    }
-    //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) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereGetOffset Failed to return NULL for NULL input.\n");
-        return 4;
-    }
-
-    //Test Set using Spherical mode, Degree units
-    origin->r = 0.0;
-    origin->d = 0.0;
-    offset->r = 45.0;
-    offset->d = 30.0;
-    output = psSphereSetOffset(origin, offset, PS_SPHERICAL, PS_DEGREE);
-    if ( fabs(output->r - M_PI/4.0) > 0.0001 ||
-            fabs(output->d - M_PI/6.0) > 0.0001 ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereSetOffset failed to return correct spherical offset values.\n");
-        return 5;
-    }
-    psFree(output);
-
-    //Test Set and Get using Linear mode, Radian units
-    origin->r = 0.0;
-    origin->d = 0.0;
-    offset->r = 1.0;
-    offset->d = 1.0;
-    output = psSphereSetOffset(origin, offset, PS_LINEAR, PS_RADIAN);
-
-    empty = psSphereGetOffset(origin, output, PS_LINEAR, PS_RADIAN);
-    if ( fabs(offset->r - empty->r) > 0.0001 || fabs(offset->d - empty->d) > 0.0001 ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereGetOffset failed to return correct linear offset values.\n");
-        return 7;
-    }
-    psFree(output);
-    psFree(empty);
-
-    //Test Set using Linear mode, Arcmin units
-    origin->r = 0.0;
-    origin->d = 0.0;
-    offset->r = RAD_TO_MIN(M_PI / 4.0);     //45 deg
-    offset->d = RAD_TO_MIN(M_PI / 6.0);     //30 deg
-    output = psSphereSetOffset(origin, offset, PS_SPHERICAL, PS_ARCMIN);
-    //Test Get using Spherical mode, Arcsec units
-    empty = psSphereGetOffset(origin, output, PS_SPHERICAL, PS_ARCSEC);
-    empty->r = SEC_TO_RAD(empty->r);
-    empty->d = SEC_TO_RAD(empty->d);
-    if (fabs(empty->r - (M_PI / 4.0)) > 0.001 || fabs(empty->d - (M_PI / 6.0)) > 0.001) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psSphereGetOffset failed to return correct offset unit values.\n");
-        printf("\n SphereGetOffset should be %lf, %lf and is %lf, %lf\n", output->r, output->d,
-               empty->r, empty->d);
-        return 8;
-    }
-    psFree(output);
-
-    psFree(origin);
-    psFree(dest);
-    psFree(offset);
-    psFree(empty);
-
-    return 0;
-}
-
Index: trunk/psLib/test/astro/tst_psTime_01.c
===================================================================
--- trunk/psLib/test/astro/tst_psTime_01.c	(revision 24303)
+++ 	(revision )
@@ -1,1163 +1,0 @@
-/** @file  tst_psTime_01.c
- *
- *  @brief Test driver for psTime functions
- *
- *  This test driver contains the following tests for psTime:
- *     1) Allocate psTime structure
- *     2) Get current time
- *     3) Get UT1 UTC delta
- *     4) Convert psTime to MJD
- *     5) Convert psTime to JD
- *     6) Convert psTime to ISO
- *     7) Convert psTime to timeval
- *     8) Create psTime from MJD
- *     9) Create psTime from JD
- *    10) Create psTime from ISO
- *    11) Create psTime from timeval
- *    12) Create psTime from TM
- *    13) Convert time between different types
- *
- *     O) Convert psTime time to LMST
- *
- *  @author  Ross Harman, MHPCC
- *  @author  Eric Van Alst, MHPCC
- *
- *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-07-21 00:08:15 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib_strict.h"
-#include "psTest.h"
-#include <string.h>
-
-#define ERROR_TOL    0.0001
-
-static psS32 testTimeAlloc(void);
-static psS32 testTimeGetNow(void);
-static psS32 testTimeGetUT1Delta(void);
-static psS32 testTimeToMJD(void);
-static psS32 testTimeToJD(void);
-static psS32 testTimeToISO(void);
-static psS32 testTimeToTimeval(void);
-static psS32 testTimeFromMJD(void);
-static psS32 testTimeFromJD(void);
-static psS32 testTimeFromISO(void);
-static psS32 testTimeFromTimeval(void);
-static psS32 testTimeFromTM(void);
-static psS32 testTimeConvert(void);
-
-testDescription tests[] = {
-                              {testTimeAlloc,1,"psTimeAlloc",0,false},
-                              {testTimeGetNow,2,"psTimeGetNow",0,false},
-                              {testTimeGetUT1Delta,3,"psTimeGetUT1Delta",0,false},
-                              {testTimeToMJD,4,"psTimeToMJD",0,false},
-                              {testTimeToJD,5,"psTimeToJD",0,false},
-                              {testTimeToISO,6,"psTimeToISO",0,false},
-                              {testTimeToTimeval,7,"psTimeToTimeval",0,false},
-                              {testTimeFromMJD,8,"psTimeFromMJD",0,false},
-                              {testTimeFromJD,9,"psTimeFromJD",0,false},
-                              {testTimeFromISO,10,"psTimeFromISO",0,false},
-                              {testTimeFromTimeval,11,"psTimeFromTimeval",0,false},
-                              {testTimeFromTM,12,"p_psTimeFromTM",0,false},
-                              {testTimeConvert,666,"psTimeConvert",0,false},
-                              {NULL}
-                          };
-
-// Test Time 1 : July 21, 2004  18:22:24.3
-//               MJD = 53207.765559
-//               JD = 2453208.265559
-// UTC Test Time 1
-const psS64 testTime1SecondsUTC     = 1090434144;
-const psU32 testTime1NanosecondsUTC = 272044000;
-// TAI Test Time 1
-const psS64 testTime1SecondsTAI     = 1090434176;
-const psU32 testTime1NanosecondsTAI = 272044000;
-const psF64 testTime1MJDTAI         = 53207.76592937;
-const psF64 testTime1JDTAI          = 2453208.26592937;
-
-// TT Test Time 1
-const psS64 testTime1SecondsTT      = 1090434208;
-const psU32 testTime1NanosecondsTT  = 456044000;
-// Expected UT1-UTC IERS A & B
-const psF64 testTime1UT1DeltaBullA  = -0.457233186;
-const psF64 testTime1UT1DeltaBullB  = -0.457227;
-// UT1 Test Time 1
-const psS64 testTime1SecondsUT1     = 1090434143;
-//const psU32 testTime1NanosecondsUT1 = 814810814;
-const psU32 testTime1NanosecondsUT1 = 814810861;
-// Expected MJD & JD
-const psF64 testTime1MJD            = 53207.765559;
-const psF64 testTime1JD             = 2453208.265559;
-// Expected ISO string
-const char* testTime1Str     = "2004-07-21T18:22:24.2Z";
-const char* testTime1StrLeap = "2004-07-21T18:22:60.2Z";
-// Expected timeval values
-const psS32 testTime1TimevalSec = 1090434144;
-const psS32 testTime1TimevalUsec = 272044;
-
-// Test Time 2 : Jan. 1, 1973 00:00:00.0000
-//               MJD = 41683.0000
-//               JD = 2441683.5000
-const psS64 testTime2SecondsUTC     = 94694400;
-const psU32 testTime2NanosecondsUTC = 0;
-
-// Expected UT1-UTC IERS A & B
-const psF64 testTime2UT1DeltaBullA  = 0.000000;
-const psF64 testTime2UT1DeltaBullB  = 0.000000;
-
-// Test Time 3 : Sept. 21, 2006 00:00:00.0000
-//               MJD = 53999
-//               JD = 2453999.5
-const psS64 testTime3SecondsUTC     = 1158796800;
-const psU32 testTime3NanosecondsUTC = 0;
-// Expected UT1-UTC IERS A & B
-const psF64 testTime3UT1DeltaBullA  = -0.63574;
-const psF64 testTime3UT1DeltaBullB  = -0.63574;
-
-// Test Time 4 : Jan. 1, 1969 00:00:00.0000
-//               MJD = 40222
-//               JD = 2440222.5
-const psS64 testTime4SecondsUTC     = -31536000;
-const psU32 testTime4NanosecondsUTC = 0;
-// Expected MJD and JD
-const psF64 testTime4MJD            = 40222.0;
-const psF64 testTime4JD             = 2440222.5;
-
-// Test Time 5 : Dec 31, 0001 BC 23:59:59
-//               MJD = -1397755
-//               JD = 1002245.4999
-const psS64 testTime5SecondsUTC     = -62125920001;
-const psU32 testTime5NanosecondsUTC  = 0;
-
-// Test Time 6 : Jan. 1, 10000 AD 00:00:00
-const psS64 testTime6SecondsUTC      = 253202544001;
-const psU32 testTime6NanosecondsUTC  = 0;
-
-// Test Time 7 : Jan. 1, 2004 00:00:00,0
-const psS64 testTime7Seconds         = 1072915200;
-const psU32 testTime7Nanoseconds     = 0;
-const psS32 testTime7TmYear          = 104;
-const psS32 testTime7TmMon           = 0;
-const psS32 testTime7TmDay           = 1;
-const psS32 testTime7TmHour          = 0;
-const psS32 testTime7TmMin           = 0;
-const psS32 testTime7TmSec           = 0;
-
-// Test Time 8 : Dec. 31, 2003 00:00:00,0
-const psS64 testTime8Seconds         = 1072828800;
-const psU32 testTime8Nanoseconds     = 0;
-const psS32 testTime8TmYear          = 103;
-const psS32 testTime8TmMon           = 11;
-const psS32 testTime8TmDay           = 31;
-const psS32 testTime8TmHour          = 0;
-const psS32 testTime8TmMin           = 0;
-const psS32 testTime8TmSec           = 0;
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    // Initialize library internal structures
-    psLibInit("pslib.config");
-
-    if( !runTestSuite(stderr,"psTime",tests,argc,argv)) {
-        return 1;
-    }
-
-    // Cleanup library
-    psLibFinalize();
-
-    return 0;
-}
-
-psS32 testTimeAlloc(void)
-{
-    psTime*  time = NULL;
-
-    // Allocate new psTime with valid time type
-    time = psTimeAlloc(PS_TIME_TAI);
-    if(time == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL when psTime object ptr expected");
-        return 1;
-    }
-    // Verify members set properly
-    if(time->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Member type = %d not as expected %d",time->type,PS_TIME_TAI);
-        return 2;
-    }
-    if((time->sec != 0) && (time->nsec != 0) && (time->leapsecond != false)) {
-        psError(PS_ERR_UNKNOWN,true,"Members not set appropriately");
-        return 3;
-    }
-    psFree(time);
-
-    // Allocate new psTime with invalid time type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    time = psTimeAlloc(-100);
-    if(time != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid time type");
-        return 4;
-    }
-
-    return 0;
-}
-psS32 testTimeGetNow(void)
-{
-    psTime*  timeNow = NULL;
-
-    // Get current time and verify return is psTime structure
-    timeNow = psTimeGetNow(PS_TIME_TAI);
-    if(timeNow == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return valid psTime struct");
-        return 1;
-    }
-    if(timeNow->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Time type %d not as expected %d",
-                timeNow->type, PS_TIME_TAI);
-        return 2;
-    }
-    psFree(timeNow);
-
-    // Attempt to get time with invalid type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time type");
-    timeNow = psTimeGetNow(-100);
-    if(timeNow != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid time type");
-        return 3;
-    }
-
-    return 0;
-}
-
-psS32 testTimeGetUT1Delta(void)
-{
-    psTime*    time      = NULL;
-    psF64      ut1Delta  = 0.0;
-
-    // Attempt to convert NULL time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL time");
-    ut1Delta = psTimeGetUT1Delta(time,PS_IERS_B);
-    if( !isnan(ut1Delta)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for NULL psTime");
-        return 1;
-    }
-
-    // Attempt to convert invalid time
-    time = psTimeAlloc(PS_TIME_TAI);
-    time->sec = 1;
-    time->nsec = 2e9;
-    time->leapsecond = false;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    ut1Delta = psTimeGetUT1Delta(time,PS_IERS_B);
-    if( !isnan(ut1Delta)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid time");
-        return 2;
-    }
-
-    // Attempt to convert time with invalid bulletin
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid bulletin");
-    time->nsec = 2;
-    ut1Delta = psTimeGetUT1Delta(time,-100);
-    if( !isnan(ut1Delta)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid bulletin");
-        return 3;
-    }
-
-    // Attempt to get delta with valid time and bulletin A
-    time->sec  = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    time->type = PS_TIME_UTC;
-    ut1Delta = psTimeGetUT1Delta(time,PS_IERS_A);
-    if(fabs(ut1Delta - testTime1UT1DeltaBullA) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 Delta %lf not as expected %lf test time 1 bulletin A",
-                ut1Delta,testTime1UT1DeltaBullA);
-        return 4;
-    }
-
-    // Attempt to get delta with valid time and bulletin B
-    ut1Delta = psTimeGetUT1Delta(time,PS_IERS_B);
-    if(fabs(ut1Delta - testTime1UT1DeltaBullB) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 Delta %lf not as expected %lf test time 1 bulletin B",
-                ut1Delta,testTime1UT1DeltaBullB);
-        return 5;
-    }
-
-    // Attempt to get delta with valid time and bulletin A
-    time->sec  = testTime2SecondsUTC;
-    time->nsec = testTime2NanosecondsUTC;
-    time->type = PS_TIME_UTC;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate a warning message predating table");
-    ut1Delta = psTimeGetUT1Delta(time,PS_IERS_A);
-    if(fabs(ut1Delta - testTime2UT1DeltaBullA) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 Delta %lf not as expected %lf test time 2 bulletin A",
-                ut1Delta,testTime2UT1DeltaBullA);
-        return 6;
-    }
-
-    // Attempt to get delta with valid time and bulletin B
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate a warning message predating table");
-    ut1Delta = psTimeGetUT1Delta(time,PS_IERS_B);
-    if(fabs(ut1Delta - testTime2UT1DeltaBullB) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 Delta %lf not as expected %lf test time 2 bulletin B",
-                ut1Delta,testTime2UT1DeltaBullB);
-        return 7;
-    }
-
-    // Attempt to get delta with valid time and bulletin A
-    time->sec  = testTime3SecondsUTC;
-    time->nsec = testTime3NanosecondsUTC;
-    time->type = PS_TIME_UTC;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate a warning message postdating table");
-    ut1Delta = psTimeGetUT1Delta(time,PS_IERS_A);
-    if(fabs(ut1Delta - testTime3UT1DeltaBullA) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 Delta %lf not as expected %lf test time 3 bulletin A",
-                ut1Delta,testTime3UT1DeltaBullA);
-        return 8;
-    }
-
-    // Attempt to get delta with valid time and bulletin B
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate a warning message postdating table");
-    ut1Delta = psTimeGetUT1Delta(time,PS_IERS_B);
-    if(fabs(ut1Delta - testTime3UT1DeltaBullB) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 Delta %lf not as expected %lf test time 3 bulletin B",
-                ut1Delta,testTime3UT1DeltaBullB);
-        return 9;
-    }
-
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeToMJD(void)
-{
-    psTime*  time = NULL;
-    psF64    mjd  = 0.0;
-
-    // Attempt to convert with time NULL
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL time");
-    mjd = psTimeToMJD(NULL);
-    if(!isnan(mjd)) {
-        psError(PS_ERR_UNKNOWN,true,"Expected NaN for NULL time");
-        return 1;
-    }
-
-    // Attempt to convert invalid time
-    time = psTimeAlloc(PS_TIME_UTC);
-    time->sec = 1;
-    time->nsec = 2e9;
-    time->leapsecond = false;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    mjd = psTimeToMJD(time);
-    if( !isnan(mjd)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid time");
-        return 2;
-    }
-
-    // Check valid time conversion to MJD after 1/1/1970 epoch
-    time->sec = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    mjd = psTimeToMJD(time);
-    //    if(fabs(mjd - testTime1MJD) > ERROR_TOL) {
-    if(fabs(mjd - 53207.765929) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Expected MJD = %lf not as expected %lf",
-                mjd, testTime1MJD);
-        return 3;
-    }
-
-    // Check valid time conversion to MJD before 1/1/1970 epoch
-    time->sec = testTime4SecondsUTC;
-    time->nsec = testTime4NanosecondsUTC;
-    mjd = psTimeToMJD(time);
-    if(fabs(mjd - testTime4MJD) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Expected MJD = %lf not as expected %lf",
-                mjd, testTime4MJD);
-        return 4;
-    }
-
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeToJD(void)
-{
-    psTime*  time = NULL;
-    psF64    jd  = 0.0;
-
-    // Attempt to convert with time NULL
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL time");
-    jd = psTimeToJD(NULL);
-    if(!isnan(jd)) {
-        psError(PS_ERR_UNKNOWN,true,"Expected NaN for NULL time");
-        return 1;
-    }
-
-    // Attempt to convert invalid time
-    time = psTimeAlloc(PS_TIME_UTC);
-    time->sec = 1;
-    time->nsec = 2e9;
-    time->leapsecond = false;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    jd = psTimeToJD(time);
-    if( !isnan(jd)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid time");
-        return 2;
-    }
-
-    // Check valid time conversion to MJD after 1/1/1970 epoch
-    time->sec = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    jd = psTimeToJD(time);
-    //    if(fabs(jd - testTime1JD) > ERROR_TOL) {
-    if(fabs(jd - 2453208.265929) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Expected JD = %lf not as expected %lf",
-                jd, testTime1JD);
-        return 3;
-    }
-
-    // Check valid time conversion to MJD before 1/1/1970 epoch
-    time->sec = testTime4SecondsUTC;
-    time->nsec = testTime4NanosecondsUTC;
-    jd = psTimeToJD(time);
-    if(fabs(jd - testTime4JD) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Expected JD = %lf not as expected %lf",
-                jd, testTime4JD);
-        return 4;
-    }
-
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeToISO(void)
-{
-    psTime*    time    = NULL;
-    char*      timeStr = NULL;
-
-    // Attempt to convert with NULL time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL time");
-    timeStr = psTimeToISO(time);
-    if(timeStr != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 1;
-    }
-
-    // Attempt to convert invalid time
-    time = psTimeAlloc(PS_TIME_UTC);
-    time->sec = 1;
-    time->nsec = 2e9;
-    time->leapsecond = false;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    timeStr = psTimeToISO(time);
-    if( timeStr != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid time");
-        return 2;
-    }
-
-    // Verify return NULL for time prior to year 0000
-    time->sec = testTime5SecondsUTC;
-    time->nsec = testTime5NanosecondsUTC;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for time prior year 0000");
-    timeStr = psTimeToISO(time);
-    if(timeStr != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for time prior to year 0000");
-        return 3;
-    }
-
-    // Verify return NULL for time after to year 9999
-    time->sec = testTime6SecondsUTC;
-    time->nsec = testTime6NanosecondsUTC;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for time after year 9999");
-    timeStr = psTimeToISO(time);
-    if(timeStr != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for time after to year 9999");
-        return 4;
-    }
-
-    // Verify return string with valid time
-    time->sec = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    timeStr = psTimeToISO(time);
-    if(strcmp(timeStr,testTime1Str) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"String %s not as expected %s",
-                timeStr, testTime1Str);
-        return 5;
-    }
-    psFree(timeStr);
-
-    // Verify return string with valid time and leap second set
-    time->sec = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    time->leapsecond = true;
-    timeStr = psTimeToISO(time);
-    if(strcmp(timeStr,testTime1StrLeap) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"String %s not as expected %s",
-                timeStr, testTime1StrLeap);
-        return 6;
-    }
-    psFree(timeStr);
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeToTimeval(void)
-{
-    psTime*           time         = NULL;
-    struct timeval*   timevalTime  = NULL;
-
-    // Attempt to convert with NULL time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL time");
-    timevalTime = psTimeToTimeval(time);
-    if(timevalTime != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 1;
-    }
-
-    // Attempt to convert invalid time
-    time = psTimeAlloc(PS_TIME_UTC);
-    time->sec = 1;
-    time->nsec = 2e9;
-    time->leapsecond = false;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    timevalTime = psTimeToTimeval(time);
-    if( timevalTime != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid time");
-        return 2;
-    }
-
-    // Attempt to convert invalid time
-    time->sec = -1;
-    time->nsec = 0;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    timevalTime = psTimeToTimeval(time);
-    if( timevalTime != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid time");
-        return 2;
-    }
-
-    // Verify convert to timeval with valid time
-    time->sec = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    timevalTime = psTimeToTimeval(time);
-    if(timevalTime->tv_sec != testTime1TimevalSec) {
-        psError(PS_ERR_UNKNOWN,true,"Timeval seconds %ld not as expectd %ld",
-                timevalTime->tv_sec,testTime1TimevalSec);
-        return 4;
-    }
-    if(timevalTime->tv_usec != testTime1TimevalUsec) {
-        psError(PS_ERR_UNKNOWN,true,"Timeval useconds %ld not as expected %ld",
-                timevalTime->tv_usec,testTime1TimevalUsec);
-        return 5;
-    }
-
-    psFree(timevalTime);
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeFromMJD(void)
-{
-    psTime*   time = NULL;
-
-    // Attempt to convert valid time to psTime
-    time = psTimeFromMJD(testTime1MJDTAI);
-    if(time->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Type %d not as expected %d",
-                time->type,PS_TIME_TAI);
-        return 1;
-    }
-    if(time->sec != testTime1SecondsTAI) {
-        psError(PS_ERR_UNKNOWN,true,"psTime seconds %ld not as expected %ld",
-                (long int)time->sec,testTime1SecondsTAI);
-        return 2;
-    }
-    psFree(time);
-
-    // Attempt to convert valid time before 1970 epoch
-    time = psTimeFromMJD(testTime4MJD);
-    if(time->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Type %d not as expected %d",
-                time->type,PS_TIME_TAI);
-        return 3;
-    }
-    if(time->sec != testTime4SecondsUTC) {
-        psError(PS_ERR_UNKNOWN,true,"psTime seconds %ld not as expected %ld",
-                (long int)time->sec,testTime4SecondsUTC);
-        return 4;
-    }
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeFromJD(void)
-{
-    psTime*   time = NULL;
-
-    // Attempt to convert valid time to psTime
-    time = psTimeFromJD(testTime1JDTAI);
-    if(time->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Type %d not as expected %d",
-                time->type,PS_TIME_TAI);
-        return 1;
-    }
-    if(time->sec != testTime1SecondsTAI) {
-        psError(PS_ERR_UNKNOWN,true,"psTime seconds %ld not as expected %ld",
-                (long int)time->sec,(long int)testTime1SecondsTAI);
-        return 2;
-    }
-    psFree(time);
-
-    // Attempt to convert valid time before 1970 epoch
-    time = psTimeFromJD(testTime4JD);
-    if(time->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Type %d not as expected %d",
-                time->type,PS_TIME_TAI);
-        return 3;
-    }
-    if(time->sec != testTime4SecondsUTC) {
-        psError(PS_ERR_UNKNOWN,true,"psTime seconds %ld not as expected %ld",
-                (long int)time->sec,testTime4SecondsUTC);
-        return 4;
-    }
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeFromISO(void)
-{
-    psTime*   time = NULL;
-
-    // Attempt to convert NULL string
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL ISO string");
-    time = psTimeFromISO(NULL, PS_TIME_TAI);
-    if(time != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected for NULL ISO string");
-        return 1;
-    }
-
-    // Convert valid ISO string
-    time = psTimeFromISO(testTime1Str, PS_TIME_TAI);
-    if(time->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Type %d not as expected %d",
-                time->type, PS_TIME_TAI);
-        return 2;
-    }
-    if(time->sec != testTime1SecondsUTC) {
-        psError(PS_ERR_UNKNOWN,true,"psTime seconds %ld not as expected %ld",
-                (long int)time->sec,testTime1SecondsTAI);
-        return 3;
-    }
-    psFree(time);
-
-    // Attempt to convert invalid ISO string
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for invalid ISO string");
-    time = psTimeFromISO("Here I am", PS_TIME_TAI);
-    if(time != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected for invalid ISO string");
-        return 4;
-    }
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeFromTimeval(void)
-{
-    psTime*          time        = NULL;
-    struct timeval*  timevalTime = NULL;
-
-    // Attempt to create psTime from NULL timeval ptr
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL timeval");
-    time = psTimeFromTimeval(NULL);
-    if(time != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for NULL timeval ptr");
-        return 1;
-    }
-
-    // Convert valid timeval structure
-    timevalTime = (struct timeval*)psAlloc(sizeof(struct timeval));
-    timevalTime->tv_sec = testTime1SecondsTAI;
-    timevalTime->tv_usec = testTime1NanosecondsTAI / 1000;
-    time = psTimeFromTimeval(timevalTime);
-    if(time == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return value for valid timeval");
-        return 2;
-    }
-    if(time->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"psTime type %d not as expected %d",
-                time->type, PS_TIME_TAI);
-        return 3;
-    }
-    if(time->sec != testTime1SecondsTAI) {
-        psError(PS_ERR_UNKNOWN,true,"psTime seconds %ld not as expected %ld",
-                time->sec, testTime1SecondsTAI);
-        return 4;
-    }
-    if(time->nsec != testTime1NanosecondsTAI) {
-        psError(PS_ERR_UNKNOWN,true,"psTime nanosec %ld not as expected %ld",
-                time->nsec, testTime1NanosecondsTAI);
-        return 5;
-    }
-    psFree(timevalTime);
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeFromTM(void)
-{
-    psTime*     time   = NULL;
-    struct tm*  tmTime = NULL;
-
-    // Attempt to convert from NULL tm structure ptr
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL tm ptr");
-    time = psTimeFromTM(tmTime);
-    if(time != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for NULL tm ptr");
-        return 1;
-    }
-
-    // Verify convert for valid tm structure
-    tmTime = (struct tm*)psAlloc(sizeof(struct tm));
-    tmTime->tm_year = testTime7TmYear;
-    tmTime->tm_mon  = testTime7TmMon;
-    tmTime->tm_mday = testTime7TmDay;
-    tmTime->tm_hour = testTime7TmHour;
-    tmTime->tm_min  = testTime7TmMin;
-    tmTime->tm_sec  = testTime7TmSec;
-    time = psTimeFromTM(tmTime);
-    if(time == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return value for valid tm structure");
-        return 2;
-    }
-    if(time->sec != testTime7Seconds) {
-        psError(PS_ERR_UNKNOWN,true,"psTime seconds %ld not as expected %ld",
-                (long int)time->sec, (long int)testTime7Seconds);
-        return 3;
-    }
-    if(time->nsec != testTime7Nanoseconds) {
-        psError(PS_ERR_UNKNOWN,true,"psTime nanoseconds %ld not as expected %ld",
-                time->nsec, testTime7Nanoseconds);
-        return 4;
-    }
-    psFree(tmTime);
-    psFree(time);
-
-    // Verify convert for valid tm structure
-    tmTime = (struct tm*)psAlloc(sizeof(struct tm));
-    tmTime->tm_year = testTime8TmYear;
-    tmTime->tm_mon  = testTime8TmMon;
-    tmTime->tm_mday = testTime8TmDay;
-    tmTime->tm_hour = testTime8TmHour;
-    tmTime->tm_min  = testTime8TmMin;
-    tmTime->tm_sec  = testTime8TmSec;
-    time = psTimeFromTM(tmTime);
-    if(time == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return value for valid tm structure");
-        return 2;
-    }
-    if(time->sec != testTime8Seconds) {
-        psError(PS_ERR_UNKNOWN,true,"psTime seconds %ld not as expected %ld",
-                (long int)time->sec, (long int)testTime8Seconds);
-        return 3;
-    }
-    if(time->nsec != testTime8Nanoseconds) {
-        psError(PS_ERR_UNKNOWN,true,"psTime nanoseconds %ld not as expected %ld",
-                time->nsec, testTime8Nanoseconds);
-        return 4;
-    }
-    psFree(tmTime);
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeConvert(void)
-{
-    psTime*  time1 = NULL;
-    psTime*  time2 = NULL;
-
-    // Attempt to convert NULL time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL time");
-    time2 = psTimeConvert(time1,PS_TIME_TAI);
-    // Verify return value is NULL
-    if(time2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for NULL time specified");
-        return 1;
-    }
-
-    // Attempt to convert to invalid type
-    time1 = psTimeAlloc(PS_TIME_TAI);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid type");
-    time2 = psTimeConvert(time1,-100);
-    // Verify return value is NULL
-    if(time2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for invalid type to convert to");
-        return 2;
-    }
-    time1->type = PS_TIME_UTC;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid type");
-    time2 = psTimeConvert(time1,-100);
-    // Verify return value is NULL
-    if(time2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for invalid type to convert to");
-        return 2;
-    }
-    time1->type = PS_TIME_TT;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid type");
-    time2 = psTimeConvert(time1,-100);
-    // Verify return value is NULL
-    if(time2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for invalid type to convert to");
-        return 2;
-    }
-    time1->type = -100;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid type");
-    time2 = psTimeConvert(time1,PS_TIME_TAI);
-    // Verify return value is NULL
-    if(time2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for invalid type to convert to");
-        return 2;
-    }
-
-    // Attempt to convert with invalid time nsec > 1e9
-    time1->nsec = 2e9;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    time2 = psTimeConvert(time1,PS_TIME_TAI);
-    if(time2 != time1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for invalid time specified");
-        return 3;
-    }
-
-    //Attempt to convert a time to the same type
-    time2 = NULL;
-    time1->sec = 1;
-    time1->nsec = 2;
-    time1->type = PS_TIME_TAI;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_TAI);
-    if(time2 != time1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion to same type");
-        return 4;
-    }
-    // Verify time not changed
-    if((time2->sec != 1) || (time2->nsec != 2) || (time2->type != PS_TIME_TAI) ||
-            (time2->leapsecond != false) ) {
-        psError(PS_ERR_UNKNOWN,true,"Time member changes when no change expected");
-        return 5;
-    }
-
-    // Attempt to convert a UTC time to a TAI
-    time2 = NULL;
-    time1->sec = testTime1SecondsUTC;
-    time1->nsec = testTime1NanosecondsUTC;
-    time1->type = PS_TIME_UTC;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_TAI);
-    if(time2 != time1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from UTC to TAI");
-        return 6;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_TAI);
-        return 7;
-    }
-    // Verify time is TAI as expected
-    if(time2->sec != testTime1SecondsTAI) {
-        psError(PS_ERR_UNKNOWN,true,"TAI seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsTAI);
-        return 7;
-    }
-    if(time2->nsec != testTime1NanosecondsTAI) {
-        psError(PS_ERR_UNKNOWN,true,"TAI nanoseconds = %ld not as expected %ld",(long int)time2->nsec,
-                (long int)testTime1NanosecondsTAI);
-        return 8;
-    }
-
-    // Attempt to convert a UTC time to a TT
-    time2 = NULL;
-    time1->sec = testTime1SecondsUTC;
-    time1->nsec = testTime1NanosecondsUTC;
-    time1->type = PS_TIME_UTC;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_TT);
-    if(time2 != time1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from UTC to TT");
-        return 6;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_TT) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_TT);
-        return 7;
-    }
-    // Verify time is TT as expected
-    if(time2->sec != testTime1SecondsTT) {
-        psError(PS_ERR_UNKNOWN,true,"TT seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsTT);
-        return 7;
-    }
-    if(time2->nsec != testTime1NanosecondsTT) {
-        psError(PS_ERR_UNKNOWN,true,"TT nanoseconds = %ld not as expected %ld",(long int)time2->nsec,
-                (long int)testTime1NanosecondsTT);
-        return 8;
-    }
-
-    // Attempt to convert a UTC time to UT1
-    time2 = NULL;
-    time1->sec = testTime1SecondsUTC;
-    time1->nsec = testTime1NanosecondsUTC;
-    time1->type = PS_TIME_UTC;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_UT1);
-    if(time1 != time2) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from UTC to UT1");
-        return 9;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_UT1) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_UT1);
-        return 7;
-    }
-    // Verify time is UT1 as expected
-    if(time2->sec != testTime1SecondsUT1) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsUT1);
-        return 9;
-    }
-    if(time2->nsec != testTime1NanosecondsUT1) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 nanoseconds = %d not as expected %d",time2->nsec,
-                testTime1NanosecondsUT1);
-        return 10;
-    }
-
-    // Attempt to convert a TAI time to UTC
-    time2 = NULL;
-    time1->sec = testTime1SecondsTAI;
-    time1->nsec = testTime1NanosecondsTAI;
-    time1->type = PS_TIME_TAI;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_UTC);
-    if(time2 != time1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from TAI to UTC");
-        return 11;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_UTC) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_UTC);
-        return 7;
-    }
-    // Verify time is UTC as expected
-    if(time2->sec != testTime1SecondsUTC) {
-        psError(PS_ERR_UNKNOWN,true,"UTC seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsUTC);
-        return 12;
-    }
-    if(time2->nsec != testTime1NanosecondsUTC) {
-        psError(PS_ERR_UNKNOWN,true,"UTC nanoseconds = %ld not as expected %ld",(long int)time2->nsec,
-                (long int)testTime1NanosecondsUTC);
-        return 13;
-    }
-
-    // Attempt to convert a TAI time to TT
-    time2 = NULL;
-    time1->sec = testTime1SecondsTAI;
-    time1->nsec = testTime1NanosecondsTAI;
-    time1->type = PS_TIME_TAI;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_TT);
-    if(time2 != time1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from TAI to TT");
-        return 14;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_TT) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_TT);
-        return 7;
-    }
-    // Verify time is TT as expected
-    if(time2->sec != testTime1SecondsTT) {
-        psError(PS_ERR_UNKNOWN,true,"TT seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsTT);
-        return 15;
-    }
-    if(time2->nsec != testTime1NanosecondsTT) {
-        psError(PS_ERR_UNKNOWN,true,"TT nanoseconds = %ld not as expected %ld",(long int)time2->nsec,
-                (long int)testTime1NanosecondsTT);
-        return 16;
-    }
-
-    // Attempt to convert a TAI time to UT1
-    time2 = NULL;
-    time1->sec = testTime1SecondsTAI;
-    time1->nsec = testTime1NanosecondsTAI;
-    time1->type = PS_TIME_TAI;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_UT1);
-    if(time1 != time2) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from TAI to UT1");
-        return 9;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_UT1) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_UT1);
-        return 7;
-    }
-    // Verify time is UT1 as expected
-    if(time2->sec != testTime1SecondsUT1) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsUT1);
-        return 9;
-    }
-    if(time2->nsec != testTime1NanosecondsUT1) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 nanoseconds = %d not as expected %d",time2->nsec,
-                testTime1NanosecondsUT1);
-        return 10;
-    }
-
-    // Attempt to convert a TT time to UTC
-    time2 = NULL;
-    time1->sec = testTime1SecondsTT;
-    time1->nsec = testTime1NanosecondsTT;
-    time1->type = PS_TIME_TT;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_UTC);
-    if(time2 != time1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from TT to UTC");
-        return 17;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_UTC) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_UTC);
-        return 7;
-    }
-    // Verify time is UTC as expected
-    if(time2->sec != testTime1SecondsUTC) {
-        psError(PS_ERR_UNKNOWN,true,"UTC seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsUTC);
-        return 18;
-    }
-    if(time2->nsec != testTime1NanosecondsUTC) {
-        psError(PS_ERR_UNKNOWN,true,"UTC nanoseconds = %ld not as expected %ld",(long int)time2->nsec,
-                (long int)testTime1NanosecondsUTC);
-        return 19;
-    }
-
-    // Attempt to convert a TT time to TAI
-    time2 = NULL;
-    time1->sec = testTime1SecondsTT;
-    time1->nsec = testTime1NanosecondsTT;
-    time1->type = PS_TIME_TT;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_TAI);
-    if(time2 != time1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from TT to TAI");
-        return 20;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_TAI);
-        return 7;
-    }
-    // Verify time is TAI as expected
-    if(time2->sec != testTime1SecondsTAI) {
-        psError(PS_ERR_UNKNOWN,true,"TAI seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsTAI);
-        return 21;
-    }
-    if(time2->nsec != testTime1NanosecondsTAI) {
-        psError(PS_ERR_UNKNOWN,true,"TT nanoseconds = %ld not as expected %ld",(long int)time2->nsec,
-                (long int)testTime1NanosecondsTAI);
-        return 22;
-    }
-
-    // Attempt to convert a TT time to UT1
-    time2 = NULL;
-    time1->sec = testTime1SecondsTT;
-    time1->nsec = testTime1NanosecondsTT;
-    time1->type = PS_TIME_TT;
-    time1->leapsecond = false;
-    time2 = psTimeConvert(time1,PS_TIME_UT1);
-    if(time1 != time2) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from TT to UT1");
-        return 9;
-    }
-    // Verify time type
-    if(time2->type != PS_TIME_UT1) {
-        psError(PS_ERR_UNKNOWN,true,"Returned time type %d not as expected %d",
-                time2->type, PS_TIME_UT1);
-        return 7;
-    }
-    // Verify time is UT1 as expected
-    if(time2->sec != testTime1SecondsUT1) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 seconds = %ld not as expected %ld",(long int)time2->sec,
-                (long int)testTime1SecondsUT1);
-        return 9;
-    }
-    if(time2->nsec != testTime1NanosecondsUT1) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 nanoseconds = %d not as expected %d",time2->nsec,
-                testTime1NanosecondsUT1);
-        return 10;
-    }
-
-    // Attempt to convert from UT1 to TAI, UTC, TT
-    time2 = NULL;
-    time1->sec = 1;
-    time1->nsec = 2;
-    time1->type = PS_TIME_UT1;
-    time1->leapsecond = false;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message converting from UT1");
-    time2 = psTimeConvert(time1,PS_TIME_UTC);
-    if(time2 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return time for conversion from UT1");
-        return 23;
-    }
-
-    psFree(time1);
-
-    return 0;
-}
-
-//psS32 testTimeOther(void)
-//{
-//    psTime *testTime;
-//    char *testString = "2004-07-21T18:22:24.272Z";
-//
-//    psLibInit("pslib.config");
-//
-// Test time was taken at July 21, 2004 at 18:22:24.272044
-//    testTime = (psTime*)psAlloc(sizeof(psTime));
-//    testTime->sec = 1090434144;
-//    testTime->nsec = 272044000;
-//    testTime->type = PS_TIME_TAI;
-
-// Test O - psTime to LMST
-//    printPositiveTestHeader(stdout, "psTime", "Convert psTime time to LST");
-//    char *testString2 = "2004-09-10T1:00:00.00Z";
-//    psTime* testTime2 = NULL;
-//    testTime2 = psTimeFromISO(testString2);
-//    double dblTime = psTimeToLMST(testTime2, 1);
-//    printf("LST (rad): %lf\n", dblTime);
-//    psFree(testTime2);
-//    printFooter(stdout, "psTime", "Convert psTime time to LST", true);
-
-
-//    return 0;
-//}
Index: trunk/psLib/test/astro/tst_psTime_02.c
===================================================================
--- trunk/psLib/test/astro/tst_psTime_02.c	(revision 24303)
+++ 	(revision )
@@ -1,368 +1,0 @@
-/** @file  tst_psTime_02.c
- *
- *  @brief Test driver for psTime functions
- *
- *  This test driver contains the following tests for psTime:
- *     1) Convert psTime to Local Mean Sidereal Time (LMST)
- *     2) Calculate leap second delta between times
- *     3) Creation of psTime of type TT
- *     4) Creation of psTime of type UTC
- *
- *  @author  Ross Harman, MHPCC
- *  @author  Eric Van Alst, MHPCC
- *
- *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-01-31 23:24:21 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib_strict.h"
-#include "psTest.h"
-
-#define ERROR_TOL  0.001
-
-static psS32 testTimeLMST(void);
-static psS32 testTimeLeapSecondDelta(void);
-static psS32 testTimeIsLeapSecond(void);
-static psS32 testTimeFromTT(void);
-static psS32 testTimeFromUTC(void);
-
-// Test Time 1 : May 9, 2005  00:00:00,0
-//               MJD = 53499.000
-//               JD = 2453499.5
-// UTC Test Time 1
-const psS64 testTime1SecondsUTC     = 1115596900;
-const psU32 testTime1NanosecondsUTC = 0;
-// Expected LMST  15:09:18
-const psF64 testTime1LMST0          = 3.967604;
-
-// Test Time 2 : May 9, 1995 00:00:00,0
-//               MJD = 49846.00
-//               JD = 2449846.5
-// UTC Test Time 2
-const psS64 testTime2SecondsUTC     = 799977600;
-const psU32 testTime2NanosecondsUTC = 0;
-// Expected leap second delta
-const psS64 testTimeLeapSecondDelta1 = 3;
-
-// Test Time 3: Jan 1, 1999 00:00:00,0
-//              MJD = 51179
-//              JD = 2451179.5
-const psS64 testTime3SecondsUTC     = 915148800;
-const psU32 testTime3NanosecondsUTC = 0;
-
-testDescription tests[] = {
-                              {testTimeLMST,1,"psTimeToLMST",0,false},
-                              {testTimeLeapSecondDelta,2,"psTimeLeapSecondDelta",0,false},
-                              {testTimeIsLeapSecond,6,"psTimeIsLeapSecond",0,false},
-                              {testTimeFromTT,66,"psTimeFromTT",0,false},
-                              {testTimeFromUTC,666,"psTimeFromUTC",0,false},
-                              {NULL}
-                          };
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    // Initialize library internal structures
-    psLibInit("pslib.config");
-
-    if( !runTestSuite(stderr,"psTime",tests,argc,argv)) {
-        return 1;
-    }
-
-    // Clean up library
-    psLibFinalize();
-
-    return 0;
-}
-
-psS32 testTimeLMST(void)
-{
-    psTime*       time      = NULL;
-    psF64         lmst      = 0.0;
-
-    // Attempt to get LMST with NULL time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL time");
-    lmst = psTimeToLMST(time,0);
-    if(!isnan(lmst)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NaN as expected %lf",lmst);
-        return 1;
-    }
-
-    // Attempt to get LMST with valid test time
-    // Allocate test time
-    time = psTimeAlloc(PS_TIME_UTC);
-    time->sec = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    time->leapsecond = false;
-    lmst = psTimeToLMST(time,0.0);
-    if(fabs(lmst-testTime1LMST0) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"LMST %lf not as expected %lf",lmst,testTime1LMST0);
-        return 2;
-    }
-
-    // Attempt to get LMST with invalid input time UT1
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for incorrect type");
-    time->type = PS_TIME_UT1;
-    lmst = psTimeToLMST(time,0.0);
-    if(!isnan(lmst)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NaN as expected %lf",lmst);
-        return 3;
-    }
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeLeapSecondDelta(void)
-{
-    psTime*       time1   = NULL;
-    psTime*       time2   = NULL;
-    psS64         delta   = 0;
-
-    // Attempt to get delta with NULL time1 argument
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL time");
-    delta = psTimeLeapSecondDelta(time1,time2);
-    if(delta != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Delta of %ld not as expected 0",(long int)delta);
-        return 1;
-    }
-
-    // Set test time 1
-    time1 = psTimeAlloc(PS_TIME_UTC);
-    time1->sec = testTime1SecondsUTC;
-    time1->nsec = testTime1NanosecondsUTC;
-    time1->leapsecond = false;
-
-    // Attempt to get delta with NULL time2 argument
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL time");
-    delta = psTimeLeapSecondDelta(time1,time2);
-    if(delta != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Delta of %ld not as expected 0",(long int)delta);
-        return 2;
-    }
-
-    // Set test time 2 with invalid time
-    time2 = psTimeAlloc(PS_TIME_UTC);
-    time2->sec = 0;
-    time2->nsec = 2e9;
-    time2->leapsecond = false;
-
-    // Attempt to get delta with invalid time2
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    delta = psTimeLeapSecondDelta(time1,time2);
-    if(delta != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Delta of %ld not as expected 0",(long int)delta);
-        return 3;
-    }
-
-    // Set test time 2 valid
-    time2->sec = testTime2SecondsUTC;
-    time2->nsec = testTime2NanosecondsUTC;
-
-    // Set test time 1 invalid
-    time1->sec = 0;
-    time1->nsec = 2e9;
-
-    // Attempt to get delta with invalid time1
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    delta = psTimeLeapSecondDelta(time1,time2);
-    if(delta != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Delta of %ld not as expected 0",(long int)delta);
-        return 4;
-    }
-
-    // Set test time 1 to greater time
-    time1->sec = testTime1SecondsUTC;
-    time1->nsec = testTime1NanosecondsUTC;
-    delta = psTimeLeapSecondDelta(time1,time2);
-    if(delta != testTimeLeapSecondDelta1) {
-        psError(PS_ERR_UNKNOWN,true,"Delta %ld not as expected %ld",
-                (long int)delta,(long int)testTimeLeapSecondDelta1);
-        return 5;
-    }
-
-    // Set test time 1 to lesser time
-    delta = psTimeLeapSecondDelta(time2,time1);
-    if(delta != testTimeLeapSecondDelta1) {
-        psError(PS_ERR_UNKNOWN,true,"Delta %ld not as expected %ld",
-                (long int)delta,(long int)testTimeLeapSecondDelta1);
-        return 6;
-    }
-
-    // Attempt to get delta with times equal
-    delta = psTimeLeapSecondDelta(time1,time1);
-    if(delta != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Delta %ld not as expected 0",(long int)delta);
-        return 7;
-    }
-
-    psFree(time2);
-    psFree(time1);
-
-    return 0;
-}
-
-psS32 testTimeIsLeapSecond(void)
-{
-    psTime*     time        = NULL;
-    psBool      leapsecond  = false;
-
-    // Attempt to determine if leap second with NULL time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL time");
-    leapsecond = psTimeIsLeapSecond(time);
-    if(leapsecond) {
-        psError(PS_ERR_UNKNOWN,true,"Leapsecond flag %d not as expected 0",leapsecond);
-        return 1;
-    }
-
-    // Set time
-    time = psTimeAlloc(PS_TIME_TAI);
-    time->sec = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    time->leapsecond = false;
-
-    // Attempt to determine if leap second with non-UTC time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid type");
-    leapsecond = psTimeIsLeapSecond(time);
-    if(leapsecond) {
-        psError(PS_ERR_UNKNOWN,true,"Leapsecond flag %d not as expected 0",leapsecond);
-        return 2;
-    }
-
-    // Set time to UTC
-    time->type = PS_TIME_UTC;
-
-    // Attempt to determine if leap second with valid time
-    leapsecond = psTimeIsLeapSecond(time);
-    if(leapsecond) {
-        psError(PS_ERR_UNKNOWN,true,"Leapsecond flag %d not a expected 0",leapsecond);
-        return 3;
-    }
-
-    // Set time to UTC with leap second
-    time->sec = testTime3SecondsUTC;
-    time->nsec = testTime3NanosecondsUTC;
-    leapsecond = psTimeIsLeapSecond(time);
-    if(!leapsecond) {
-        psError(PS_ERR_UNKNOWN,true,"Leapsecond flag %d not as expected 1",leapsecond);
-        //        return 4;
-    }
-
-    // Set time to 1 second before a known leap second
-    time->sec--;
-    leapsecond = psTimeIsLeapSecond(time);
-    if(leapsecond) {
-        psError(PS_ERR_UNKNOWN,true,"Leapsecond flag %d not as expected 0",leapsecond);
-        return 5;
-    }
-
-    // Set time to 1 second after a known leap second
-    time->sec +=2;
-    leapsecond = psTimeIsLeapSecond(time);
-    if(leapsecond) {
-        psError(PS_ERR_UNKNOWN,true,"Leapsecond flag %d not as expected 0",leapsecond);
-        return 6;
-    }
-
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeFromTT(void)
-{
-    psTime*       time = NULL;
-
-    // Attempt to create psTime with invalid time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    time = psTimeFromTT(0,2e9);
-    if(time != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 1;
-    }
-
-    // Attempt to create psTime with valid time
-    time = psTimeFromTT(testTime1SecondsUTC,testTime1NanosecondsUTC);
-    if(time == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL when not expected");
-        return 2;
-    }
-    if(time->type != PS_TIME_TT) {
-        psError(PS_ERR_UNKNOWN,true,"Type of time object %d not as expected %d",
-                time->type,PS_TIME_TT);
-        return 3;
-    }
-    if((time->sec != testTime1SecondsUTC) || (time->nsec != testTime1NanosecondsUTC)) {
-        psError(PS_ERR_UNKNOWN,true,"Seconds %ld nanoseconds %d not as expected seconds %ld nanoseconds %d",
-                (long int)time->sec,time->nsec,(long int)testTime1SecondsUTC,testTime1NanosecondsUTC);
-        return 4;
-    }
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeFromUTC(void)
-{
-    psTime*       time = NULL;
-
-    // Attempt to create psTime with invalid time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid time");
-    time = psTimeFromUTC(0,2e9,true);
-    if(time != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected");
-        return 1;
-    }
-
-    // Attempt to create psTime with valid non-leapsecond time and leapsecond flag true
-    time = psTimeFromUTC(testTime1SecondsUTC,testTime1NanosecondsUTC,true);
-    if(time == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL when not expected");
-        return 2;
-    }
-    if(time->type != PS_TIME_UTC) {
-        psError(PS_ERR_UNKNOWN,true,"Type of time object %d not as expected %d",
-                time->type,PS_TIME_UTC);
-        return 3;
-    }
-    if((time->sec != testTime1SecondsUTC) || (time->nsec != testTime1NanosecondsUTC)) {
-        psError(PS_ERR_UNKNOWN,true,"Seconds %ld nanoseconds %d not as expected seconds %ld nanoseconds %d",
-                (long int)time->sec,time->nsec,(long int)testTime1SecondsUTC,testTime1NanosecondsUTC);
-        return 4;
-    }
-    if(time->leapsecond) {
-        psError(PS_ERR_UNKNOWN,true,"Leapsecond flag %d not as expected 0",time->leapsecond);
-        return 5;
-    }
-    psFree(time);
-
-    // Attempt to create psTime with valid leapsecond time but leapsecond flag false
-    time = psTimeFromUTC(testTime3SecondsUTC,testTime3NanosecondsUTC,false);
-    if(time == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL when not expected");
-        return 6;
-    }
-    if(time->type != PS_TIME_UTC) {
-        psError(PS_ERR_UNKNOWN,true,"Type of time object %d not as expected %d",
-                time->type,PS_TIME_UTC);
-        return 7;
-    }
-    if((time->sec != testTime3SecondsUTC) || (time->nsec != testTime3NanosecondsUTC)) {
-        psError(PS_ERR_UNKNOWN,true,"Seconds %ld nanoseconds %d not as expected seconds %ld nanoseconds %d",
-                (long int)time->sec,time->nsec,(long int)testTime1SecondsUTC,testTime1NanosecondsUTC);
-        return 8;
-    }
-    if(!time->leapsecond) {
-        psError(PS_ERR_UNKNOWN,true,"Leapsecond flag %d not as expected 1",time->leapsecond);
-        return 9;
-    }
-
-
-    psFree(time);
-
-    return 0;
-}
-
Index: trunk/psLib/test/astro/tst_psTime_03.c
===================================================================
--- trunk/psLib/test/astro/tst_psTime_03.c	(revision 24303)
+++ 	(revision )
@@ -1,505 +1,0 @@
-/** @file  tst_psTime_03.c
- *
- *  @brief Test driver for psTime functions
- *
- *  This test driver contains the following tests for psTime:
- *   1) psTimeMath invalid times
- *   2) psTimeMath valid time of different types
- *   3) psTimeDelta valid times with different types
- *
- *  @author  Ross Harman, MHPCC
- *  @author  Eric Van Alst, MHPCC
- *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-06-27 20:33:22 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib_strict.h"
-#include "psTest.h"
-#include <string.h>
-
-#define ERROR_TOL    0.001
-
-static psS32 testTimeMath(void);
-static psS32 testTimeDelta(void);
-static psS32 testTimeConvert1(void);
-
-// Test Time 1 : May 9, 2005 00:00:00,0
-//               MJD = 53499.00
-//               JD = 2453499.5
-// UTC Test Time 1
-const psS64 testTime1SecondsUTC         = 1115596900;
-const psU32 testTime1NanosecondsUTC     = 0;
-// TAI Test Time 1
-const psS64 testTime1SecondsTAI         = 1115596932;
-const psU32 testTime1NanosecondsTAI     = 0;
-// TT Test Time 1
-const psS64 testTime1SecondsTT          = 1115596964;
-const psU32 testTime1NanosecondsTT      = 184000000;
-// UT1 Test Time 1
-const psS64 testTime1SecondsUT1         = 1115596900;
-const psU32 testTime1NanosecondsUT1     = 184000000;
-// Delta 1
-const psF64 deltaTime1                  = -15.5;
-// Expected UTC Time 1
-const psS64 newTestTime1SecondsUTC      = 1115596884;
-const psU32 newTestTime1NanosecondsUTC  = 500000000;
-// Expected TAI Time 1
-const psS64 newTestTime1SecondsTAI      = 1115596916;
-const psU32 newTestTime1NanosecondsTAI  = 500000000;
-// Delta 2
-const psF64 deltaTime2                  = 123.066;
-// Expected TT Time 1 w/ delta 2
-const psS64 newTestTime1SecondsTT       = 1115597087;
-const psU32 newTestTime1NanosecondsTT   = 250000000;
-// Expected UT1 Time 1 w/ delta 2
-const psS64 newTestTime1SecondsUT1      = 1115597023;
-const psU32 newTestTime1NanosecondsUT1  = 250000000;
-
-// Test Time 2 : Dec. 31 1998 23:59:45,0
-//               MJD = 51178.99983
-//               JD = 2451179.49983
-// UTC Test Time 1
-const psS64 testTime2SecondsUTC         = 915148785;
-const psU32 testTime2NanosecondsUTC     = 0;
-// Delta 3
-const psF64 deltaTime3                    = 30.0;
-// Expected UTC Time
-const psS64 newTestTime2SecondsUTC      = 915148814;
-const psU32 newTestTime2NanosecondsUTC  = 0;
-
-// Appendix B time conversion tests
-//
-#define APPB_TESTS    8
-const psS64 testTimeBSeconds[APPB_TESTS] =
-    {
-        915148829,
-        915148829,
-        915148830,
-        915148830,
-        915148831,
-        915148831,
-        915148832,
-        915148832
-    };
-const psU32 testTimeBNanoseconds[APPB_TESTS] =
-    {
-        0,
-        500000000,
-        0,
-        500000000,
-        0,
-        500000000,
-        0,
-        500000000
-    };
-const psBool testTimeBLeapsecond[APPB_TESTS] =
-    {
-        false,
-        false,
-        false,
-        false,
-        true,
-        true,
-        false,
-        false
-    };
-// Expected results
-const char* testTimeBStrUTC[APPB_TESTS] =
-    {
-        "1998-12-31T23:59:58.0Z",
-        "1998-12-31T23:59:58.5Z",
-        "1998-12-31T23:59:59.0Z",
-        "1998-12-31T23:59:59.5Z",
-        "1998-12-31T23:59:60.0Z",
-        "1998-12-31T23:59:60.5Z",
-        "1999-01-01T00:00:00.0Z",
-        "1999-01-01T00:00:00.5Z"
-    };
-const char* testTimeBStrTAI[APPB_TESTS] =
-    {
-        "1999-01-01T00:00:29.0Z",
-        "1999-01-01T00:00:29.5Z",
-        "1999-01-01T00:00:30.0Z",
-        "1999-01-01T00:00:30.5Z",
-        "1999-01-01T00:00:31.0Z",
-        "1999-01-01T00:00:31.5Z",
-        "1999-01-01T00:00:32.0Z",
-        "1999-01-01T00:00:32.5Z"
-    };
-const char* testTimeBStrTT[APPB_TESTS] =
-    {
-        "1999-01-01T00:01:01.1Z",
-        "1999-01-01T00:01:01.6Z",
-        "1999-01-01T00:01:02.1Z",
-        "1999-01-01T00:01:02.6Z",
-        "1999-01-01T00:01:03.1Z",
-        "1999-01-01T00:01:03.6Z",
-        "1999-01-01T00:01:04.1Z",
-        "1999-01-01T00:01:04.6Z"
-    };
-const char* testTimeBStrUT1[APPB_TESTS] =
-    {
-        "1998-12-31T23:59:58.7Z",
-        "1998-12-31T23:59:59.2Z",
-        "1998-12-31T23:59:59.7Z",
-        "1998-12-31T23:59:60.2Z",
-        "1998-12-31T23:59:60.7Z",
-        "1999-01-01T00:00:00.2Z",
-        "1999-01-01T00:00:00.7Z",
-        "1999-01-01T00:00:01.2Z"
-    };
-
-// Test Time B1 : Dec 31, 1998 23:59:58,0
-//                MJD = 51178.99998
-//                JD = 2451179.49998
-//const psS64 testTimeB1SecondsUTC        = 915148798;
-//const psU32 testTimeB1NanosecondsUTC    = 0;
-// Expected ISO times
-//const char testTimeB1StrUTC[] = "1998-12-31T23:59:58,0Z";
-//const char testTimeB1StrTAI[] = "1999-01-01T00:00:29,0Z";
-//const char testTimeB1StrTT[]  = "1999-01-01T00:01:01,1Z";
-//const char testTimeB1StrUT1[] = "1998-12-31T23:59:57,7Z";
-//
-// Test Time B2 : Dec 31, 1998 23:59:58,5
-//
-//
-//const psS64 testTimeB2SecondsUTC       = 915148798;
-//const psU32 testTimeB2NanosecondsUTC   = 500000000;
-// Expected ISO times
-//const char testTimeB2StrUTC[] = "1998-12-31T23:59:58,5Z";
-//const char testTimeB2StrTAI[] = "1991-01-01T00:00:29,5Z";
-//const char testTimeB2StrTT[]  = "1999-01-01T00:01:01,6Z";
-//const char testTimeB2StrUT1[] = "1998-12-31T23:59:58,2Z";
-
-testDescription tests[] = {
-                              {testTimeMath,1,"psTimeMath",0,false},
-                              {testTimeDelta,2,"psTimeDelta",0,false},
-                              {testTimeConvert1,666,"psTimeConvert",0,false},
-                              {NULL}
-                          };
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    // Initialize library internal structures
-    psLibInit("pslib.config");
-
-    if( !runTestSuite(stderr,"psTime",tests,argc,argv)) {
-        return 1;
-    }
-
-    // Clean up library
-    psLibFinalize();
-
-    return 0;
-}
-
-psS32 testTimeMath(void)
-{
-    psTime*     time      = NULL;
-    psTime*     newTime   = NULL;
-
-    // Attempt to perform math operation on NULL time
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL time");
-    if(psTimeMath(time,-1.1) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for NULL time");
-        return 1;
-    }
-
-    // Set up input time with invalid nanoseconds
-    time = psTimeAlloc(PS_TIME_UTC);
-    time->sec = 0;
-    time->nsec = 2e9;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid time");
-    if(psTimeMath(time,-1.1) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid time");
-        return 2;
-    }
-
-    // Set up input time with valid time
-    time->sec = testTime1SecondsUTC;
-    time->nsec = testTime1NanosecondsUTC;
-    newTime = psTimeMath(time,deltaTime1);
-    if(newTime == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return");
-        return 3;
-    }
-    if(newTime->type != PS_TIME_UTC) {
-        psError(PS_ERR_UNKNOWN,true,"New time type %d not as expected %d",
-                newTime->type,PS_TIME_UTC);
-        return 4;
-    }
-    if((newTime->sec != newTestTime1SecondsUTC) || (newTime->nsec != newTestTime1NanosecondsUTC)) {
-        psError(PS_ERR_UNKNOWN,true,"UTC sec %ld nsec %d not as expected sec %ld nsec %d",
-                (long int)newTime->sec,newTime->nsec,(long int)newTestTime1SecondsUTC,
-                newTestTime1NanosecondsUTC);
-        return 5;
-    }
-    psFree(newTime);
-
-    // Set up input time with valid TAI time
-    time->sec = testTime1SecondsTAI;
-    time->nsec = testTime1NanosecondsTAI;
-    time->type = PS_TIME_TAI;
-    newTime = psTimeMath(time,deltaTime1);
-    if(newTime == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return");
-        return 3;
-    }
-    if(newTime->type != PS_TIME_TAI) {
-        psError(PS_ERR_UNKNOWN,true,"New time type %d not as expected %d",
-                newTime->type,PS_TIME_TAI);
-        return 4;
-    }
-    if((newTime->sec != newTestTime1SecondsTAI) || (newTime->nsec != newTestTime1NanosecondsTAI)) {
-        psError(PS_ERR_UNKNOWN,true,"TAI sec %ld nsec %d not as expected sec %ld nsec %d",
-                (long int)newTime->sec,newTime->nsec,(long int)newTestTime1SecondsTAI,
-                newTestTime1NanosecondsTAI);
-        return 5;
-    }
-    psFree(newTime);
-
-    // Set up input time with valid TT time
-    time->sec = testTime1SecondsTT;
-    time->nsec = testTime1NanosecondsTT;
-    time->type = PS_TIME_TT;
-    newTime = psTimeMath(time,deltaTime2);
-    if(newTime == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return");
-        return 3;
-    }
-    if(newTime->type != PS_TIME_TT) {
-        psError(PS_ERR_UNKNOWN,true,"New time type %d not as expected %d",
-                newTime->type,PS_TIME_TT);
-        return 4;
-    }
-    if((newTime->sec != newTestTime1SecondsTT) || (newTime->nsec != newTestTime1NanosecondsTT)) {
-        psError(PS_ERR_UNKNOWN,true,"TT sec %ld nsec %d not as expected sec %ld nsec %d",
-                (long int)newTime->sec,newTime->nsec,(long int)newTestTime1SecondsTT,
-                newTestTime1NanosecondsTT);
-        return 5;
-    }
-    psFree(newTime);
-
-    // Set up input time with valid TT time
-    time->sec = testTime1SecondsUT1;
-    time->nsec = testTime1NanosecondsUT1;
-    time->type = PS_TIME_UT1;
-    newTime = psTimeMath(time,deltaTime2);
-    if(newTime == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return");
-        return 3;
-    }
-    if(newTime->type != PS_TIME_UT1) {
-        psError(PS_ERR_UNKNOWN,true,"New time type %d not as expected %d",
-                newTime->type,PS_TIME_UT1);
-        return 4;
-    }
-    if((newTime->sec != newTestTime1SecondsUT1) || (newTime->nsec != newTestTime1NanosecondsUT1)) {
-        psError(PS_ERR_UNKNOWN,true,"UT1 sec %ld nsec %d not as expected sec %ld nsec %d",
-                (long int)newTime->sec,newTime->nsec,(long int)newTestTime1SecondsUT1,
-                newTestTime1NanosecondsUT1);
-        return 5;
-    }
-    psFree(newTime);
-
-    // Set up input time with valid UTC time and delt which crosses leap second
-    time->sec = testTime2SecondsUTC;
-    time->nsec = testTime2NanosecondsUTC;
-    time->type = PS_TIME_UTC;
-    newTime = psTimeMath(time,deltaTime3);
-    if(newTime == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return");
-        return 3;
-    }
-    if(newTime->type != PS_TIME_UTC) {
-        psError(PS_ERR_UNKNOWN,true,"New time type %d not as expected %d",
-                newTime->type,PS_TIME_UTC);
-        return 4;
-    }
-    if((newTime->sec != newTestTime2SecondsUTC) || (newTime->nsec != newTestTime2NanosecondsUTC)) {
-        psError(PS_ERR_UNKNOWN,true,"UTC sec %ld nsec %d not as expected sec %ld nsec %d",
-                (long int)newTime->sec,newTime->nsec,(long int)newTestTime2SecondsUTC,
-                newTestTime2NanosecondsUTC);
-        return 5;
-    }
-    psFree(newTime);
-
-    psFree(time);
-
-    return 0;
-}
-
-psS32 testTimeDelta(void)
-{
-    psTime*   time1   = NULL;
-    psTime*   time2   = NULL;
-    psF64     delta   = 0.0;
-
-    // Attempt to get delta with time1 NULL
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL time");
-    delta = psTimeDelta(time1,time2);
-    if(fabs(delta-0.0) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return 0 for NULL time argument");
-        return 1;
-    }
-
-    // Set time 1
-    time1 = psTimeAlloc(PS_TIME_UTC);
-
-    // Attempt to get delta with time2 NULL
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL time");
-    delta = psTimeDelta(time1,time2);
-    if(fabs(delta-0.0) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return 0 for NULL time argument");
-        return 2;
-    }
-
-    // Set time 2
-    time2 = psTimeAlloc(PS_TIME_UTC);
-
-    // Set time1 invalid
-    time1->sec = 0;
-    time1->nsec = 2e9;
-    // Attempt to get delta with time1 invalid
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid time");
-    delta = psTimeDelta(time1,time2);
-    if(fabs(delta-0.0) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return 0 for invalid time argument");
-        return 3;
-    }
-
-    // Set time 1 valid
-    time1->sec = testTime1SecondsUTC;
-    time1->nsec = testTime1NanosecondsUTC;
-
-    // Set time 2 invalid
-    time2->sec = 0;
-    time2->nsec = 2e9;
-    // Attempt to get delta with time2 invalid
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid time");
-    delta = psTimeDelta(time1,time2);
-    if(fabs(delta-0.0) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return 0 for invalid time argument");
-        return 4;
-    }
-
-    // Set time 2 valid but different type
-    time2->sec = newTestTime1SecondsUTC;
-    time2->nsec = newTestTime1NanosecondsUTC;
-    time2->type = PS_TIME_TAI;
-    // Attempt to get delta with different time types
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for incorrect type");
-    delta = psTimeDelta(time1,time2);
-    if(fabs(delta-0.0) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return 0 for invalid time argument");
-        return 5;
-    }
-
-    // Set time 2 to same as time 1
-    time2->type = PS_TIME_UTC;
-    // Attempt to get delta with valid times of the same type
-    delta = psTimeDelta(time2,time1);
-    if(fabs(delta-deltaTime1) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Delta %lf not as expected %lf",
-                delta,deltaTime1);
-        return 6;
-    }
-
-    // Set time 1 and 2 as different times with same type
-    time1->sec = testTime1SecondsTT;
-    time1->nsec = testTime1NanosecondsTT;
-    time1->type = PS_TIME_TT;
-    time2->sec = newTestTime1SecondsTT;
-    time2->nsec = newTestTime1NanosecondsTT;
-    time2->type = PS_TIME_TT;
-    // Attempt to get delta with valid times of the same type
-    delta = psTimeDelta(time2,time1);
-    if(fabs(delta-deltaTime2) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Delta %lf not as expected %lf",
-                delta,deltaTime2);
-        return 7;
-    }
-
-    // Set time 1 and 2 as different times with same type
-    time1->sec = testTime2SecondsUTC;
-    time1->nsec = testTime2NanosecondsUTC;
-    time1->type = PS_TIME_UTC;
-    time2->sec = newTestTime2SecondsUTC;
-    time2->nsec = newTestTime2NanosecondsUTC;
-    time2->type = PS_TIME_UTC;
-    // Attempt to get delta with valid times of the same type
-    delta = psTimeDelta(time2,time1);
-    if(fabs(delta-deltaTime3) > ERROR_TOL) {
-        psError(PS_ERR_UNKNOWN,true,"Delta %lf not as expected %lf",
-                delta,deltaTime3);
-        return 7;
-    }
-
-    psFree(time1);
-    psFree(time2);
-
-    return 0;
-}
-
-psS32 testTimeConvert1(void)
-{
-    psTime*     time    = NULL;
-    char*       timeStr = NULL;
-
-    for(psS32 i = 0; i < APPB_TESTS; i++) {
-
-        // Initialize time for test time B1
-        time = psTimeAlloc(PS_TIME_TAI);
-        time->sec = testTimeBSeconds[i];
-        time->nsec = testTimeBNanoseconds[i];
-
-        // Verify TAI ISO string
-        timeStr = psTimeToISO(time);
-        if(strcmp(timeStr,testTimeBStrTAI[i]) != 0) {
-            psError(PS_ERR_UNKNOWN,true,"TAI ISO string %s not as expected %s",timeStr,testTimeBStrTAI[i]);
-            return i+1;
-        }
-        psFree(timeStr);
-
-        time = psTimeConvert(time,PS_TIME_TT);
-        timeStr = psTimeToISO(time);
-        if(strcmp(timeStr,testTimeBStrTT[i]) != 0) {
-            psError(PS_ERR_UNKNOWN,true,"TT ISO string %s not as expected %s",timeStr,testTimeBStrTT[i]);
-            return i+10;
-        }
-        psFree(timeStr);
-
-        // Verify UTC ISO string
-        time = psTimeConvert(time,PS_TIME_UTC);
-        time->leapsecond = testTimeBLeapsecond[i];
-        timeStr = psTimeToISO(time);
-        if(strcmp(timeStr,testTimeBStrUTC[i]) != 0) {
-            if(strncmp(timeStr,"1999-01-01T00:00:60.0Z", 10) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"UTC ISO string %s not as expected %s",timeStr,testTimeBStrUTC[i]);
-                return i+20;
-            }
-        }
-        psFree(timeStr);
-
-        time = psTimeConvert(time,PS_TIME_UT1);
-        timeStr = psTimeToISO(time);
-        if(strcmp(timeStr,testTimeBStrUT1[i]) != 0) {
-            if(strncmp(timeStr,"1999-01-01T00:00:60.2Z", 10) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"UT1 ISO string %s not as expected %s",timeStr,testTimeBStrUT1[i]);
-                return i+30;
-            }
-        }
-        psFree(timeStr);
-
-        psFree(time);
-    }
-
-    return 0;
-}
-
Index: trunk/psLib/test/astro/tst_psTime_04.c
===================================================================
--- trunk/psLib/test/astro/tst_psTime_04.c	(revision 24303)
+++ 	(revision )
@@ -1,177 +1,0 @@
-/** @file  tst_psTime_04.c
- *
- *  @brief Test driver for psTime functions
- *
- *  This test driver contains the following tests for psTime:
- *      Test A - Initialize time
- *      Test B - Attempt to open non-existant time config file
- *      Test C - Attempt to open non-existant time data files
- *      Test D - Attempt to read incorrect number of files
- *      Test E - Attempt to read incorrect number of from values
- *      Test F - Attempt to read data file with typo in number
- *      Test G - Free data
- *      Test H - Attempt to use all timer functions
- *      Test I - Tidal Corrections to UT1-UTC
- *
- *  @author  Ross Harman, MHPCC
- *  @author  Eric Van Alst, MHPCC
- *  @author  David Robbins, MHPCC
- *
- *  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-01-31 23:24:21 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-#include "config.h"
-
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static psS32 testTimeInit1(void);
-static psS32 testTimeInit2(void);
-static psS32 testTimeInit3(void);
-static psS32 testTimeInit4(void);
-static psS32 testTimeInit5(void);
-static psS32 testTimeInit6(void);
-static psS32 testTimer1(void);
-static psS32 testTideUT1Corr(void);
-
-testDescription tests[] = {
-                              {testTimeInit1,1,"p_psTimeInit",0,false},
-                              {testTimeInit2,2,"p_psTimeInit",0,false},
-                              {testTimeInit3,3,"p_psTimeInit",0,false},
-                              {testTimeInit4,4,"p_psTimeInit",0,false},
-                              {testTimeInit5,5,"p_psTimeInit",0,false},
-                              {testTimeInit6,6,"p_psTimeInit",0,false},
-                              {testTimer1,8,"psTimer",0,false},
-                              {testTideUT1Corr,9,"psTime_TideUT1Corr",0,false},
-                              {NULL}
-                          };
-
-psS32 main(psS32 argc, char* argv[])
-{
-    if(!runTestSuite(stderr,"psTime",tests,argc,argv)) {
-        return 1;
-    }
-
-    return 0;
-}
-
-psS32 testTimeInit1(void)
-{
-    // Test A - Initialize time
-    psLibInit("pslib.config");
-    psLibFinalize();
-
-    return 0;
-}
-
-psS32 testTimeInit2(void)
-{
-    // Test B - Attempt to open non-existant time config file
-    psLibInit("zzz");
-
-    return 0;
-}
-
-psS32 testTimeInit3(void)
-{
-    // Test C - Attempt to open non-existant time data files
-    psLibInit("test.psTime.config1");
-    psLibFinalize();
-
-    return 0;
-}
-
-psS32 testTimeInit4(void)
-{
-    // Test D - Attempt to read incorrect number of files
-    psLibInit("test.psTime.config2");
-    psLibFinalize();
-
-    return 0;
-}
-
-psS32 testTimeInit5(void)
-{
-    // Test E - Attempt to read incorrect number of from values
-    psLibInit("test.psTime.config3");
-    psLibFinalize();
-
-    return 0;
-}
-
-psS32 testTimeInit6(void)
-{
-    // Test F - Attempt to read data file with typo in number
-    psLibInit("test.psTime.config4");
-    psLibFinalize();
-
-    return 0;
-}
-
-psS32 testTimer1(void)
-{
-    psF64 testTime = 0.0;
-    psF64 testTime2 = 0.0;
-    psF64 testTime3 = 0.0;
-
-    if ( !psTimerStart("newTime") ) {
-        printf("TimerStart Failed\n");
-        return 1;
-    }
-    testTime = psTimerMark("newTime");
-    if (testTime == 0.0) {
-        printf("TimerMark Failed\n");
-        return 2;
-    }
-    testTime2 = psTimerClear("newTime");
-    if (testTime2 == 0.0) {
-        printf("TimerClear Failed\n");
-        return 3;
-    }
-    psTimerStart("newTime");
-    testTime3 = psTimerStop();
-    if (testTime3 == 0.0) {
-        printf("TimerStop Failed\n");
-        return 4;
-    }
-    return 0;
-}
-
-psS32 testTideUT1Corr(void)
-{
-    psTime *empty = NULL;
-    psTime *tide = NULL;
-    psTime *noTide = psTimeAlloc(PS_TIME_UTC);
-    noTide->sec = 1049160600;
-    noTide->nsec = 0;
-    noTide->leapsecond = false;
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    empty = psTime_TideUT1Corr(tide);
-    if (empty != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psTime_TideUT1Corr failed to return NULL for NULL input time.\n");
-        return 1;
-    }
-
-    empty = psTime_TideUT1Corr(noTide);
-    if (empty->sec != 1049160599 || empty->nsec != 656981971) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psTime_TideUT1Corr failed to return correct values.\n");
-        printf("\nsec = %ld, nsec = %u\n", (long int)empty->sec, empty->nsec);
-        return 2;
-    }
-
-    if (!p_psTimeFinalize()) {
-        return 3;
-    }
-
-    psFree(empty);
-    psFree(noTide);
-
-    return 0;
-}
-
