Index: /trunk/psLib/test/mathtypes/tst_psVector.c
===================================================================
--- /trunk/psLib/test/mathtypes/tst_psVector.c	(revision 7042)
+++ /trunk/psLib/test/mathtypes/tst_psVector.c	(revision 7043)
@@ -14,6 +14,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-02-28 02:53:03 $
+ *  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2006-05-02 22:35:52 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -34,4 +34,5 @@
 static psS32 testVectorCountPixelMask(void);
 static psS32 testVectorLength(void);
+static psS32 testVectorCopy(void);
 
 testDescription tests[] = {
@@ -46,4 +47,5 @@
                               {testVectorCountPixelMask,-9,"psVectorCountPixelMask",0,false},
                               {testVectorLength,666,"psVectorLength",0,false},
+                              {testVectorCopy,667,"psVectorCopy",0,false},
                               {NULL}
                           };
@@ -593,2 +595,54 @@
 }
 
+psS32 testVectorCopy(void)
+{
+
+    psVector *in = NULL;
+    psVector *copy = NULL;
+
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
+    copy = psVectorCopy(copy, in, PS_TYPE_F32);
+    if (copy != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                "psVectorCopy failed to return a NULL vector for NULL input.\n");
+        return 1;
+    }
+
+    in = psVectorAlloc(5, PS_TYPE_F32);
+    in->n = 5;
+    for (int i = 0; i < 5; i++) {
+        in->data.F32[i] = i;
+    }
+    //Try copy of different type
+    copy = psVectorCopy(copy, in, PS_TYPE_F64);
+    if (copy == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                "psVectorCopy returned a NULL vector for correct input.\n");
+        return 2;
+    } else if (copy->data.F64[2] != 2.0) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                "psVectorCopy failed to return the correct data values.\n");
+        printf("\n copy->data.f64[2] = %lf, in->data.f32[2] = %f\n", copy->data.F64[2],
+               in->data.F32[2]);
+        return 3;
+    }
+
+    copy = psVectorRecycle(copy, in->n + 2, PS_TYPE_F64);
+    //Try copy of same type and non-NULL outVector of different type and size.
+    copy = psVectorCopy(copy, in, in->type.type);
+    if (copy == NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                "psVectorCopy returned a NULL vector for correct input.\n");
+        return 4;
+    } else if (copy->type.type != PS_TYPE_F32 || copy->data.F32[2] != 2.0) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                "psVectorCopy failed to return the correct data values.\n");
+        return 5;
+    }
+
+
+    psFree(in);
+    psFree(copy);
+    return 0;
+}
+
Index: /trunk/psLib/test/mathtypes/tst_psVectorSort_01.c
===================================================================
--- /trunk/psLib/test/mathtypes/tst_psVectorSort_01.c	(revision 7042)
+++ /trunk/psLib/test/mathtypes/tst_psVectorSort_01.c	(revision 7043)
@@ -12,6 +12,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-07-13 02:47:00 $
+ *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2006-05-02 22:35:52 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -141,5 +141,7 @@
     out = psVectorAlloc(7,PS_TYPE_F32);
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error messgae");
+    //    printf("\nBefore call, tempVec = psVectorSort(out,in) \n");
     tempVec = psVectorSort(out,in);
