Index: trunk/psLib/test/imageops/tst_psImagePixelExtract.c
===================================================================
--- trunk/psLib/test/imageops/tst_psImagePixelExtract.c	(revision 6778)
+++ trunk/psLib/test/imageops/tst_psImagePixelExtract.c	(revision 6806)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-04-05 01:49:41 $
+*  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-04-06 22:55:18 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -341,4 +341,115 @@
     }
 
+    //Added tests after subimage changes.
+    psFree(image);
+    image = psImageAlloc( c, r, PS_TYPE_F64 );
+    for ( psS32 row = 0;row < r;row++ ) {
+        psF64 *imageRow = image->data.F64[ row ];
+        psF64 rowOffset = row * 2;
+        for ( psS32 col = 0;col < c;col++ ) {
+            imageRow[ col ] = col + rowOffset;
+        }
+    }
+    image->col0 = 1;
+    image->row0 = 1;
+    psFree(out);
+    out = NULL;
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(1,c,1,r),PS_CUT_X_POS,stat);
+    if (out == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psImageSlice failed to return the correct psVector.  Got NULL instead.\n");
+        return 112;
+    }
+    psFree(out);
+    out = NULL;
+    //Return NULL for incorrect image inputs.
+    image->row0 = -1;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(1,c,1,r),PS_CUT_X_POS,stat);
+    if (out != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return NULL for invalid specified input.\n");
+        return 113;
+    }
+    image->col0 = -1;
+    image->row0 = 1;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(1,c,1,r),PS_CUT_X_POS,stat);
+    if (out != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return NULL for invalid specified input.\n");
+        return 114;
+    }
+    image->col0 = 1;
+    //Return NULL for incorrect region inputs.
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(0,c,1,r),PS_CUT_X_POS,stat);
+    if (out != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return NULL for invalid specified input.\n");
+        return 115;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(1,c,1,r+1),PS_CUT_X_POS,stat);
+    if (out != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return NULL for invalid specified input.\n");
+        return 116;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(1,c,1,-r-2),PS_CUT_X_POS,stat);
+    if (out != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return NULL for invalid specified input.\n");
+        return 117;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(c,1,1,r),PS_CUT_X_POS,stat);
+    if (out != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return NULL for invalid specified input.\n");
+        return 118;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(1,1,1,1),PS_CUT_X_POS,stat);
+    if (out != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return NULL for invalid specified input.\n");
+        return 119;
+    }
+
+    //Make sure that regions match appropriately...
+    out = psImageSlice(out,positions,image,mask,1,
+                       psRegionSet(1,-1,1,-1),PS_CUT_Y_NEG,stat);
+    psVector *out2 = NULL;
+    out2 = psImageSlice(out2,positions,image,mask,1,
+                        psRegionSet(0,0,0,0),PS_CUT_Y_NEG,stat);
+    if (out == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psImageSlice incorrectly returned NULL for valid inputs.\n");
+        return 120;
+    } else if (out2 == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psImageSlice incorrectly returned NULL for valid inputs.\n");
+        return 121;
+    } else if (out->n != out2->n) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return matching vectors for equivalent inputs.\n");
+        return 122;
+    } else if (out->data.F64[out->n-1] != out2->data.F64[out2->n-1] ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageSlice failed to return matching vectors for equivalent inputs.\n");
+        return 123;
+    }
+    psFree(out2);
+
     psFree( image );
     psFree( positions );
