Index: trunk/psLib/test/imageops/tap_psImagePixelExtract.c
===================================================================
--- trunk/psLib/test/imageops/tap_psImagePixelExtract.c	(revision 13127)
+++ trunk/psLib/test/imageops/tap_psImagePixelExtract.c	(revision 13614)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-05-02 04:34:13 $
+*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-06-04 20:25:32 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -17,9 +17,43 @@
 #include "pstap.h"
 
+void genericImageRowColTests(int numRows, int numCols)
+{
+    psMemId id = psMemGetId();
+    psImage *image = psImageAlloc(numCols, numRows, PS_TYPE_F32);
+    for (int i = 0 ; i < numRows; i++) {
+        for (int j = 0 ; j < numCols; j++) {
+            image->data.F32[0][0] = (float) i+j;
+        }
+    }            
+
+    bool errorFlag = false;
+    for (int i = 0 ; i < numRows; i++) {
+        psVector *out = psImageRow(NULL, image, i);
+        ok(out != NULL, "psImageRow returned non-NULL");
+        if (out != NULL) {
+            for (int j = 0 ; j < numCols; j++) {
+                if (out->data.F32[j] != image->data.F32[i][j]) {
+                    diag("TEST ERROR: image->data.F32[%d][%d] is %f, should be %f", i, j, 
+                         image->data.F32[i][j], out->data.F32[j]);
+                    errorFlag = true;
+                }
+            }
+            psFree(out);
+        } else {
+            errorFlag = true;
+        }
+    }
+    ok(!errorFlag, "psImageRow() passed tests with correct data inputs");
+    psFree(image);
+    ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+}
+
+
+
 psS32 main(psS32 argc, char* argv[])
 {
     psLogSetFormat("HLNM");
     psLogSetLevel(PS_LOG_INFO);
-    plan_tests(248);
+    plan_tests(295);
 
     // test psImageSlice()
@@ -807,11 +841,24 @@
         ok(out == NULL, "psImageCol() returned NULL");
 
-    
-        //Test valid cases.
-        //XXX: We do not verify the data values.
-        P_PSIMAGE_SET_COL0(image, 10);
-        P_PSIMAGE_SET_ROW0(image, 5);
-        *(int*)&(image->numRows) = 3;
-        *(int*)&(image->numCols) = 3;
+        // Test on correct input data for several sizes    
+        genericImageRowColTests(1, 8);
+        genericImageRowColTests(8, 1);
+        genericImageRowColTests(8, 8);
+        genericImageRowColTests(8, 16);
+        genericImageRowColTests(16, 8);
+        psFree(image);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");    
+    }
+
+    // testImageRowColF64()
+    {
+        psMemId id = psMemGetId();
+        psVector *rowcol = NULL;
+        psVector *empty = NULL;
+        psImage *image = NULL;
+    
+        image = psImageAlloc(3, 3, PS_TYPE_F64);
+        rowcol = psVectorAlloc(3, PS_TYPE_F64);
+
         image->data.F64[0][0] = 666.666;
         image->data.F64[1][0] = 66.6;
@@ -823,67 +870,4 @@
         image->data.F64[1][2] = 666.66;
         image->data.F64[2][2] = 66.66;
-        num = 7;
-        out = psImageRow(out, image, num);
-
-
-        ok(out != NULL, "psImageRow returned non-NULL");
-        psFree(out);
-        out = NULL;
-        num = 11;
-        out = psImageCol(NULL, image, num);
-        ok(out != NULL, "psImageCol returned non-NULL");
-        psFree(out);
-        out = NULL;
-
-    
-        num = -3;
-        out = psImageRow(out, image, num);
-        ok(out != NULL, "psImageRow returned non-NULL");
-        psFree(out);
-        out = NULL;
-
-
-        num = -1;
-        out = psImageCol(NULL, image, num);
-        ok(out != NULL, "psImageCol returned non-NULL");
-        psFree(out);
-        psFree(image);
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-
-    
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    // testImageRowColF64()
-    {
-        psMemId id = psMemGetId();
-        psVector *rowcol = NULL;
-        psVector *empty = NULL;
-        psImage *image = NULL;
-    
-        image = psImageAlloc(3, 3, PS_TYPE_F64);
-        rowcol = psVectorAlloc(3, PS_TYPE_F64);
-
-        image->data.F64[0][0] = 666.666;
-        image->data.F64[1][0] = 66.6;
-        image->data.F64[2][0] = 6.66;
-        image->data.F64[0][1] = 6.6;
-        image->data.F64[1][1] = 6.666;
-        image->data.F64[2][1] = 66.666;
-        image->data.F64[0][2] = 666.6;
-        image->data.F64[1][2] = 666.66;
-        image->data.F64[2][2] = 66.66;
     
         //Test for error with NULL image
