Index: /trunk/psLib/test/astronomy/tst_psCoord.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3470)
+++ /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3471)
@@ -6,32 +6,27 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-03-18 21:36:16 $
-*
-*  XXX: Test with a bad offfset unit type in the SphereGet/SetOffset() functions.
+*  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-03-22 01:36:47 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
 */
-#include "config.h"
 
 #include "psTest.h"
 #include "pslib.h"
-static psS32 testSphereTransformAlloc( void );
-static psS32 testPlaneTransformAlloc( void );
-static psS32 testPlaneDistortAlloc( void );
-static psS32 testPlaneTransformApply( void );
-static psS32 testPlaneDistortApply( void );
-static psS32 testSphereTransformApply1( void );
-static psS32 testSphereTransformApply2( void );
-static psS32 testSphereTransformApply3( void );
-static psS32 testSphereTransformApply4( void );
-static psS32 testSphereTransformApply5( void );
-static psS32 testSphereTransformICRSToEcliptic( void );
-static psS32 testSphereTransformEclipticToICRS( void );
-static psS32 testSphereTransformICRSToGalactic( void );
-static psS32 testSphereTransformGalacticToICRS( void );
+static psS32 testSphereTransformAlloc(void);
+static psS32 testPlaneTransformAlloc(void);
+static psS32 testPlaneDistortAlloc(void);
+static psS32 testPlaneTransformApply(void);
+static psS32 testPlaneDistortApply(void);
+static psS32 testSphereTransformApply1(void);
+static psS32 testSphereTransformApply2(void);
+static psS32 testSphereTransformApply3(void);
+static psS32 testSphereTransformApply4(void);
+static psS32 testSphereTransformApply5(void);
+static psS32 testSphereTransformICRSToEcliptic(void);
+static psS32 testSphereTransformEclipticToICRS(void);
+static psS32 testSphereTransformICRSToGalactic(void);
+static psS32 testSphereTransformGalacticToICRS(void);
 static psS32 testSphereTransformPrecess(void);
-static psS32 test40( void );
-static psS32 test41( void );
 testDescription tests[] = {
                               {testSphereTransformAlloc, 819, "psSphereTransformAlloc()", 0, false},
@@ -50,6 +45,4 @@
                               {testSphereTransformGalacticToICRS, 823, "psSphereTransformGalacticToICRS()", 0, false},
                               {testSphereTransformPrecess, 825, "psSphereTransformPrecess()", 0, false},
-                              {test40, 0000, "psSphereGetOffset()", 0, false},
-                              {test41, 0000, "psSphereSetOffset()", 0, false},
                               {NULL}
                           };
@@ -61,4 +54,6 @@
     return ( ! runTestSuite( stderr, "psCoord", tests, argc, argv ) );
 }
+
+#define DEG_INC   30.0
 
 #define MJD_1900  15021.0        // Modified Julian Day 1/1/1900 00:00:00
@@ -67,24 +62,4 @@
 
 #define ERROR_TOL   0.0001
-
-#define MY_TINY 0.0001
-#define PS_COMPARE_TINY_THEN_PRINT_ERROR(ACTUAL, EXPECT, TESTSTATUS) \
-if (MY_TINY < fabs(EXPECT - ACTUAL)) { \
-    printf("ERROR: %s is %f, should be %f (testStatus = %d)\n", #ACTUAL, ACTUAL, EXPECT, TESTSTATUS); \
-    testStatus = TESTSTATUS; \
-}
-#define MY_TINY 0.0001
-#define PS_COMPARE_EPSILON_THEN_PRINT_ERROR(ACTUAL, EXPECT, TESTSTATUS) \
-if (FLT_EPSILON < fabs(EXPECT - ACTUAL)) { \
-    printf("ERROR: %s is %f, should be %f (testStatus = %d)\n", #ACTUAL, ACTUAL, EXPECT, TESTSTATUS); \
-    testStatus = TESTSTATUS; \
-}
-
-#define PS_COT(X) (1.0 / atan(X))
-float p_psArg(float x,
-              float y)
-{
-    return((float) atan2((double) x, (double) y));
-}
 
 #define ALPHA_P 1.0
@@ -465,5 +440,4 @@
 }
 
-#define DEG_INC 30.0
 // We do a simple identity transformation on a few RA, DEC pairs.
 psS32 testSphereTransformApply1( void )
@@ -1379,265 +1353,2 @@
 }
 
