Index: trunk/psLib/test/imageops/tst_psImagePixelExtract.c
===================================================================
--- trunk/psLib/test/imageops/tst_psImagePixelExtract.c	(revision 6750)
+++ trunk/psLib/test/imageops/tst_psImagePixelExtract.c	(revision 6770)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-04-01 02:43:57 $
+*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-04-04 22:04:46 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -773,14 +773,114 @@
     int num = 0;
 
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)");
     out = psImageRow(NULL, image, num);
     if (out != NULL) {
         return 1;
     }
-
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)");
+    out = psImageCol(NULL, image, num);
+    if (out != NULL) {
+        return 1;
+    }
 
     image = psImageAlloc(3, 3, PS_TYPE_F64);
+
+    //Test for invalid row0.
+    *(psS32*)&(image->row0) = -1;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)");
+    out = psImageRow(NULL, image, num);
+    if (out != NULL) {
+        return 2;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)");
+    out = psImageCol(NULL, image, num);
+    if (out != NULL) {
+        return 2;
+    }
+
+    //Test for invalid col0.
     *(psS32*)&(image->row0) = 5;
+    *(psS32*)&(image->col0) = -1;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)");
+    out = psImageRow(NULL, image, num);
+    if (out != NULL) {
+        return 3;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)");
+    out = psImageCol(NULL, image, num);
+    if (out != NULL) {
+        return 3;
+    }
+
+    //Test for invalid numRows
     *(psS32*)&(image->col0) = 10;
+    *(int*)&(image->numRows) = -1;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)");
+    out = psImageRow(NULL, image, num);
+    if (out != NULL) {
+        return 4;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)");
+    out = psImageCol(NULL, image, num);
+    if (out != NULL) {
+        return 4;
+    }
+    //Test for invalid numCols
+    *(int*)&(image->numRows) = 3;
+    *(int*)&(image->numCols) = -1;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)");
+    out = psImageRow(NULL, image, num);
+    if (out != NULL) {
+        return 5;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)");
+    out = psImageCol(NULL, image, num);
+    if (out != NULL) {
+        return 5;
+    }
+    //Test for invalid row/col number specified.
+    *(int*)&(image->numCols) = 3;
+    num = 8;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)");
+    out = psImageRow(NULL, image, num);
+    if (out != NULL) {
+        return 6;
+    }
+    num = 13;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)");
+    out = psImageCol(NULL, image, num);
+    if (out != NULL) {
+        return 6;
+    }
+    num = 3;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)");
+    out = psImageRow(NULL, image, num);
+    if (out != NULL) {
+        return 7;
+    }
+    num = 8;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)");
+    out = psImageCol(NULL, image, num);
+    if (out != NULL) {
+        return 7;
+    }
+    num = -10;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for row)");
+    out = psImageRow(NULL, image, num);
+    if (out != NULL) {
+        return 8;
+    }
+    num = -14;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message(for col)");
+    out = psImageCol(NULL, image, num);
+    if (out != NULL) {
+        return 8;
+    }
+
+    //Test valid cases.
+    image->col0 = 10;
+    image->row0 = 5;
+    *(int*)&(image->numRows) = 3;
+    *(int*)&(image->numCols) = 3;
     image->data.F64[0][0] = 666.666;
     image->data.F64[1][0] = 66.6;
@@ -792,7 +892,42 @@
     image->data.F64[1][2] = 666.66;
     image->data.F64[2][2] = 66.66;
-
-
-
+    num = 7;
+    out = psImageRow(out, image, num);
+    if (out == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psImageRow failed to return correct psVector output.\n");
+        return 10;
+    } else {
+        psFree(out);
+        out = NULL;
+    }
+    num = 11;
+    out = psImageCol(NULL, image, num);
+    if (out == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psImageCol failed to return correct psVector output.\n");
+        return 10;
+    } else {
+        psFree(out);
+        out = NULL;
+    }
+
+    num = -3;
+    out = psImageRow(out, image, num);
+    if (out == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psImageRow failed to return correct psVector output.\n");
+        return 10;
+    } else {
+        psFree(out);
+        out = NULL;
+    }
+    num = -1;
+    out = psImageCol(NULL, image, num);
+    if (out == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, false,
+                "psImageCol failed to return correct psVector output.\n");
+        return 10;
+    }
     psFree(out);
     psFree(image);
