Index: trunk/psLib/test/imageops/Makefile.am
===================================================================
--- trunk/psLib/test/imageops/Makefile.am	(revision 5224)
+++ trunk/psLib/test/imageops/Makefile.am	(revision 5227)
@@ -11,5 +11,6 @@
 	tst_psImagePixelManip \
 	tst_psImageStats \
-	tst_psImageStructManip
+	tst_psImageStructManip \
+    tst_psImageMaskOps
 
 tst_psImageConvolve_SOURCES =  tst_psImageConvolve.c
@@ -20,4 +21,5 @@
 tst_psImageStats_SOURCES =  tst_psImageStats.c
 tst_psImageStructManip_SOURCES =  tst_psImageStructManip.c
+tst_psImageMaskOps_SOURCES = tst_psImageMaskOps.c
 
 check_DATA =
Index: trunk/psLib/test/imageops/tst_psImageMaskOps.c
===================================================================
--- trunk/psLib/test/imageops/tst_psImageMaskOps.c	(revision 5227)
+++ trunk/psLib/test/imageops/tst_psImageMaskOps.c	(revision 5227)
@@ -0,0 +1,176 @@
+/** @file  tst_psImageMaskOps.c
+ *
+ *  @brief Contains the tests for psMaskOps.[ch]
+ *
+ *
+ *  @author David Robbins, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-10-06 02:41:07 $
+ *
+ *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
+ */
+
+#include <complex.h>
+#include <math.h>
+#include <float.h>
+#include <string.h>
+#include <stdlib.h>
+#include <string.h>                    // for memset
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "psTest.h"
+#include "pslib_strict.h"
+#include "psType.h"
+
+static psS32 testImageKeepMask(void);
+static psS32 testImageGrowMask(void);
+
+testDescription tests[] = {
+                              {testImageKeepMask,0,"psImageKeep and Mask",0,false},
+                              {testImageGrowMask,0,"psImageGrowMask",0,false},
+                              {NULL}
+                          };
+
+psS32 main(psS32 argc, char* argv[])
+{
+    psLogSetLevel(PS_LOG_INFO);
+
+    return ! runTestSuite(stderr,"psImage",tests,argc,argv);
+}
+
+psS32 testImageKeepMask(void)
+{
+    //psImageMaskRegion
+    //psImageKeepRegion
+    //psImageMaskCircle
+    //psImageKeepCircle
+    psImage *in = psImageAlloc(3,3,PS_TYPE_MASK);
+    psRegion reg;
+    reg.x0 = 0;
+    reg.x1 = 1;
+    reg.y0 = 0;
+    reg.y1 = 1;
+    psMaskType mask = 2;
+    in->data.PS_TYPE_MASK_DATA[0][0] = 2;
+    in->data.PS_TYPE_MASK_DATA[0][1] = 0;
+    in->data.PS_TYPE_MASK_DATA[0][2] = 1;
+    in->data.PS_TYPE_MASK_DATA[1][0] = 4;
+    in->data.PS_TYPE_MASK_DATA[1][1] = 0;
+    in->data.PS_TYPE_MASK_DATA[1][2] = 3;
+    in->data.PS_TYPE_MASK_DATA[2][0] = 2;
+    in->data.PS_TYPE_MASK_DATA[2][1] = 1;
+    in->data.PS_TYPE_MASK_DATA[2][2] = 2;
+
+    printf("\n Mask Region------");
+    psImageMaskRegion(in, reg, "|", mask);
+    for(int i = 0; i < 3; i++) {
+        for (int j = 0; j < 3; j++) {
+            printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
+        }
+    }
+
+    in->data.PS_TYPE_MASK_DATA[0][0] = 2;
+    in->data.PS_TYPE_MASK_DATA[0][1] = 0;
+    in->data.PS_TYPE_MASK_DATA[0][2] = 1;
+    in->data.PS_TYPE_MASK_DATA[1][0] = 4;
+    in->data.PS_TYPE_MASK_DATA[1][1] = 0;
+    in->data.PS_TYPE_MASK_DATA[1][2] = 3;
+    in->data.PS_TYPE_MASK_DATA[2][0] = 2;
+    in->data.PS_TYPE_MASK_DATA[2][1] = 1;
+    in->data.PS_TYPE_MASK_DATA[2][2] = 2;
+    psImageKeepRegion(in, reg, "AND", mask);
+    printf("\n Keep Region------");
+    for(int i = 0; i < 3; i++) {
+        for (int j = 0; j < 3; j++) {
+            printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
+        }
+    }
+
+    //Mask Circle and Keep Circle Functions
+    in->data.PS_TYPE_MASK_DATA[0][0] = 2;
+    in->data.PS_TYPE_MASK_DATA[0][1] = 0;
+    in->data.PS_TYPE_MASK_DATA[0][2] = 1;
+    in->data.PS_TYPE_MASK_DATA[1][0] = 4;
+    in->data.PS_TYPE_MASK_DATA[1][1] = 0;
+    in->data.PS_TYPE_MASK_DATA[1][2] = 3;
+    in->data.PS_TYPE_MASK_DATA[2][0] = 2;
+    in->data.PS_TYPE_MASK_DATA[2][1] = 1;
+    in->data.PS_TYPE_MASK_DATA[2][2] = 2;
+    psImageMaskCircle(in, 1, 1, 1, "XOR", mask);
+    printf("\n Mask Circle------");
+    for(int i = 0; i < 3; i++) {
+        for (int j = 0; j < 3; j++) {
+            printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
+        }
+    }
+
+    in->data.PS_TYPE_MASK_DATA[0][0] = 2;
+    in->data.PS_TYPE_MASK_DATA[0][1] = 0;
+    in->data.PS_TYPE_MASK_DATA[0][2] = 1;
+    in->data.PS_TYPE_MASK_DATA[1][0] = 4;
+    in->data.PS_TYPE_MASK_DATA[1][1] = 0;
+    in->data.PS_TYPE_MASK_DATA[1][2] = 3;
+    in->data.PS_TYPE_MASK_DATA[2][0] = 2;
+    in->data.PS_TYPE_MASK_DATA[2][1] = 1;
+    in->data.PS_TYPE_MASK_DATA[2][2] = 2;
+    psImageKeepCircle(in, 1, 1, 1, "=", mask);
+    printf("\n Keep Circle------");
+    for(int i = 0; i < 3; i++) {
+        for (int j = 0; j < 3; j++) {
+            printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
+        }
+    }
+    fflush(stdout);
+
+    //Error Checks
+    //incorrect logical operation
+    printf("\n");
+    psImageKeepRegion(in, reg, "+", mask);
+    //null image
+    psImage *none = NULL;
+    psImageMaskCircle(none, 1, 1, 1, "&", mask);
+
+    psFree(in);
+    return 0;
+}
+
+psS32 testImageGrowMask(void)
+{
+    psImage *in = NULL;
+    psImage *out = NULL;
+    psImage *test = NULL;
+    psMaskType maskVal = 0;
+    psMaskType growVal = 0;
+    unsigned int growSize = 0;
+    //return null for null input image
+    out = psImageGrowMask(out, in, maskVal, growSize, growVal);
+    if (out != NULL) {
+        fprintf(stderr,
+                "psImageGrowMask failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    in = psImageAlloc(3, 3, PS_TYPE_MASK);
+    //return null for incompatible image size
+    test = psImageAlloc(2, 2, PS_TYPE_MASK);
+    out = psImageGrowMask(test, in, maskVal, growSize, growVal);
+    if (out != NULL) {
+        fprintf(stderr,
+                "psImageGrowMask failed to return NULL for incompatible image size.\n");
+        return 2;
+    }
+    //return null for incompatible image type
+    test = psImageRecycle(test, 3, 3, PS_TYPE_F32);
+    out = psImageGrowMask(test, in, maskVal, growSize, growVal);
+    if (out != NULL) {
+        fprintf(stderr,
+                "psImageGrowMask failed to return NULL for incompatible image type.\n");
+        return 3;
+    }
+
+
+    psFree(in);
+    psFree(test);
+    return 0;
+}
Index: trunk/psLib/test/imageops/tst_psImagePixelManip.c
===================================================================
--- trunk/psLib/test/imageops/tst_psImagePixelManip.c	(revision 5224)
+++ trunk/psLib/test/imageops/tst_psImagePixelManip.c	(revision 5227)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-10-05 03:51:43 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-10-06 02:41:07 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -29,5 +29,4 @@
 static psS32 testImageClipComplexRegion(void);
 static psS32 testImageOverlay(void);
-static psS32 testImageKeepMask(void);
 
 testDescription tests[] = {
@@ -36,5 +35,4 @@
                               {testImageClipComplexRegion,673,"psImageClipComplexRegion",0,false},
                               {testImageOverlay,573,"psImageOverlay",0,false},
-                              {testImageKeepMask,574,"psImageKeep and Mask",0,false},
                               {NULL}
                           };
@@ -798,99 +796,2 @@
     return 0;
 }
-
-psS32 testImageKeepMask(void)
-{
-    //psImageMaskRegion
-    //psImageKeepRegion
-    //psImageMaskCircle
-    //psImageKeepCircle
-    psImage *in = psImageAlloc(3,3,PS_TYPE_MASK);
-    psRegion reg;
-    reg.x0 = 0;
-    reg.x1 = 1;
-    reg.y0 = 0;
-    reg.y1 = 1;
-    psMaskType mask = 2;
-    in->data.PS_TYPE_MASK_DATA[0][0] = 2;
-    in->data.PS_TYPE_MASK_DATA[0][1] = 0;
-    in->data.PS_TYPE_MASK_DATA[0][2] = 1;
-    in->data.PS_TYPE_MASK_DATA[1][0] = 4;
-    in->data.PS_TYPE_MASK_DATA[1][1] = 0;
-    in->data.PS_TYPE_MASK_DATA[1][2] = 3;
-    in->data.PS_TYPE_MASK_DATA[2][0] = 2;
-    in->data.PS_TYPE_MASK_DATA[2][1] = 1;
-    in->data.PS_TYPE_MASK_DATA[2][2] = 2;
-
-    printf("\n Mask Region------");
-    psImageMaskRegion(in, reg, "|", mask);
-    for(int i = 0; i < 3; i++) {
-        for (int j = 0; j < 3; j++) {
-            printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
-        }
-    }
-
-    in->data.PS_TYPE_MASK_DATA[0][0] = 2;
-    in->data.PS_TYPE_MASK_DATA[0][1] = 0;
-    in->data.PS_TYPE_MASK_DATA[0][2] = 1;
-    in->data.PS_TYPE_MASK_DATA[1][0] = 4;
-    in->data.PS_TYPE_MASK_DATA[1][1] = 0;
-    in->data.PS_TYPE_MASK_DATA[1][2] = 3;
-    in->data.PS_TYPE_MASK_DATA[2][0] = 2;
-    in->data.PS_TYPE_MASK_DATA[2][1] = 1;
-    in->data.PS_TYPE_MASK_DATA[2][2] = 2;
-    psImageKeepRegion(in, reg, "AND", mask);
-    printf("\n Keep Region------");
-    for(int i = 0; i < 3; i++) {
-        for (int j = 0; j < 3; j++) {
-            printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
-        }
-    }
-
-    //Mask Circle and Keep Circle Functions
-    in->data.PS_TYPE_MASK_DATA[0][0] = 2;
-    in->data.PS_TYPE_MASK_DATA[0][1] = 0;
-    in->data.PS_TYPE_MASK_DATA[0][2] = 1;
-    in->data.PS_TYPE_MASK_DATA[1][0] = 4;
-    in->data.PS_TYPE_MASK_DATA[1][1] = 0;
-    in->data.PS_TYPE_MASK_DATA[1][2] = 3;
-    in->data.PS_TYPE_MASK_DATA[2][0] = 2;
-    in->data.PS_TYPE_MASK_DATA[2][1] = 1;
-    in->data.PS_TYPE_MASK_DATA[2][2] = 2;
-    psImageMaskCircle(in, 1, 1, 1, "XOR", mask);
-    printf("\n Mask Circle------");
-    for(int i = 0; i < 3; i++) {
-        for (int j = 0; j < 3; j++) {
-            printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
-        }
-    }
-
-    in->data.PS_TYPE_MASK_DATA[0][0] = 2;
-    in->data.PS_TYPE_MASK_DATA[0][1] = 0;
-    in->data.PS_TYPE_MASK_DATA[0][2] = 1;
-    in->data.PS_TYPE_MASK_DATA[1][0] = 4;
-    in->data.PS_TYPE_MASK_DATA[1][1] = 0;
-    in->data.PS_TYPE_MASK_DATA[1][2] = 3;
-    in->data.PS_TYPE_MASK_DATA[2][0] = 2;
-    in->data.PS_TYPE_MASK_DATA[2][1] = 1;
-    in->data.PS_TYPE_MASK_DATA[2][2] = 2;
-    psImageKeepCircle(in, 1, 1, 1, "=", mask);
-    printf("\n Keep Circle------");
-    for(int i = 0; i < 3; i++) {
-        for (int j = 0; j < 3; j++) {
-            printf("\nin->data.u8 [i][j] i=%d, j=%d = %u", i, j, in->data.PS_TYPE_MASK_DATA[i][j]);
-        }
-    }
-    fflush(stdout);
-
-    //Error Checks
-    //incorrect logical operation
-    printf("\n");
-    psImageKeepRegion(in, reg, "+", mask);
-    //null image
-    psImage *none = NULL;
-    psImageMaskCircle(none, 1, 1, 1, "&", mask);
-
-    psFree(in);
-    return 0;
-}
-
Index: trunk/psLib/test/imageops/verified/tst_psImageMaskOps.stderr
===================================================================
--- trunk/psLib/test/imageops/verified/tst_psImageMaskOps.stderr	(revision 5227)
+++ trunk/psLib/test/imageops/verified/tst_psImageMaskOps.stderr	(revision 5227)
@@ -0,0 +1,28 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psImageMaskOps.c                                       *
+*            TestPoint: psImage{psImageKeep and Mask}                              *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<DATE><TIME>|<HOST>|E|psImageKeepRegion (FILE:LINENO)
+    The logical operation specified is incorrect
+<DATE><TIME>|<HOST>|E|psImageMaskCircle (FILE:LINENO)
+    Invalid image input.  Image is NULL.
+
+---> TESTPOINT PASSED (psImage{psImageKeep and Mask} | tst_psImageMaskOps.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psImageMaskOps.c                                       *
+*            TestPoint: psImage{psImageGrowMask}                                   *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<DATE><TIME>|<HOST>|E|psImageGrowMask (FILE:LINENO)
+    Invalid input image.  Input image cannot be NULL.
+<DATE><TIME>|<HOST>|E|psImageGrowMask (FILE:LINENO)
+    Invalid out image.  Size of out does not match size of in.
+<DATE><TIME>|<HOST>|E|psImageGrowMask (FILE:LINENO)
+    Invalid out image.  Type of out does not match type of in.
+
+---> TESTPOINT PASSED (psImage{psImageGrowMask} | tst_psImageMaskOps.c)
+
Index: trunk/psLib/test/imageops/verified/tst_psImageMaskOps.stdout
===================================================================
--- trunk/psLib/test/imageops/verified/tst_psImageMaskOps.stdout	(revision 5227)
+++ trunk/psLib/test/imageops/verified/tst_psImageMaskOps.stdout	(revision 5227)
@@ -0,0 +1,41 @@
+
+ Mask Region------
+in->data.u8 [i][j] i=0, j=0 = 2
+in->data.u8 [i][j] i=0, j=1 = 2
+in->data.u8 [i][j] i=0, j=2 = 1
+in->data.u8 [i][j] i=1, j=0 = 6
+in->data.u8 [i][j] i=1, j=1 = 2
+in->data.u8 [i][j] i=1, j=2 = 3
+in->data.u8 [i][j] i=2, j=0 = 2
+in->data.u8 [i][j] i=2, j=1 = 1
+in->data.u8 [i][j] i=2, j=2 = 2
+ Keep Region------
+in->data.u8 [i][j] i=0, j=0 = 2
+in->data.u8 [i][j] i=0, j=1 = 0
+in->data.u8 [i][j] i=0, j=2 = 0
+in->data.u8 [i][j] i=1, j=0 = 4
+in->data.u8 [i][j] i=1, j=1 = 0
+in->data.u8 [i][j] i=1, j=2 = 2
+in->data.u8 [i][j] i=2, j=0 = 2
+in->data.u8 [i][j] i=2, j=1 = 0
+in->data.u8 [i][j] i=2, j=2 = 2
+ Mask Circle------
+in->data.u8 [i][j] i=0, j=0 = 2
+in->data.u8 [i][j] i=0, j=1 = 2
+in->data.u8 [i][j] i=0, j=2 = 1
+in->data.u8 [i][j] i=1, j=0 = 6
+in->data.u8 [i][j] i=1, j=1 = 2
+in->data.u8 [i][j] i=1, j=2 = 1
+in->data.u8 [i][j] i=2, j=0 = 2
+in->data.u8 [i][j] i=2, j=1 = 3
+in->data.u8 [i][j] i=2, j=2 = 2
+ Keep Circle------
+in->data.u8 [i][j] i=0, j=0 = 2
+in->data.u8 [i][j] i=0, j=1 = 0
+in->data.u8 [i][j] i=0, j=2 = 2
+in->data.u8 [i][j] i=1, j=0 = 4
+in->data.u8 [i][j] i=1, j=1 = 0
+in->data.u8 [i][j] i=1, j=2 = 3
+in->data.u8 [i][j] i=2, j=0 = 2
+in->data.u8 [i][j] i=2, j=1 = 1
+in->data.u8 [i][j] i=2, j=2 = 2
Index: trunk/psLib/test/imageops/verified/tst_psImagePixelManip.stderr
===================================================================
--- trunk/psLib/test/imageops/verified/tst_psImagePixelManip.stderr	(revision 5224)
+++ trunk/psLib/test/imageops/verified/tst_psImagePixelManip.stderr	(revision 5227)
@@ -147,15 +147,2 @@
 ---> TESTPOINT PASSED (psImage{psImageOverlay} | tst_psImagePixelManip.c)
 
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psImagePixelManip.c                                    *
-*            TestPoint: psImage{psImageKeep and Mask}                              *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|E|psImageKeepRegion (FILE:LINENO)
-    The logical operation specified is incorrect
-<DATE><TIME>|<HOST>|E|psImageMaskCircle (FILE:LINENO)
-    Invalid image input.  Image is NULL.
-
----> TESTPOINT PASSED (psImage{psImageKeep and Mask} | tst_psImagePixelManip.c)
-