-
-psS32 test40( void )
-{
-    psS32 testStatus = 0;
-    psSphere position1;
-    psSphere position2;
-    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 (float r=0.0;r<180.0;r+=DEG_INC) {
-        for (float 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);
-
-            //HEY            /* XXX: This code does not work correctly.
-            //            printf("--------------- (%f, %f) to (%f, %f) is (%f, %f) ---------------\n",
-            //                   position1.r, position1.d, position2.r, position2.d,
-            //                   offset->r, offset->d);
-            //            offset = psSphereGetOffset(&position1, &position2, PS_LINEAR, 0);
-            //            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);
-        }
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereGetOffset() with NULL position1.  Should generate error, return NULL.\n");
-    offset = psSphereGetOffset(NULL, &position2, PS_LINEAR, 0);
-    if (offset != NULL) {
-        printf("TEST ERROR: psSphereGetOffset() did not return NULL.\n");
-        testStatus = false;
-        offset = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereGetOffset() with NULL position2.  Should generate error, return NULL.\n");
-    offset = psSphereGetOffset(&position1, NULL, PS_LINEAR, 0);
-    if (offset != NULL) {
-        printf("TEST ERROR: psSphereGetOffset() did not return NULL.\n");
-        testStatus = false;
-        offset = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereGetOffset() with bogus offset mode.  Should generate error, return NULL.\n");
-    offset = psSphereGetOffset(&position1, &position2, 0x54321, 0);
-    if (offset != NULL) {
-        printf("TEST ERROR: psSphereGetOffset() did not return NULL.\n");
-        testStatus = false;
-        offset = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereGetOffset() with bogus offset units.  Should generate error, return NULL.\n");
-    offset = psSphereGetOffset(&position1, &position2, PS_SPHERICAL, 0x54321);
-    if (offset != NULL) {
-        printf("TEST ERROR: psSphereGetOffset() did not return NULL.\n");
-        testStatus = false;
-        offset = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    return(testStatus);
-}
-
-psS32 test41( void )
-{
-    psS32 testStatus = 0;
-    psSphere position1;
-    psSphere *position2;
-    psSphere offset;
-    psSphere tmpOffset;
-
-    position1.r = DEG_TO_RAD(90.0);
-    position1.d = DEG_TO_RAD(45.0);
-    position1.rErr = 0.0;
-    position1.dErr = 0.0;
-
-    for (float r=0.0;r<180.0;r+=DEG_INC) {
-        for (float 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);
-
-            /* XXX: This code does not work correctly.
-                        position2 = psSphereSetOffset(&position1, &offset,
-                                                       PS_LINEAR, 0);
-                        printf("--------------- (%f, %f) and (%f, %f) is (%f, %f) ---------------\n",
-                                position1.r, position1.d, offset.r, offset.d, 
-                                position2->r, position2->d);
-                        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), 1);
-                        psFree(position2);
-            */
-        }
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereSetOffset() with NULL position1.  Should generate error, return NULL.\n");
-    position2 = psSphereSetOffset(NULL, &offset, PS_LINEAR, 0);
-    if (position2 != NULL) {
-        printf("TEST ERROR: psSphereSetOffset() did not return NULL.\n");
-        testStatus = false;
-        position2 = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereSetOffset() with NULL offset.  Should generate error, return NULL.\n");
-    position2 = psSphereSetOffset(&position1, NULL, PS_LINEAR, 0);
-    if (position2 != NULL) {
-        printf("TEST ERROR: psSphereSetOffset() did not return NULL.\n");
-        testStatus = false;
-        position2 = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereSetOffset() with bogus offset mode.  Should generate error, return NULL.\n");
-    position2 = psSphereSetOffset(&position1, &offset, 0x54321, 0);
-    if (position2 != NULL) {
-        printf("TEST ERROR: psSphereSetOffset() did not return NULL.\n");
-        testStatus = false;
-        position2 = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psSphereSetOffset() with bogus offset unit.  Should generate error, return NULL.\n");
-    position2 = psSphereSetOffset(&position1, &offset, PS_SPHERICAL, 0x54321);
-    if (position2 != NULL) {
-        printf("TEST ERROR: psSphereSetOffset() did not return NULL.\n");
-        testStatus = false;
-        position2 = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    return(testStatus);
-}
-
-/******************************************************************************
-test43(): Not really a test.  We simply project many points and print the
-results.
- *****************************************************************************/
-psS32 test43( void )
-{
-    psS32 testStatus = 0;
-    psSphere projCenter;
-    psSphere startCoords;
-    psPlane *planeCoords;
-
-    projCenter.r = DEG_TO_RAD(33.0);
-    projCenter.d = DEG_TO_RAD(22.0);
-    projCenter.r = 0.0;
-    projCenter.d = 0.0;
-    // Create the psProjection plane:
-    psProjection myProj;
-    myProj.R = projCenter.r;
-    myProj.D = projCenter.d;
-    myProj.Xs = 1.0;
-    myProj.Ys = 1.0;
-    myProj.type = PS_PROJ_TAN;
-
-    printf("    projCenter is (%f, %f)\n", projCenter.r, projCenter.d);
-    for (float r=-90.0;r<90.0;r+=DEG_INC/5.0) {
-        for (float d=-90.0;d<90.0;d+=DEG_INC/5.0) {
-            printf("----------------------------------------------------------\n");
-            printf("Angles (R, D) are (%.2f, %.2f)\n", r, d);
-            startCoords.r = DEG_TO_RAD(r);
-            startCoords.d = DEG_TO_RAD(d);
-
-            planeCoords = psProject(&startCoords, &myProj);
-            printf("    startCoords (R, D) is (%f, %f)\n", startCoords.r, startCoords.d);
-            printf("        plane Coords (X, Y) is (%f, %f)\n", planeCoords->x, planeCoords->y);
-            psFree(planeCoords);
-        }
-    }
-    printf("----------------------------------------------------------\n");
-    return(testStatus);
-}
-
-bool testNonEqualF32(psF32 num1, psF32 num2)
-{
-    if ((fabs(num1) <= FLT_EPSILON) && (fabs(num2) <= FLT_EPSILON)) {
-        return(false);
-    }
-
-    if (fabs((num2 - num1) / num1) <= ERROR_PERCENT) {
-        return(false);
-    }
-    return(true);
-}
-
Index: /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3470)
+++ /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3471)
@@ -226,36 +226,2 @@
 ---> TESTPOINT PASSED (psCoord{psSphereTransformPrecess()} | tst_psCoord.c)
 
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psCoord.c                                              *
-*            TestPoint: psCoord{psSphereGetOffset()}                               *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|E|psSphereGetOffset (FILE:LINENO)
-    Unallowable operation: position1 is NULL.
-<DATE><TIME>|<HOST>|E|psSphereGetOffset (FILE:LINENO)
-    Unallowable operation: position2 is NULL.
-<DATE><TIME>|<HOST>|E|psSphereGetOffset (FILE:LINENO)
-    Specified offset mode, 0x54321, is not supported.
-<DATE><TIME>|<HOST>|E|psSphereGetOffset (FILE:LINENO)
-    Specified units, 0x54321, is not supported.
-
----> TESTPOINT PASSED (psCoord{psSphereGetOffset()} | tst_psCoord.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psCoord.c                                              *
-*            TestPoint: psCoord{psSphereSetOffset()}                               *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|E|psSphereSetOffset (FILE:LINENO)
-    Unallowable operation: position is NULL.
-<DATE><TIME>|<HOST>|E|psSphereSetOffset (FILE:LINENO)
-    Unallowable operation: offset is NULL.
-<DATE><TIME>|<HOST>|E|psSphereSetOffset (FILE:LINENO)
-    Specified offset mode, 0x54321, is not supported.
-<DATE><TIME>|<HOST>|E|psSphereSetOffset (FILE:LINENO)
-    Specified units, 0x54321, is not supported.
-
----> TESTPOINT PASSED (psCoord{psSphereSetOffset()} | tst_psCoord.c)
-
Index: /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout	(revision 3470)
+++ /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout	(revision 3471)
@@ -1,18 +1,0 @@
--------------------------------------------------------------------
-Calling psSphereGetOffset() with NULL position1.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psSphereGetOffset() with NULL position2.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psSphereGetOffset() with bogus offset mode.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psSphereGetOffset() with bogus offset units.  Should generate error, return NULL.
--------------------------------------------------------------------
--------------------------------------------------------------------
-Calling psSphereSetOffset() with NULL position1.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psSphereSetOffset() with NULL offset.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psSphereSetOffset() with bogus offset mode.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psSphereSetOffset() with bogus offset unit.  Should generate error, return NULL.
--------------------------------------------------------------------
