Index: trunk/psLib/test/astronomy/tst_psAstrometry01.c
===================================================================
--- trunk/psLib/test/astronomy/tst_psAstrometry01.c	(revision 3712)
+++ trunk/psLib/test/astronomy/tst_psAstrometry01.c	(revision 3714)
@@ -5,6 +5,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-04-19 01:22:23 $
+*  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-04-19 04:16:02 $
 *
 * XXX: Must test
@@ -828,5 +828,5 @@
 
 /******************************************************************************
-XXX: This is only a rudimentary test of the psPlaneTransform()
+XXX: This is only a rudimentary test of the psPlaneTransformInvert()
 function.  It tests a few NULL input parameter conditions.
  
@@ -844,10 +844,10 @@
     //
     trans->x->coeff[0][0] = 1.0;
-    trans->x->coeff[0][1] = 1.0;
-    trans->x->coeff[1][0] = 1.0;
+    trans->x->coeff[0][1] = 3.0;
+    trans->x->coeff[1][0] = 2.0;
     trans->x->coeff[1][1] = 1.0;
-    trans->y->coeff[0][0] = 1.0;
-    trans->y->coeff[0][1] = 1.0;
-    trans->y->coeff[1][0] = 1.0;
+    trans->y->coeff[0][0] = 4.0;
+    trans->y->coeff[0][1] = 6.0;
+    trans->y->coeff[1][0] = 5.0;
     trans->y->coeff[1][1] = 1.0;
 
@@ -878,16 +878,47 @@
     }
 
-    printf("----------------------------------------------------------------------------------\n");
-    printf("Calling psPlaneTransformInvert with acceptable data.\n");
-    transOut = psPlaneTransformInvert(NULL, trans, myRegion, 10);
-    if (transOut == NULL) {
-        printf("TEST ERROR: psPlaneTransformInvert() returned a NULL psPlaneTransform.\n");
-        testStatus = false;
+    printf("Calling psPlaneTransformInvert with an acceptable linear transformation.\n");
+    for (psS32 n = 0 ; n < 100 ; n++) {
+        //
+        // We create a random linear transformation and hope it is invertible.
+        //
+        trans->x->coeff[0][0] = ((psF32) (random() % 1000000)) / 100000.0;
+        trans->x->coeff[0][1] = ((psF32) (random() % 1000000)) / 100000.0;
+        trans->x->coeff[1][0] = ((psF32) (random() % 1000000)) / 100000.0;
+        trans->x->coeff[1][1] = 0.1;
+        trans->y->coeff[0][0] = ((psF32) (random() % 1000000)) / 100000.0;
+        trans->y->coeff[0][1] = ((psF32) (random() % 1000000)) / 100000.0;
+        trans->y->coeff[1][0] = ((psF32) (random() % 1000000)) / 100000.0;
+        trans->y->coeff[1][1] = 0.1;
+
+        transOut = psPlaneTransformInvert(NULL, trans, myRegion, 10);
+        if (transOut == NULL) {
+            printf("TEST ERROR: psPlaneTransformInvert() returned a NULL psPlaneTransform.\n");
+            testStatus = false;
+        }
+        psPlane *in = psPlaneAlloc();
+        in->x = 2.0;
+        in->y = 3.0;
+
+        psPlane *mid = psPlaneTransformApply(NULL, trans, in);
+        psPlane *out = psPlaneTransformApply(NULL, transOut, mid);
+
+        if (((fabs(in->x - out->x) > FLT_EPSILON)) ||
+                ((fabs(in->y - out->y) > FLT_EPSILON))) {
+            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(transOut);
     }
 
     psFree(trans);
-    psFree(transOut);
     psFree(myRegion);
 
     return(!testStatus);
 }
+//This code will
