Index: trunk/psLib/test/imageops/tst_psImagePixelExtract.c
===================================================================
--- trunk/psLib/test/imageops/tst_psImagePixelExtract.c	(revision 5174)
+++ trunk/psLib/test/imageops/tst_psImagePixelExtract.c	(revision 5625)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-09-29 01:15:38 $
+*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-11-30 02:00:37 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -21,5 +21,15 @@
 static psS32 testImageCut(void);
 static psS32 testImageRadialCut(void);
-static psS32 testImageRowCol(void);
+static psS32 testImageRowColF32(void);
+static psS32 testImageRowColF64(void);
+static psS32 testImageRowColS8(void);
+static psS32 testImageRowColS16(void);
+static psS32 testImageRowColS32(void);
+static psS32 testImageRowColS64(void);
+static psS32 testImageRowColU8(void);
+static psS32 testImageRowColU16(void);
+static psS32 testImageRowColU32(void);
+static psS32 testImageRowColU64(void);
+
 
 
@@ -28,5 +38,14 @@
                               {testImageCut, 555, "psImageCut", 0, false},
                               {testImageRadialCut, 557, "psImageRadialCut", 0, false},
-                              {testImageRowCol, 559, "psImageRowCol", 0, false},
+                              {testImageRowColF32, 558, "psImageRowColF32", 0, false},
+                              {testImageRowColF64, 559, "psImageRowColF64", 0, false},
+                              {testImageRowColU8, 560, "psImageRowColU8", 0, false},
+                              {testImageRowColU16, 561, "psImageRowColU16", 0, false},
+                              {testImageRowColU32, 562, "psImageRowColU32", 0, false},
+                              {testImageRowColU64, 563, "psImageRowColU64", 0, false},
+                              {testImageRowColS8, 564, "psImageRowColS8", 0, false},
+                              {testImageRowColS16, 565, "psImageRowColS16", 0, false},
+                              {testImageRowColS32, 566, "psImageRowColS32", 0, false},
+                              {testImageRowColS64, 567, "psImageRowColS64", 0, false},
                               {NULL}
                           };
@@ -745,5 +764,5 @@
 }
 
-psS32 testImageRowCol(void)
+psS32 testImageRowColF64(void)
 {
     psVector *rowcol = NULL;
@@ -794,2 +813,447 @@
 }
 