+    //    printf("\nAfter call, tempVec = psVectorSort(out,in) \n");
     if(tempVec != NULL) {
         psError(PS_ERR_UNKNOWN,true,"Did not return NULL on error or didn't error?");
@@ -150,16 +152,26 @@
     // Test D - Sort vector with zero elements
     printPositiveTestHeader(stdout,"psVectorSort","Sort zero element vector");
+    //    psFree(out);
+    //    psFree(tempVec);
+    //    out = NULL;
+    //    tempVec = NULL;
     out = psVectorAlloc(7,PS_TYPE_F32);
-    tempVec = out;
+    //    tempVec = out;
     in->n = 0;
     out = psVectorSort(out,in);
-    if(tempVec != out) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return the specified output vector");
-        return 44;
+    //    if(tempVec != out) {
+    //        psError(PS_ERR_UNKNOWN,true,"Did not return the specified output vector");
+    //        return 44;
+    //    }
+    if (out != NULL) {
+        psError(PS_ERR_BAD_PARAMETER_NULL, true,
+                "psVectorSort failed to return a NULL vector for 0-length input vector.\n");
+        return 666;
     }
-    if(out->n != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Did not proper set the number of elements to zero");
-        return 55;
-    }
+    /*    if(out->n != 0) {
+            psError(PS_ERR_UNKNOWN,true,"Did not properly set the number of elements to zero");
+            return 55;
+        }
+        */
     printFooter(stdout,"psVectorSort","Sort zero element vector",true);
 
@@ -168,5 +180,4 @@
     printPositiveTestHeader(stdout,"psVectorSort", "Free float vectors");
     psFree(in);
-    psFree(out);
     if ( psMemCheckLeaks(0, NULL, stdout, false)) {
         psError(PS_ERR_UNKNOWN,true,"Memory leaks detected.");
Index: /trunk/psLib/test/mathtypes/tst_psVectorSort_02.c
===================================================================
--- /trunk/psLib/test/mathtypes/tst_psVectorSort_02.c	(revision 7042)
+++ /trunk/psLib/test/mathtypes/tst_psVectorSort_02.c	(revision 7043)
@@ -14,6 +14,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-02-24 23:43:16 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2006-05-02 22:35:52 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -35,27 +35,22 @@
 if(out->type.type != PS_TYPE_U32) { \
     psError(PS_ERR_UNKNOWN,true,"Output vector is not of type PS_TYPE_U32"); \
-    return 10; \
+    return 1; \
 } \
 if(out->data.U32[0] != 3 ) { \
     psError(PS_ERR_UNKNOWN,true,"Improper index sort out[0] = %ld",out->data.U32[0]); \
-    return 20; \
 } \
 if(out->data.U32[1] != 2 ) { \
     psError(PS_ERR_UNKNOWN,true,"Improper index sort out[1] = %ld",out->data.U32[1]); \
-    return 30; \
 } \
 if(out->data.U32[2] != 4 ) { \
     psError(PS_ERR_UNKNOWN,true,"Improper index sort out[2] = %ld",out->data.U32[2]); \
-    return 40; \
 } \
 if(out->data.U32[3] != 0 ) { \
     psError(PS_ERR_UNKNOWN,true,"Improper index sort out[3] = %ld",out->data.U32[3]); \
-    return 50; \
 } \
 if(out->data.U32[4] != 1 ) { \
     psError(PS_ERR_UNKNOWN,true,"Improper index sort out[4] = %ld",out->data.U32[4]); \
-    return 60; \
 } \
-psFree(in);
+psFree(in); \
 
 psS32 main(psS32 argc,
Index: /trunk/psLib/test/mathtypes/verified/tst_psVector.stderr
===================================================================
--- /trunk/psLib/test/mathtypes/verified/tst_psVector.stderr	(revision 7042)
+++ /trunk/psLib/test/mathtypes/verified/tst_psVector.stderr	(revision 7043)
@@ -125,2 +125,15 @@
 ---> TESTPOINT PASSED (psVector{psVectorLength} | tst_psVector.c)
 
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psVector.c                                             *
+*            TestPoint: psVector{psVectorCopy}                                     *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+<HOST>|I|testVectorCopy
+    Following should generate error message
+<HOST>|E|psVectorCopy (FILE:LINENO)
+    The input psVector can not be NULL.
+
+---> TESTPOINT PASSED (psVector{psVectorCopy} | tst_psVector.c)
+
Index: /trunk/psLib/test/mathtypes/verified/tst_psVectorSort_01.stderr
===================================================================
--- /trunk/psLib/test/mathtypes/verified/tst_psVectorSort_01.stderr	(revision 7042)
+++ /trunk/psLib/test/mathtypes/verified/tst_psVectorSort_01.stderr	(revision 7043)
@@ -1,4 +1,10 @@
 <DATE><TIME>|<HOST>|I|main
     Following should generate an error messgae
+<DATE><TIME>|<HOST>|E|psVectorCopy (FILE:LINENO)
+    Input psVector is an unsupported type (0xaacd184f).
 <DATE><TIME>|<HOST>|E|psVectorSort (FILE:LINENO)
-    Input psVector is an unsupported type (0x1301).
+    Error in psVectorSort:  psVectorCopy returned NULL vector!
+<DATE><TIME>|<HOST>|W|psVectorCopy (FILE:LINENO)
+    Warning: psVector was copied with 0 elements!
+<DATE><TIME>|<HOST>|E|psVectorSort (FILE:LINENO)
+    Error in psVectorSort:  Vector has less than 2 data entries!
