Index: /trunk/psLib/test/astronomy/tst_psCoord.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3366)
+++ /trunk/psLib/test/astronomy/tst_psCoord.c	(revision 3367)
@@ -6,6 +6,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-03-02 21:03:20 $
+*  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-03-02 23:00:17 $
 *
 *  XXX: THe psProject() and psDeproject() functions do not work fully.  They
@@ -23,5 +23,5 @@
 static psS32 testSphereTransformAlloc( void );
 static psS32 testPlaneTransformAlloc( void );
-static psS32 test1c( void );
+static psS32 testPlaneDistortAlloc( void );
 static psS32 test2( void );
 static psS32 test3( void );
@@ -45,5 +45,5 @@
                               {testSphereTransformAlloc, 819, "psSphereTransformAlloc()", 0, false},
                               {testPlaneTransformAlloc, 826, "psPlaneTransformAlloc()", 0, false},
-                              {test1c, 0000, "psPlaneDistortAlloc()", 0, false},
+                              {testPlaneDistortAlloc, 827, "psPlaneDistortAlloc()", 0, false},
                               {test2, 0000, "psPlaneTransformApply()", 0, false},
                               {test3, 0000, "psPlaneDistortApply()", 0, false},
@@ -148,5 +148,4 @@
 psS32 testPlaneTransformAlloc( void )
 {
-    //    psS32 testStatus = 0;
     // Allocate psPlaneTransform with known x and y terms
     psPlaneTransform *myPT = psPlaneTransformAlloc(NX_TERMS, NY_TERMS);
@@ -205,85 +204,90 @@
 
 
-psS32 test1c( void )
-{
-    psS32 testStatus = 0;
+psS32 testPlaneDistortAlloc( void )
+{
+    // Invoke function with known parameters
     psPlaneDistort *myPD = psPlaneDistortAlloc(NW_TERMS, NX_TERMS, NY_TERMS, NZ_TERMS);
 
+    // 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->nW != NW_TERMS) {
-        printf("ERROR: myPD->x->nW is %d, should be %d\n", myPD->x->nW, NW_TERMS);
-        testStatus = 1;
+        psError(PS_ERR_UNKNOWN,true,"myPD->x->nW is %d, should be %d",
+                myPD->x->nW, NW_TERMS);
+        return 2;
     }
     if (myPD->y->nW != NW_TERMS) {
-        printf("ERROR: myPD->y->nW is %d, should be %d\n", myPD->y->nW, NW_TERMS);
-        testStatus = 1;
-    }
-
+        psError(PS_ERR_UNKNOWN,true,"myPD->y->nW is %d, should be %d",
+                myPD->y->nW, NW_TERMS);
+        return 3;
+    }
     if (myPD->x->nX != NX_TERMS) {
-        printf("ERROR: myPD->x->nX is %d, should be %d\n", myPD->x->nX, NX_TERMS);
-        testStatus = 1;
+        psError(PS_ERR_UNKNOWN,true,"myPD->x->nX is %d, should be %d",
+                myPD->x->nX, NX_TERMS);
+        return 4;
     }
     if (myPD->y->nX != NX_TERMS) {
-        printf("ERROR: myPD->y->nX is %d, should be %d\n", myPD->y->nX, NX_TERMS);
-        testStatus = 1;
-    }
-
+        psError(PS_ERR_UNKNOWN,true,"myPD->y->nX is %d, should be %d",
+                myPD->y->nX, NX_TERMS);
+        return 5;
+    }
     if (myPD->x->nY != NY_TERMS) {
-        printf("ERROR: myPD->x->nY is %d, should be %d\n", myPD->x->nY, NY_TERMS);
-        testStatus = 1;
+        psError(PS_ERR_UNKNOWN,true,"myPD->x->nY is %d, should be %d",
+                myPD->x->nY, NY_TERMS);
+        return 6;
     }
     if (myPD->y->nY != NY_TERMS) {
-        printf("ERROR: myPD->y->nY is %d, should be %d\n", myPD->y->nY, NY_TERMS);
-        testStatus = 1;
-    }
-
+        psError(PS_ERR_UNKNOWN,true,"myPD->y->nY is %d, should be %d",
+                myPD->y->nY, NY_TERMS);
+        return 7;
+    }
     if (myPD->x->nZ != NZ_TERMS) {
-        printf("ERROR: myPD->x->nZ is %d, should be %d\n", myPD->x->nZ, NZ_TERMS);
-        testStatus = 1;
+        psError(PS_ERR_UNKNOWN,true,"myPD->x->nZ is %d, should be %d",
+                myPD->x->nZ, NZ_TERMS);
+        return 8;
     }
     if (myPD->y->nZ != NZ_TERMS) {
-        printf("ERROR: myPD->y->nZ is %d, should be %d\n", myPD->y->nZ, NZ_TERMS);
-        testStatus = 1;
-    }
-
+        psError(PS_ERR_UNKNOWN,true,"myPD->y->nZ is %d, should be %d",
+                myPD->y->nZ, NZ_TERMS);
+        return 9;
+    }
+    // Free psPlaneTransform
     psFree(myPD);
 
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.\n");
+    // Invoke function with negative x term parameter
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative x term");
     myPD = psPlaneDistortAlloc(-1.0, 1.0, 1.0, 1.0);
     if (myPD != NULL) {
-        printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n");
-        testStatus = false;
-        myPD = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.\n");
+        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
+        return 10;
+    }
+
+    // Invoke function with negative y term parameter
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative y term");
     myPD = psPlaneDistortAlloc(1.0, -1.0, 1.0, 1.0);
     if (myPD != NULL) {
-        printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n");
-        testStatus = false;
-        myPD = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.\n");
+        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
+        return 11;
+    }
+
+    // Invoke function with negative z term parameter
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative z term");
     myPD = psPlaneDistortAlloc(1.0, 1.0, -1.0, 1.0);
     if (myPD != NULL) {
-        printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n");
-        testStatus = false;
-        myPD = NULL;
-    }
-
-    printf("-------------------------------------------------------------------\n");
-    printf("Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.\n");
+        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
+        return 12;
+    }
+
+    // Invoke function with negative w term parameter
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for negative w term");
     myPD = psPlaneDistortAlloc(1.0, 1.0, 1.0, -1.0);
     if (myPD != NULL) {
-        printf("TEST ERROR: psPlaneDistortAlloc() did not return NULL.\n");
-        testStatus = false;
-        myPD = NULL;
-    }
-    printf("-------------------------------------------------------------------\n");
-
-    return(testStatus);
+        psError(PS_ERR_UNKNOWN,true,"psPlaneDistortAlloc() did not return NULL.");
+    }
+
+    return 0;
 }
 
