Index: /trunk/psModules/test/tst_pmImageCombine.c
===================================================================
--- /trunk/psModules/test/tst_pmImageCombine.c	(revision 4290)
+++ /trunk/psModules/test/tst_pmImageCombine.c	(revision 4291)
@@ -7,6 +7,8 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-13 19:36:46 $
+ *  XXX: Must verify the results internally.  Don't use stdout file.
+ *
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-16 23:13:43 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -16,8 +18,6 @@
 #include "pmImageCombine.h"
 static int test00(void);
-static int test01(void);
 testDescription tests[] = {
                               {test00, 000, "pmCombineImages()", true, false},
-                              {test01, 000, "pmRejectPixels()",  true, false},
                               {NULL}
                           };
@@ -28,9 +28,4 @@
 }
 
-#define TST01_EXPANSION_FACTOR_X 1.0
-#define TST01_EXPANSION_FACTOR_Y 1.0
-#define TST01_OFFSET_X 0.0
-#define TST01_OFFSET_Y 0.0
-
 psF32 genRanFloat(psF32 low,
                   psF32 high)
@@ -47,8 +42,14 @@
 }
 
+#define TST00_EXPANSION_FACTOR_X 1.0
+#define TST00_EXPANSION_FACTOR_Y 1.0
+#define TST00_OFFSET_X 0.0
+#define TST00_OFFSET_Y 0.0
 #define TST00_NUM_PIXELS 10
 #define TST00_MASK_VALUE 1
 #define TST00_NUM_ITERATIONS 4
 #define TST00_SIGMA_CLIP 1.0
+#define TST00_REJECTION_THRESHOLD 0.01
+#define TST00_GRADIENT_LIMIT 10.0
 /*******************************************************************************
 NOTE: This function returns FALSE if there were no errors.
@@ -148,4 +149,5 @@
         psImage *image = (psImage *) images->data[im];
         image->data.F32[row][col] += 100.0;
+        printf("Generating a bad pixel in image (%d) at (%d, %d)\n", im, row, col);
     }
 
@@ -281,15 +283,15 @@
     for (psS32 im = 0 ; im < numImages ; im++) {
         psPlaneTransform *ptExpand = psPlaneTransformAlloc(2, 2);
-        ptExpand->x->coeff[0][0] = TST01_OFFSET_X;
-        ptExpand->x->coeff[1][0] = TST01_EXPANSION_FACTOR_X;
-        ptExpand->y->coeff[0][0] = TST01_OFFSET_Y;
-        ptExpand->y->coeff[0][1] = TST01_EXPANSION_FACTOR_Y;
+        ptExpand->x->coeff[0][0] = TST00_OFFSET_X;
+        ptExpand->x->coeff[1][0] = TST00_EXPANSION_FACTOR_X;
+        ptExpand->y->coeff[0][0] = TST00_OFFSET_Y;
+        ptExpand->y->coeff[0][1] = TST00_EXPANSION_FACTOR_Y;
         expandTransforms->data[im] = (psPtr *) ptExpand;
 
         psPlaneTransform *ptContract = psPlaneTransformAlloc(2, 2);
-        ptContract->x->coeff[0][0] = -TST01_OFFSET_X;
-        ptContract->x->coeff[1][0] = 1.0 / TST01_EXPANSION_FACTOR_X;
-        ptContract->y->coeff[0][0] = -TST01_OFFSET_Y;
-        ptContract->y->coeff[0][1] = 1.0 / TST01_EXPANSION_FACTOR_Y;
+        ptContract->x->coeff[0][0] = -TST00_OFFSET_X;
+        ptContract->x->coeff[1][0] = 1.0 / TST00_EXPANSION_FACTOR_X;
+        ptContract->y->coeff[0][0] = -TST00_OFFSET_Y;
+        ptContract->y->coeff[0][1] = 1.0 / TST00_EXPANSION_FACTOR_Y;
         contractTransforms->data[im] = (psPtr *) ptContract;
     }
@@ -300,19 +302,23 @@
     // We exclude this from our tests.
     //
-    if (0) {
-        printf("\n\n\nCalling pmRejectPixels() with acceptable data.  Should generate a psArray.\n");
-        psArray *pixelRejects = pmRejectPixels(images, questionablePixels, expandTransforms,
-                                               contractTransforms, 1.0, 1.0);
-        if (pixelRejects == NULL) {
-            printf("TEST ERROR: pmCombineImages() returned a NULL psArray.\n");
-            testStatus = true;
-        } else {
-            // XXX: We should internally verify this with the pixels list, not merely use the stdout.
-            for (psS32 i = 0 ; i < pixelRejects->n ; i++) {
-                psPixels *myPixels = (psPixels *) pixelRejects->data[i];
-                printf("Image %d had %d rejects.\n", i, myPixels->n);
-            }
-            psFree(pixelRejects);
-        }
+    printf("\n\n\nCalling pmRejectPixels() with acceptable data.  Should generate a psArray.\n");
+    psArray *pixelRejects = pmRejectPixels(images, questionablePixels, expandTransforms,
+                                           contractTransforms, TST00_REJECTION_THRESHOLD,
+                                           TST00_GRADIENT_LIMIT);
+    if (pixelRejects == NULL) {
+        printf("TEST ERROR: pmCombineImages() returned a NULL psArray.\n");
+        testStatus = true;
+    } else {
+        // XXX: We should internally verify this with the pixels list, not merely use the stdout.
+        for (psS32 i = 0 ; i < pixelRejects->n ; i++) {
+            psPixels *myPixels = (psPixels *) pixelRejects->data[i];
+            printf("tst_pmImageCombine.c: Image %d had %d rejects.\n", i, myPixels->n);
+
+            for (psS32 p = 0 ; p < myPixels->n ; p++) {
+                printf("Image %d, rejected pixel %d is (%d %d)\n", i, p,
+                       myPixels->data[p].y, myPixels->data[p].x);
+            }
+        }
+        psFree(pixelRejects);
     }
 
@@ -343,35 +349,2 @@
     return(!testStatus);
 }
-
-/*******************************************************************************
-NOTE: This function returns FALSE if there were no errors.
- 
-XXX: This function will probably disappear.  Because of the tight dependence
-on the pmImageCombine() function, it's probably best to test the
-pmRejectPixels() function there.
- ******************************************************************************/
-psBool testRejectPixels(psS32 numRows,
-                        psS32 numCols,
-                        psS32 numImages,
-                        psF32 rejThreshold,
-                        psF32 gradLimit)
-
-{
-    printf("Testing pmRejectPixels(%d, %d, %d, %f, %f)\n",
-           numRows, numCols, numImages, rejThreshold, gradLimit);
-    bool testStatus = false;
-
-    return(testStatus);
-}
-
-/*******************************************************************************
-NOTE: This function returns TRUE if there were no errors.
- ******************************************************************************/
-int test01( void )
-{
-    bool testStatus = false;
-
-    testStatus|= testRejectPixels(10, 10, 5, 1.0, 1.0);
-
-    return(!testStatus);
-}
