Index: trunk/psModules/test/imsubtract/tst_pmSubtractSky.c
===================================================================
--- trunk/psModules/test/imsubtract/tst_pmSubtractSky.c	(revision 5169)
+++ trunk/psModules/test/imsubtract/tst_pmSubtractSky.c	(revision 5516)
@@ -7,12 +7,11 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-28 20:42:52 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-15 20:09:03 $
+ *
+ *  XXX: I added the CELL.TRIMSEC region code but there are not tests for it.
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
-
-
-
 #include "psTest.h"
 #include "pslib.h"
@@ -67,9 +66,14 @@
     myReadout = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL,
                               binFactor, myStats, 10.0);
-    for (i=0;i<numRows;i++) {
-        for (j=0;j<numCols;j++) {
-            if (ERROR_TOLERANCE < fabs(myReadout->image->data.F32[i][j])) {
-                printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j, myReadout->image->data.F32[i][j]);
-                testStatus = 1;
+    if (myReadout == NULL) {
+        printf("TEST ERROR: pmSubtractSky() returned NULL.\n");
+        testStatus = 1;
+    } else {
+        for (i=0;i<numRows;i++) {
+            for (j=0;j<numCols;j++) {
+                if (ERROR_TOLERANCE < fabs(myReadout->image->data.F32[i][j])) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be 0.0\n", i, j, myReadout->image->data.F32[i][j]);
+                    testStatus = 1;
+                }
             }
         }
@@ -117,10 +121,15 @@
     myReadout = pmSubtractSky(myReadout, (void *) myPoly, PM_FIT_POLYNOMIAL,
                               binFactor, myStats, 2.0);
-    for (i=0;i<numRows;i++) {
-        for (j=0;j<numCols;j++) {
-            if (errorTolerance < fabs(myReadout->image->data.F32[i][j] - trueImage->data.F32[i][j])) {
-                printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j,
-                       myReadout->image->data.F32[i][j], trueImage->data.F32[i][j]);
-                testStatus = 1;
+    if (myReadout == NULL) {
+        printf("TEST ERROR: pmSubtractSky() returned NULL.\n");
+        testStatus = 1;
+    } else {
+        for (i=0;i<numRows;i++) {
+            for (j=0;j<numCols;j++) {
+                if (errorTolerance < fabs(myReadout->image->data.F32[i][j] - trueImage->data.F32[i][j])) {
+                    printf("TEST ERROR: image[%d][%d] is %f, should be %f\n", i, j,
+                           myReadout->image->data.F32[i][j], trueImage->data.F32[i][j]);
+                    testStatus = 1;
+                }
             }
         }
