Index: /trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c	(revision 1150)
+++ /trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c	(revision 1150)
@@ -0,0 +1,154 @@
+/** @file  tst_psMatrix_01.c
+ *
+ *  @brief Test driver for psMatrixVector arithmetic functions
+ *
+ *  This test driver contains negative tests for psBinaryOp and psUanryOp:
+ *     Check for NULL arguments
+ *     Inconsistent element types
+ *     Inconsistent element count
+ *     Inconsistent dimensionality
+ *     Division by zero
+ *     Attempt to use min with complex numbers
+ *     Attempt to use max with complex numbers
+ *     Invalid operation
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-30 20:07:07 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+
+#define PRINT_VECTOR(VECTOR,TYPE)                                                                            \
+for(int i=0; i<VECTOR->n; i++) {                                                                         \
+    if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) {                                                    \
+        printf("%f+%fi ", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i]));                     \
+    } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) {                                                 \
+        printf("%d ", (int)VECTOR->data.TYPE[i]);                                                        \
+    } else {                                                                                             \
+        printf("%f ", (double)VECTOR->data.TYPE[i]);                                                     \
+    }                                                                                                    \
+}                                                                                                        \
+printf("\n\n");
+
+
+#define PRINT_MATRIX(IMAGE,TYPE)                                                                             \
+for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                 \
+    for(int j=0; j<IMAGE->numCols; j++) {                                                                \
+        if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                 \
+            printf("%f+%fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));             \
+        } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) {                                              \
+            printf("%d ", (int)IMAGE->data.TYPE[i][j]);                                                  \
+        } else {                                                                                         \
+            printf("%f ", (double)IMAGE->data.TYPE[i][j]);                                               \
+        }                                                                                                \
+    }                                                                                                    \
+    printf("\n");                                                                                        \
+}                                                                                                        \
+printf("\n");
+
+
+#define CREATE_AND_SET_VECTOR(NAME,TYPE,VALUE,SIZE)                                                          \
+psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE);                                         \
+for(int i=0; i<SIZE; i++) {                                                                              \
+    NAME->data.TYPE[i] = VALUE;                                                                          \
+}                                                                                                        \
+NAME->n = SIZE;
+
+
+#define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS)                                                    \
+psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                      \
+for(int i=0; i<NAME->numRows; i++) {                                                                     \
+    for(int j=0; j<NAME->numCols; j++) {                                                                 \
+        NAME->data.TYPE[i][j] = VALUE;                                                                   \
+    }                                                                                                    \
+}
+
+
+int main(int argc, char* argv[])
+{
+    CREATE_AND_SET_IMAGE(image1,F64,0,3,3);
+    CREATE_AND_SET_IMAGE(image2,F64,0,3,3);
+    CREATE_AND_SET_IMAGE(image3,F32,0,3,3);
+    CREATE_AND_SET_IMAGE(image4,F64,0,2,2);
+    CREATE_AND_SET_IMAGE(image5,C32,1+1i,3,3);
+    CREATE_AND_SET_VECTOR(vector1,F64,0,2);
+    CREATE_AND_SET_VECTOR(vector2,F64,0,3);
+
+
+    // Check for NULL arguments
+    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Check for NULL arguments",
+                            "Null XXX argument", 0);
+    psBinaryOp(NULL, image1, "+", image2);
+    psBinaryOp(image2, NULL, "+", image2);
+    psBinaryOp(image2, image1, "+", NULL);
+    psBinaryOp(image2, image1, NULL, image2);
+    psUnaryOp(NULL, image1, "sin");
+    psUnaryOp(image2, NULL, "sin");
+    psUnaryOp(image2, image1, NULL);
+    printFooter(stdout, "psBitSet", "Check for NULL arguments", true);
+
+
+    // Inconsistent element types
+    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Inconsistent element types",
+                            "Element types for arguments inconsistent", 0);
+    psBinaryOp(image2, image3, "+", image2);
+    psUnaryOp(image2, image3, "sin");
+    printFooter(stdout, "psBitSet", "Inconsistent element types", true);
+
+
+    // Inconsistent element count
+    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Inconsistent element count",
+                            "Inconsistent element count", 0);
+    psBinaryOp(image2, image4, "+", image2);
+    psUnaryOp(image2, image4, "sin");
+    psBinaryOp(image2, vector1, "+", image2);
+    vector1->type.dimen = PS_DIMEN_TRANSV;
+    psBinaryOp(image2, vector1, "+", image2);
+    printFooter(stdout, "psBitSet", "Inconsistent element count", true);
+
+
+    // Inconsistent dimensionality
+    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Inconsistent dimensionality",
+                            "Dimensionality for arguments inconsistent", 0);
+    psUnaryOp(image2, vector2, "sin");
+    printFooter(stdout, "psBitSet", "Inconsistent dimensionality", true);
+
+
+    // Division by zero
+    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Divide by zero",
+                            "Divide by zero", 0);
+    psBinaryOp(image1, image1, "/", image2);
+    printFooter(stdout, "psBitSet", "Division by zero", true);
+
+
+    // Attempt to use min with complex numbers
+    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Use min with complex numbers",
+                            "Minimum operation not supported for complex numbers", 0);
+    psBinaryOp(image5, image5, "min", image5);
+    printFooter(stdout, "psBitSet", "Use min with complex numbers", true);
+
+
+    // Attempt to use max with complex numbers
+    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Use max with complex numbers",
+                            "Maximum operation not supported for complex numbers", 0);
+    psBinaryOp(image5, image5, "max", image5);
+    printFooter(stdout, "psBitSet", "Use max with complex numbers", true);
+
+
+    // Invalid operation
+    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic", "Invalid operation",
+                            "Invalid operation", 0);
+    psBinaryOp(image1, image1, "yarg", image2);
+    psUnaryOp(image2, image1, "yarg");
+    printFooter(stdout, "psBitSet", "Invalid operation", true);
+
+    return 0;
+}
+
Index: /trunk/psLib/test/dataManip/verified/tst_psMatrixVectorArithmetic03.stderr
===================================================================
--- /trunk/psLib/test/dataManip/verified/tst_psMatrixVectorArithmetic03.stderr	(revision 1150)
+++ /trunk/psLib/test/dataManip/verified/tst_psMatrixVectorArithmetic03.stderr	(revision 1150)
@@ -0,0 +1,27 @@
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Line 404 - Null out argument
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Line 410 - Null in1 argument
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Line 416 - Null in2 argument
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Line 421 - Null op argument
+ <DATE> <TIME> <HOST> |E|      psUnaryOp|: Line 709 - Null out argument
+ <DATE> <TIME> <HOST> |E|      psUnaryOp|: Line 715 - Null in argument
+ <DATE> <TIME> <HOST> |E|      psUnaryOp|: Line 720 - Null op argument
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Line 433 - Element types for arguments inconsistent: (1028, 1032, 1032)
+ <DATE> <TIME> <HOST> |E|      psUnaryOp|: Line 730 - Element types for arguments inconsistent: (1028, 1032)
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Inconsistent element count: numRows: 2 vs 3 numCols: 2 vs 3
+ <DATE> <TIME> <HOST> |E|      psUnaryOp|: Inconsistent element count: numRows: 2 vs 3 numCols: 2 vs 3
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Inconsistent element count: 2 vs 3
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Inconsistent element count: 2 vs 3
+ <DATE> <TIME> <HOST> |E|      psUnaryOp|: Line 736 - Dimensionality for arguments inconsistent: (1, 3)
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|       psNanDiv|: Divide by zero
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Minimum operation not supported for complex numbers
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Maximum operation not supported for complex numbers
+ <DATE> <TIME> <HOST> |E|     psBinaryOp|: Invalid operation: yarg
+ <DATE> <TIME> <HOST> |E|      psUnaryOp|: Invalid operation: yarg
Index: /trunk/psLib/test/dataManip/verified/tst_psMatrixVectorArithmetic03.stdout
===================================================================
--- /trunk/psLib/test/dataManip/verified/tst_psMatrixVectorArithmetic03.stdout	(revision 1150)
+++ /trunk/psLib/test/dataManip/verified/tst_psMatrixVectorArithmetic03.stdout	(revision 1150)
@@ -0,0 +1,88 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMatrixVectorArithmetic03.c                           *
+*            TestPoint: psMatrixVectorArithmetic{Check for NULL arguments}         *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Null XXX argument                                          *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psBitSet{Check for NULL arguments} | tst_psMatrixVectorArithmetic03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMatrixVectorArithmetic03.c                           *
+*            TestPoint: psMatrixVectorArithmetic{Inconsistent element types}       *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Element types for arguments inconsistent                   *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psBitSet{Inconsistent element types} | tst_psMatrixVectorArithmetic03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMatrixVectorArithmetic03.c                           *
+*            TestPoint: psMatrixVectorArithmetic{Inconsistent element count}       *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Inconsistent element count                                 *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psBitSet{Inconsistent element count} | tst_psMatrixVectorArithmetic03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMatrixVectorArithmetic03.c                           *
+*            TestPoint: psMatrixVectorArithmetic{Inconsistent dimensionality}      *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Dimensionality for arguments inconsistent                  *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psBitSet{Inconsistent dimensionality} | tst_psMatrixVectorArithmetic03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMatrixVectorArithmetic03.c                           *
+*            TestPoint: psMatrixVectorArithmetic{Divide by zero}                   *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Divide by zero                                             *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psBitSet{Division by zero} | tst_psMatrixVectorArithmetic03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMatrixVectorArithmetic03.c                           *
+*            TestPoint: psMatrixVectorArithmetic{Use min with complex numbers}     *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Minimum operation not supported for complex numbers        *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psBitSet{Use min with complex numbers} | tst_psMatrixVectorArithmetic03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMatrixVectorArithmetic03.c                           *
+*            TestPoint: psMatrixVectorArithmetic{Use max with complex numbers}     *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Maximum operation not supported for complex numbers        *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psBitSet{Use max with complex numbers} | tst_psMatrixVectorArithmetic03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psMatrixVectorArithmetic03.c                           *
+*            TestPoint: psMatrixVectorArithmetic{Invalid operation}                *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Invalid operation                                          *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psBitSet{Invalid operation} | tst_psMatrixVectorArithmetic03.c)
+