+psS32 testImageRowColF32(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    float test1;
+    float test2;
+    float TOLTST = .01;
+
+    image = psImageAlloc(3, 3, PS_TYPE_F32);
+    rowcol = psVectorAlloc(3, PS_TYPE_F32);
+
+    image->data.F32[0][0] = 666.666;
+    image->data.F32[1][0] = 66.6;
+    image->data.F32[2][0] = 6.66;
+    image->data.F32[0][1] = 6.6;
+    image->data.F32[1][1] = 6.666;
+    image->data.F32[2][1] = 66.666;
+    image->data.F32[0][2] = 666.6;
+    image->data.F32[1][2] = 666.66;
+    image->data.F32[2][2] = 66.66;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.F32[0] = 1.1;
+    rowcol->data.F32[2] = 2.2;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    test1 = abs(rowcol->data.F32[0]-66.6);
+    test2 = abs(rowcol->data.F32[2]-666.66);
+    if ( (test1>TOLTST) || (test2>TOLTST) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
+
+psS32 testImageRowColU64(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_U64);
+    rowcol = psVectorAlloc(3, PS_TYPE_U64);
+
+    image->data.U64[0][0] = 666666;
+    image->data.U64[1][0] = 666;
+    image->data.U64[2][0] = 666;
+    image->data.U64[0][1] = 66;
+    image->data.U64[1][1] = 6666;
+    image->data.U64[2][1] = 66666;
+    image->data.U64[0][2] = 6666;
+    image->data.U64[1][2] = 66666;
+    image->data.U64[2][2] = 6666;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.U64[0] = 11;
+    rowcol->data.U64[2] = 22;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    if (rowcol->data.U64[0] != 666 && rowcol->data.U64[2] != 66666) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
+
+psS32 testImageRowColU32(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_U32);
+    rowcol = psVectorAlloc(3, PS_TYPE_U32);
+
+    image->data.U32[0][0] = 666666;
+    image->data.U32[1][0] = 666;
+    image->data.U32[2][0] = 666;
+    image->data.U32[0][1] = 66;
+    image->data.U32[1][1] = 6666;
+    image->data.U32[2][1] = 66666;
+    image->data.U32[0][2] = 6666;
+    image->data.U32[1][2] = 66666;
+    image->data.U32[2][2] = 6666;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.U32[0] = 11;
+    rowcol->data.U32[2] = 22;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    if (rowcol->data.U32[0] != 666 && rowcol->data.U32[2] != 66666) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
+
+psS32 testImageRowColS32(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_S32);
+    rowcol = psVectorAlloc(3, PS_TYPE_S32);
+
+    image->data.S32[0][0] = 666666;
+    image->data.S32[1][0] = 666;
+    image->data.S32[2][0] = 666;
+    image->data.S32[0][1] = 66;
+    image->data.S32[1][1] = 6666;
+    image->data.S32[2][1] = 66666;
+    image->data.S32[0][2] = 6666;
+    image->data.S32[1][2] = 66666;
+    image->data.S32[2][2] = 6666;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.S32[0] = 11;
+    rowcol->data.S32[2] = 22;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    if (rowcol->data.S32[0] != 666 && rowcol->data.S32[2] != 66666) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
+
+psS32 testImageRowColS64(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_S64);
+    rowcol = psVectorAlloc(3, PS_TYPE_S64);
+
+    image->data.S64[0][0] = 666666;
+    image->data.S64[1][0] = 666;
+    image->data.S64[2][0] = 666;
+    image->data.S64[0][1] = 66;
+    image->data.S64[1][1] = 6666;
+    image->data.S64[2][1] = 66666;
+    image->data.S64[0][2] = 6666;
+    image->data.S64[1][2] = 66666;
+    image->data.S64[2][2] = 6666;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.S64[0] = 11;
+    rowcol->data.S64[2] = 22;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    if (rowcol->data.S64[0] != 666 && rowcol->data.S64[2] != 66666) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
+
+psS32 testImageRowColS16(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_S16);
+    rowcol = psVectorAlloc(3, PS_TYPE_S16);
+
+    image->data.S16[0][0] = 3333;
+    image->data.S16[1][0] = 666;
+    image->data.S16[2][0] = 666;
+    image->data.S16[0][1] = 66;
+    image->data.S16[1][1] = 6666;
+    image->data.S16[2][1] = 4444;
+    image->data.S16[0][2] = 6666;
+    image->data.S16[1][2] = 4444;
+    image->data.S16[2][2] = 6666;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.S16[0] = 11;
+    rowcol->data.S16[2] = 22;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    if (rowcol->data.S16[0] != 666 && rowcol->data.S16[2] != 4444) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
+
+psS32 testImageRowColU16(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_U16);
+    rowcol = psVectorAlloc(3, PS_TYPE_U16);
+
+    image->data.S16[0][0] = 3333;
+    image->data.S16[1][0] = 666;
+    image->data.S16[2][0] = 666;
+    image->data.S16[0][1] = 66;
+    image->data.S16[1][1] = 6666;
+    image->data.S16[2][1] = 4444;
+    image->data.S16[0][2] = 6666;
+    image->data.S16[1][2] = 4444;
+    image->data.S16[2][2] = 6666;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.U16[0] = 11;
+    rowcol->data.U16[2] = 22;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    if (rowcol->data.U16[0] != 666 && rowcol->data.U16[2] != 4444) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
+
+psS32 testImageRowColU8(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_U8);
+    rowcol = psVectorAlloc(3, PS_TYPE_U8);
+
+    image->data.U8[0][0] = 244;
+    image->data.U8[1][0] = 123;
+    image->data.U8[2][0] = 123;
+    image->data.U8[0][1] = 66;
+    image->data.U8[1][1] = 199;
+    image->data.U8[2][1] = 249;
+    image->data.U8[0][2] = 199;
+    image->data.U8[1][2] = 249;
+    image->data.U8[2][2] = 199;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.U8[0] = 11;
+    rowcol->data.U8[2] = 22;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    if (rowcol->data.U8[0] != 123 && rowcol->data.U8[2] != 249) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
+psS32 testImageRowColS8(void)
+{
+    psVector *rowcol = NULL;
+    psVector *empty = NULL;
+    psImage *image = NULL;
+    psImage *emptyImage = NULL;
+
+    image = psImageAlloc(3, 3, PS_TYPE_S8);
+    rowcol = psVectorAlloc(3, PS_TYPE_S8);
+
+    image->data.S8[0][0] = 44;
+    image->data.S8[1][0] = 23;
+    image->data.S8[2][0] = 23;
+    image->data.S8[0][1] = 66;
+    image->data.S8[1][1] = 99;
+    image->data.S8[2][1] = 49;
+    image->data.S8[0][2] = 99;
+    image->data.S8[1][2] = 49;
+    image->data.S8[2][2] = 99;
+
+    //Test for error with NULL image
+    empty = psImageCol(empty, emptyImage, 0);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return NULL for NULL image input.\n");
+        return 1;
+    }
+    //Test for error with Out of Range Row
+    empty = psImageRow(empty, image, 5);
+    if (empty != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageRow failed to return NULL for out of range row input.\n");
+        return 2;
+    }
+    rowcol->data.S8[0] = 11;
+    rowcol->data.S8[2] = 22;
+    //Test recycling of non-NULL vector & correct output
+    rowcol = psImageCol(rowcol, image, 1);
+    if (rowcol->data.S8[0] != 23 && rowcol->data.S8[2] != 49) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
+                "psImageCol failed to return correct values.\n");
+        return 3;
+    }
+
+    psFree(rowcol);
+    psFree(image);
+    return 0;
+}