Index: /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3366)
+++ /trunk/psLib/test/astronomy/verified/tst_psCoord.stderr	(revision 3367)
@@ -31,10 +31,18 @@
 \**********************************************************************************/
 
+<DATE><TIME>|<HOST>|I|testPlaneDistortAlloc
+    Following should generate an error message for negative x term
 <DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO)
     Error: n1 is less than 0.
+<DATE><TIME>|<HOST>|I|testPlaneDistortAlloc
+    Following should generate an error message for negative y term
 <DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO)
     Error: n2 is less than 0.
+<DATE><TIME>|<HOST>|I|testPlaneDistortAlloc
+    Following should generate an error message for negative z term
 <DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO)
     Error: n3 is less than 0.
+<DATE><TIME>|<HOST>|I|testPlaneDistortAlloc
+    Following should generate an error message for negative w term
 <DATE><TIME>|<HOST>|E|psPlaneDistortAlloc (FILE:LINENO)
     Error: n4 is less than 0.
Index: /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout	(revision 3366)
+++ /trunk/psLib/test/astronomy/verified/tst_psCoord.stdout	(revision 3367)
@@ -1,11 +1,2 @@
--------------------------------------------------------------------
-Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.
--------------------------------------------------------------------
-Calling psPlaneDistortAlloc() with negative-order polynomial request.  Should generate error, return NULL.
--------------------------------------------------------------------
 -------------------------------------------------------------------
 Calling psPlaneTransformApply() with NULL psPlaneTransform.  Should generate error, return NULL.
