Index: trunk/psLib/test/image/tst_psImageStats02.c
===================================================================
--- trunk/psLib/test/image/tst_psImageStats02.c	(revision 1026)
+++ trunk/psLib/test/image/tst_psImageStats02.c	(revision 1072)
@@ -14,8 +14,10 @@
 #include "psImage.h"
 #include "psImageStats.h"
+#include <float.h>
+#include <math.h>
 #define IMAGE_SIZE 3
 #define CHEBY_X_DIM 3
 #define CHEBY_Y_DIM 3
-
+#define THRESHOLD 1.0
 int main()
 {
@@ -39,6 +41,7 @@
     for (i=0;i<IMAGE_SIZE;i++) {
         for (j=0;j<IMAGE_SIZE;j++) {
+            tmpImage->data.F32[i][j] = 4.0;
             tmpImage->data.F32[i][j] = (float) (i + j);
-            tmpImage->data.F32[i][j] = 4.0;
+            tmpImage->data.F32[i][j] = (float) (i + j) + (4.0 * (float) i);
             outImage->data.F32[i][j] = 0.0;
         }
@@ -53,4 +56,9 @@
 
     my2DPoly = psImageFitPolynomial(tmpImage, my2DPoly);
+    for (i=0;i<CHEBY_X_DIM;i++) {
+        for (j=0;j<CHEBY_Y_DIM;j++) {
+            printf("Cheby Polynomial (%d, %d) coefficient is %f\n", i, j, my2DPoly->coeff[i][j]);
+        }
+    }
 
     psMemCheckCorruption(1);
@@ -67,11 +75,18 @@
 
     rc = psImageEvalPolynomial(outImage, my2DPoly);
-    //    for (i=0;i<IMAGE_SIZE;i++) {
-    //        for (j=0;j<IMAGE_SIZE;j++) {
-    //             printf("pixel[%d][%d] is (%f, %f)\n", i, j,
-    //                   tmpImage->data.F32[i][j],
-    //                   outImage->data.F32[i][j]);
-    //        }
-    //    }
+    for (i=0;i<IMAGE_SIZE;i++) {
+        for (j=0;j<IMAGE_SIZE;j++) {
+
+            //             printf("pixel[%d][%d] is (%f, %f)\n", i, j,
+            //                     tmpImage->data.F32[i][j],
+            //                     outImage->data.F32[i][j]);
+            if (fabs(outImage->data.F32[i][j] - tmpImage->data.F32[i][j]) > THRESHOLD) {
+                printf("Pixel (%d, %d) is %f, should be %f\n", i, j,
+                       outImage->data.F32[i][j],
+                       tmpImage->data.F32[i][j]);
+            }
+
+        }
+    }
 
     psMemCheckCorruption(1);
