Index: trunk/psLib/test/collections/Makefile
===================================================================
--- trunk/psLib/test/collections/Makefile	(revision 1230)
+++ trunk/psLib/test/collections/Makefile	(revision 1233)
@@ -3,6 +3,6 @@
 ##  Makefile:   test/collections
 ##
-##  $Revision: 1.19 $  $Name: not supported by cvs2svn $
-##  $Date: 2004-07-15 22:17:03 $
+##  $Revision: 1.20 $  $Name: not supported by cvs2svn $
+##  $Date: 2004-07-15 23:52:34 $
 ##
 ##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -29,8 +29,8 @@
          tst_psBitSet_07 \
          tst_psBitSet_08 \
-         tst_psSort_01   \
-         tst_psSort_02   \
-         tst_psSort_03   \
-         tst_psSort_04   \
+         tst_psVectorSort_01   \
+         tst_psVectorSort_02   \
+         tst_psVectorSort_03   \
+         tst_psVectorSort_04   \
          tst_psImage     \
          tst_psList
Index: trunk/psLib/test/collections/tst_psSort_01.c
===================================================================
--- trunk/psLib/test/collections/tst_psSort_01.c	(revision 1230)
+++ 	(revision )
@@ -1,83 +1,0 @@
-/** @file  tst_psSort_01.c
- *
- *  @brief Test driver for psSort functions
- *
- *  This test driver contains the following tests for psSort test point 1:
- *     A)  Create float vectors
- *     B)  Sort input float vector and put results into output float vector
- *     C)  Free float vectors
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-23 23:00:15 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib.h"
-#include "psTest.h"
-
-int main(int argc,
-         char* argv[])
-{
-    psVector *in = NULL;
-    psVector *out = NULL;
-    psVector *tempVec = NULL;
-
-
-    // Test A - Create float vectors
-    printPositiveTestHeader(stdout,"psSort", "Create float vectors");
-    in = psVectorAlloc(7, PS_TYPE_F32);
-    in->n = 7;
-    out = psVectorAlloc(7, PS_TYPE_F32);
-    out->n = 7;
-    in->data.F32[0] = 7.0f;
-    in->data.F32[1] = 9.0f;
-    in->data.F32[2] = 3.0f;
-    in->data.F32[3] = 1.0f;
-    in->data.F32[4] = 5.0f;
-    in->data.F32[5] = 5.0f;
-    in->data.F32[6] = -20.0f;
-    for(int i=0; i<7; i++) {
-        printf("vec[%d] = %f\n", i, in->data.F32[i]);
-    }
-    printFooter(stdout, "psSort", "Create float vectors", true);
-
-
-    // Test B - Sort input float vector and put results into output float vector
-    printPositiveTestHeader(stdout,"psSort", "Sort float vector");
-    tempVec = out;
-    out = psSort(out, in);
-    for(int i=0; i<7; i++) {
-        printf("vec[%d] = %f\n", i, out->data.F32[i]);
-    }
-    if(out != tempVec) {
-        printf("Error: Return pointer not equal to output argument pointer\n");
-    }
-    printFooter(stdout, "psSort", "Sort float vector", true);
-
-
-    // Test C - Sort input float vector into itself
-    printPositiveTestHeader(stdout,"psSort", "Sort input float vector into itself");
-    in = psSort(in, in);
-    for(int i=0; i<7; i++) {
-        printf("vec[%d] = %f\n", i, out->data.F32[i]);
-    }
-    printFooter(stdout, "psSort", "Sort input float vector into itself", true);
-
-
-    // Test D - Free float vectors
-    printPositiveTestHeader(stdout,"psSort", "Free float vectors");
-    psFree(in);
-    psFree(out);
-    psMemCheckLeaks(0, NULL, stdout);
-    int nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-    }
-    printFooter(stdout, "psSort", "Free float vectors", true);
-
-    return 0;
-}
Index: trunk/psLib/test/collections/tst_psSort_02.c
===================================================================
--- trunk/psLib/test/collections/tst_psSort_02.c	(revision 1230)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/** @file  tst_psSort_02.c
- *
- *  @brief Test driver for psSort functions
- *
- *  This test driver contains the following tests for psSort test point 2:
- *     A)  Create vectors
- *     B)  Sort integer vector of indices based on pre-sort order of floating point vector
- *     C)  Free vectors
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-23 23:00:15 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib.h"
-#include "psTest.h"
-
-int main(int argc,
-         char* argv[])
-{
-    psVector *in = NULL;
-    psVector *out = NULL;
-
-
-    // Test A - Create float vectors
-    printPositiveTestHeader(stdout,"psSort", "Create vectors");
-    in = psVectorAlloc(5, PS_TYPE_F32);
-    in->n = 5;
-    out = psVectorAlloc(5, PS_TYPE_F32);
-    out->n = 5;
-    in->data.F32[0] = 7.0f;
-    in->data.F32[1] = 9.0f;
-    in->data.F32[2] = 3.0f;
-    in->data.F32[3] = 1.0f;
-    in->data.F32[4] = 5.0f;
-    for(int i=0; i<5; i++) {
-        printf("arr[%d] = %f\n", i, in->data.F32[i]);
-    }
-    printFooter(stdout, "psSort", "Create vectors", true);
-
-
-    // Test B - Sort integer vector of indices based on pre-sort order of floating point vector
-    printPositiveTestHeader(stdout,"psSort", "Create sorted index vector");
-    out = psSortIndex(out, in);
-    for(int i=0; i<5; i++) {
-        printf("arr[%d] = %d\n", i, out->data.S32[i]);
-    }
-    printFooter(stdout, "psSort", "Create sorted index vector", true);
-
-
-    // Test C - Free vectors
-    printPositiveTestHeader(stdout,"psSort", "Free vectors");
-    psFree(in);
-    psFree(out);
-    psMemCheckLeaks(0, NULL, stdout);
-    int nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-    }
-    printFooter(stdout, "psSort", "Free vectors", true);
-
-}
Index: trunk/psLib/test/collections/tst_psSort_03.c
===================================================================
--- trunk/psLib/test/collections/tst_psSort_03.c	(revision 1230)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/** @file  tst_psSort_03.c
- *
- *  @brief Test driver for psSort functions
- *
- *  This test driver contains the following tests for psSort test point 3:
- *     A)  Create float vectors of different sizes
- *     B)  Attempt to sort vectors...should get errors
- *     C)  Free float vectors
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-23 23:00:15 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib.h"
-#include "psTest.h"
-
-int main(int argc,
-         char* argv[])
-{
-    psVector *in = NULL;
-    psVector *out = NULL;
-
-
-    // Test A - Create float vectors
-    printPositiveTestHeader(stdout,"psSort", "Create float vectors of different sizes");
-    in = psVectorAlloc(5, PS_TYPE_F32);
-    in->n = 5;
-    out = psVectorAlloc(6, PS_TYPE_F32);
-    out->n = 6;
-    in->n = 5;
-    for(int i=0; i<5; i++) {
-        printf("arr[%d] = %f\n", i, in->data.F32[i]);
-    }
-    printFooter(stdout, "psSort", "Create float vectors of different sizes", true);
-
-
-    // Test B - Sort input float vector and put results into output float vector
-    printNegativeTestHeader(stdout,"psSort", "Sort float vector",
-                            "Input and output vector sizes are not equal", 0);
-    out = psSort(out, in);
-    printFooter(stdout, "psSort", "Sort float vector", true);
-
-
-    // Test C - Free float vectors
-    printPositiveTestHeader(stdout,"psSort", "Free float vectors");
-    psFree(in);
-    psFree(out);
-    psMemCheckLeaks(0, NULL, stdout);
-    int nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-    }
-    printFooter(stdout, "psSort", "Free float vectors", true);
-
-}
Index: trunk/psLib/test/collections/tst_psSort_04.c
===================================================================
--- trunk/psLib/test/collections/tst_psSort_04.c	(revision 1230)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/** @file  tst_psSort_04.c
- *
- *  @brief Test driver for psSort functions
- *
- *  This test driver contains the following tests for psSort test point 4:
- *     A)  Attempt to sort with null input vector
- *     B)  Free vectors
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-23 23:00:15 $
- *
- *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib.h"
-#include "psTest.h"
-
-int main(int argc,
-         char* argv[])
-{
-    psVector *badIn = NULL;
-    psVector *goodOut = psVectorAlloc(5, PS_TYPE_F32);
-
-    // Test A - Attempt to sort with null input vector
-    printNegativeTestHeader(stdout,"psSort", "Attempt to sort with null input vector",
-                            "Null input vector", 0);
-    goodOut = psSort(goodOut, badIn);
-    printFooter(stdout, "psSort", "Attempt to sort with null input vector", true);
-
-    // Test B - Free vectors
-    printPositiveTestHeader(stdout, "psSort", "Free vectors");
-    psFree(goodOut);
-    psMemCheckLeaks(0, NULL, stdout);
-    int nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-    }
-    printFooter(stdout, "psSort", "Free arays", true);
-
-    return 0;
-}
Index: trunk/psLib/test/collections/tst_psVector.c
===================================================================
--- trunk/psLib/test/collections/tst_psVector.c	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVector.c	(revision 1233)
@@ -0,0 +1,107 @@
+/** @file  tst_psVector.c
+ *
+ *  @brief Test driver for psVector integer functions
+ *
+ *  This test driver contains the following tests for psVector test point 1:
+ *     A)  Create S32 vector
+ *     B)  Add data to S32 vector
+ *     C)  Reallocate S32 vector bigger
+ *     D)  Reallocate S32 vector smaller
+ *     E)  Free S32 vector
+ *     F)  Attempt to create a S32 vector with zero size
+ *     G)  Attempt to realloc a null S32 vector
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+
+
+    // Test A - Create S32 vector
+    printPositiveTestHeader(stdout,"psVector", "Create S32 vector");
+    psVector *psVec = psVectorAlloc(5, PS_TYPE_S32);
+    printf("Vector size = %d\n", psVec->nalloc);
+    printf("Vector type = %d\n", psVec->type.type);
+    printf("Vector dimen = %d\n", psVec->type.dimen);
+    printFooter(stdout, "psVector", "Create S32 vector", true);
+
+
+    // Test B - Add data to integer vector
+    printPositiveTestHeader(stdout, "psVector", "Add data to S32 vector");
+    for(int i = 0; i < 5; i++) {
+        psVec->data.S32[i] = i*10;
+        printf("Elem %d = %d\n", i, psVec->data.S32[i]);
+    }
+    printf("Vector size = %d\n", psVec->nalloc);
+    printf("Vector population = %d\n", psVec->n);
+    printFooter(stdout, "psVector", "Add data to S32 vector", true);
+
+
+    // Test C - Reallocate S32 vector bigger
+    printPositiveTestHeader(stdout,"psVector", "Reallocate S32 vector bigger");
+    psVec = psVectorRealloc(10, psVec);
+    printf("Adding more elements to S32 vector...\n");
+    for(int i = 5; i < 10; i++) {
+        psVec->data.S32[i] = i*10;
+        psVec->n++;
+        printf("Elem %d = %d\n", i, psVec->data.S32[i]);
+    }
+    printf("Vector size = %d\n", psVec->nalloc);
+    printf("Vector population = %d\n", psVec->n);
+    printFooter(stdout, "psVector", "Reallocate S32 vector bigger", true);
+
+
+    // Test D - Reallocate S32 vector smaller
+    printPositiveTestHeader(stdout,"psVector","Reallocate S32 vector smaller");
+    psVec = psVectorRealloc(3, psVec);
+    printf("Vector size = %d\n", psVec->nalloc);
+    for(int i = 0; i < 3; i++) {
+        printf("Elem %d = %d\n", i, psVec->data.S32[i]);
+    }
+    printf("Vector size = %d\n", psVec->nalloc);
+    printf("Vector population = %d\n", psVec->n);
+    printFooter(stdout, "psVector", "Reallocate integer S32 smaller", true);
+
+
+    // Test E - Free S32 vector
+    printPositiveTestHeader(stdout, "psVector", "Free S32 vector");
+    psFree(psVec);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psVector" ,"Free S32 vector", true);
+
+
+    // Test F - Attempt to create a S32 vector with zero size
+    printNegativeTestHeader(stdout,"psVector", "Attempt to create a S32 vector with zero size",
+                            "Invalid value for nalloc", 0);
+    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error message.");
+    psVector *vecBad = psVectorAlloc(0, PS_TYPE_S32);
+    if(vecBad != NULL) {
+        printf("ERROR: Return is not NULL\n");
+    }
+    printFooter(stdout, "psVector", "Attempt to create a S32 vector with zero size", true);
+
+
+    // Test G - Attempt to realloc a null S32 vector
+    printNegativeTestHeader(stdout,"psVector", "Attempt to realloc a null S32 vector",
+                            "Null input vector", 0);
+    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error message.");
+    psVectorRealloc(6, NULL);
+    printFooter(stdout, "psVector", "Attempt to realloc a null S32 vector", true);
+
+    return 0;
+}
Index: trunk/psLib/test/collections/tst_psVectorSort_01.c
===================================================================
--- trunk/psLib/test/collections/tst_psVectorSort_01.c	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVectorSort_01.c	(revision 1233)
@@ -0,0 +1,83 @@
+/** @file  tst_psVectorSort_01.c
+ *
+ *  @brief Test driver for psVectorSort functions
+ *
+ *  This test driver contains the following tests for psVectorSort test point 1:
+ *     A)  Create float vectors
+ *     B)  Sort input float vector and put results into output float vector
+ *     C)  Free float vectors
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+    psVector *in = NULL;
+    psVector *out = NULL;
+    psVector *tempVec = NULL;
+
+
+    // Test A - Create float vectors
+    printPositiveTestHeader(stdout,"psVectorSort", "Create float vectors");
+    in = psVectorAlloc(7, PS_TYPE_F32);
+    in->n = 7;
+    out = psVectorAlloc(7, PS_TYPE_F32);
+    out->n = 7;
+    in->data.F32[0] = 7.0f;
+    in->data.F32[1] = 9.0f;
+    in->data.F32[2] = 3.0f;
+    in->data.F32[3] = 1.0f;
+    in->data.F32[4] = 5.0f;
+    in->data.F32[5] = 5.0f;
+    in->data.F32[6] = -20.0f;
+    for(int i=0; i<7; i++) {
+        printf("vec[%d] = %f\n", i, in->data.F32[i]);
+    }
+    printFooter(stdout, "psVectorSort", "Create float vectors", true);
+
+
+    // Test B - Sort input float vector and put results into output float vector
+    printPositiveTestHeader(stdout,"psVectorSort", "Sort float vector");
+    tempVec = out;
+    out = psVectorSort(out, in);
+    for(int i=0; i<7; i++) {
+        printf("vec[%d] = %f\n", i, out->data.F32[i]);
+    }
+    if(out != tempVec) {
+        printf("Error: Return pointer not equal to output argument pointer\n");
+    }
+    printFooter(stdout, "psVectorSort", "Sort float vector", true);
+
+
+    // Test C - Sort input float vector into itself
+    printPositiveTestHeader(stdout,"psVectorSort", "Sort input float vector into itself");
+    in = psVectorSort(in, in);
+    for(int i=0; i<7; i++) {
+        printf("vec[%d] = %f\n", i, out->data.F32[i]);
+    }
+    printFooter(stdout, "psVectorSort", "Sort input float vector into itself", true);
+
+
+    // Test D - Free float vectors
+    printPositiveTestHeader(stdout,"psVectorSort", "Free float vectors");
+    psFree(in);
+    psFree(out);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psVectorSort", "Free float vectors", true);
+
+    return 0;
+}
Index: trunk/psLib/test/collections/tst_psVectorSort_01.c~
===================================================================
--- trunk/psLib/test/collections/tst_psVectorSort_01.c~	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVectorSort_01.c~	(revision 1233)
@@ -0,0 +1,83 @@
+/** @file  tst_psSort_01.c
+ *
+ *  @brief Test driver for psSort functions
+ *
+ *  This test driver contains the following tests for psSort test point 1:
+ *     A)  Create float vectors
+ *     B)  Sort input float vector and put results into output float vector
+ *     C)  Free float vectors
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+    psVector *in = NULL;
+    psVector *out = NULL;
+    psVector *tempVec = NULL;
+
+
+    // Test A - Create float vectors
+    printPositiveTestHeader(stdout,"psSort", "Create float vectors");
+    in = psVectorAlloc(7, PS_TYPE_F32);
+    in->n = 7;
+    out = psVectorAlloc(7, PS_TYPE_F32);
+    out->n = 7;
+    in->data.F32[0] = 7.0f;
+    in->data.F32[1] = 9.0f;
+    in->data.F32[2] = 3.0f;
+    in->data.F32[3] = 1.0f;
+    in->data.F32[4] = 5.0f;
+    in->data.F32[5] = 5.0f;
+    in->data.F32[6] = -20.0f;
+    for(int i=0; i<7; i++) {
+        printf("vec[%d] = %f\n", i, in->data.F32[i]);
+    }
+    printFooter(stdout, "psSort", "Create float vectors", true);
+
+
+    // Test B - Sort input float vector and put results into output float vector
+    printPositiveTestHeader(stdout,"psSort", "Sort float vector");
+    tempVec = out;
+    out = psSort(out, in);
+    for(int i=0; i<7; i++) {
+        printf("vec[%d] = %f\n", i, out->data.F32[i]);
+    }
+    if(out != tempVec) {
+        printf("Error: Return pointer not equal to output argument pointer\n");
+    }
+    printFooter(stdout, "psSort", "Sort float vector", true);
+
+
+    // Test C - Sort input float vector into itself
+    printPositiveTestHeader(stdout,"psSort", "Sort input float vector into itself");
+    in = psSort(in, in);
+    for(int i=0; i<7; i++) {
+        printf("vec[%d] = %f\n", i, out->data.F32[i]);
+    }
+    printFooter(stdout, "psSort", "Sort input float vector into itself", true);
+
+
+    // Test D - Free float vectors
+    printPositiveTestHeader(stdout,"psSort", "Free float vectors");
+    psFree(in);
+    psFree(out);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psSort", "Free float vectors", true);
+
+    return 0;
+}
Index: trunk/psLib/test/collections/tst_psVectorSort_02.c
===================================================================
--- trunk/psLib/test/collections/tst_psVectorSort_02.c	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVectorSort_02.c	(revision 1233)
@@ -0,0 +1,66 @@
+/** @file  tst_psVectorSort_02.c
+ *
+ *  @brief Test driver for psVectorSort functions
+ *
+ *  This test driver contains the following tests for psVectorSort test point 2:
+ *     A)  Create vectors
+ *     B)  Sort integer vector of indices based on pre-sort order of floating point vector
+ *     C)  Free vectors
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+    psVector *in = NULL;
+    psVector *out = NULL;
+
+
+    // Test A - Create float vectors
+    printPositiveTestHeader(stdout,"psVectorSort", "Create vectors");
+    in = psVectorAlloc(5, PS_TYPE_F32);
+    in->n = 5;
+    out = psVectorAlloc(5, PS_TYPE_F32);
+    out->n = 5;
+    in->data.F32[0] = 7.0f;
+    in->data.F32[1] = 9.0f;
+    in->data.F32[2] = 3.0f;
+    in->data.F32[3] = 1.0f;
+    in->data.F32[4] = 5.0f;
+    for(int i=0; i<5; i++) {
+        printf("arr[%d] = %f\n", i, in->data.F32[i]);
+    }
+    printFooter(stdout, "psVectorSort", "Create vectors", true);
+
+
+    // Test B - Sort integer vector of indices based on pre-sort order of floating point vector
+    printPositiveTestHeader(stdout,"psVectorSort", "Create sorted index vector");
+    out = psVectorSortIndex(out, in);
+    for(int i=0; i<5; i++) {
+        printf("arr[%d] = %d\n", i, out->data.S32[i]);
+    }
+    printFooter(stdout, "psVectorSort", "Create sorted index vector", true);
+
+
+    // Test C - Free vectors
+    printPositiveTestHeader(stdout,"psVectorSort", "Free vectors");
+    psFree(in);
+    psFree(out);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psVectorSort", "Free vectors", true);
+
+}
Index: trunk/psLib/test/collections/tst_psVectorSort_02.c~
===================================================================
--- trunk/psLib/test/collections/tst_psVectorSort_02.c~	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVectorSort_02.c~	(revision 1233)
@@ -0,0 +1,66 @@
+/** @file  tst_psSort_02.c
+ *
+ *  @brief Test driver for psSort functions
+ *
+ *  This test driver contains the following tests for psSort test point 2:
+ *     A)  Create vectors
+ *     B)  Sort integer vector of indices based on pre-sort order of floating point vector
+ *     C)  Free vectors
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+    psVector *in = NULL;
+    psVector *out = NULL;
+
+
+    // Test A - Create float vectors
+    printPositiveTestHeader(stdout,"psSort", "Create vectors");
+    in = psVectorAlloc(5, PS_TYPE_F32);
+    in->n = 5;
+    out = psVectorAlloc(5, PS_TYPE_F32);
+    out->n = 5;
+    in->data.F32[0] = 7.0f;
+    in->data.F32[1] = 9.0f;
+    in->data.F32[2] = 3.0f;
+    in->data.F32[3] = 1.0f;
+    in->data.F32[4] = 5.0f;
+    for(int i=0; i<5; i++) {
+        printf("arr[%d] = %f\n", i, in->data.F32[i]);
+    }
+    printFooter(stdout, "psSort", "Create vectors", true);
+
+
+    // Test B - Sort integer vector of indices based on pre-sort order of floating point vector
+    printPositiveTestHeader(stdout,"psSort", "Create sorted index vector");
+    out = psSortIndex(out, in);
+    for(int i=0; i<5; i++) {
+        printf("arr[%d] = %d\n", i, out->data.S32[i]);
+    }
+    printFooter(stdout, "psSort", "Create sorted index vector", true);
+
+
+    // Test C - Free vectors
+    printPositiveTestHeader(stdout,"psSort", "Free vectors");
+    psFree(in);
+    psFree(out);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psSort", "Free vectors", true);
+
+}
Index: trunk/psLib/test/collections/tst_psVectorSort_03.c
===================================================================
--- trunk/psLib/test/collections/tst_psVectorSort_03.c	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVectorSort_03.c	(revision 1233)
@@ -0,0 +1,60 @@
+/** @file  tst_psVectorSort_03.c
+ *
+ *  @brief Test driver for psVectorSort functions
+ *
+ *  This test driver contains the following tests for psVectorSort test point 3:
+ *     A)  Create float vectors of different sizes
+ *     B)  Attempt to sort vectors...should get errors
+ *     C)  Free float vectors
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+    psVector *in = NULL;
+    psVector *out = NULL;
+
+
+    // Test A - Create float vectors
+    printPositiveTestHeader(stdout,"psVectorSort", "Create float vectors of different sizes");
+    in = psVectorAlloc(5, PS_TYPE_F32);
+    in->n = 5;
+    out = psVectorAlloc(6, PS_TYPE_F32);
+    out->n = 6;
+    in->n = 5;
+    for(int i=0; i<5; i++) {
+        printf("arr[%d] = %f\n", i, in->data.F32[i]);
+    }
+    printFooter(stdout, "psVectorSort", "Create float vectors of different sizes", true);
+
+
+    // Test B - Sort input float vector and put results into output float vector
+    printNegativeTestHeader(stdout,"psVectorSort", "Sort float vector",
+                            "Input and output vector sizes are not equal", 0);
+    out = psVectorSort(out, in);
+    printFooter(stdout, "psVectorSort", "Sort float vector", true);
+
+
+    // Test C - Free float vectors
+    printPositiveTestHeader(stdout,"psVectorSort", "Free float vectors");
+    psFree(in);
+    psFree(out);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psVectorSort", "Free float vectors", true);
+
+}
Index: trunk/psLib/test/collections/tst_psVectorSort_03.c~
===================================================================
--- trunk/psLib/test/collections/tst_psVectorSort_03.c~	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVectorSort_03.c~	(revision 1233)
@@ -0,0 +1,60 @@
+/** @file  tst_psSort_03.c
+ *
+ *  @brief Test driver for psSort functions
+ *
+ *  This test driver contains the following tests for psSort test point 3:
+ *     A)  Create float vectors of different sizes
+ *     B)  Attempt to sort vectors...should get errors
+ *     C)  Free float vectors
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+    psVector *in = NULL;
+    psVector *out = NULL;
+
+
+    // Test A - Create float vectors
+    printPositiveTestHeader(stdout,"psSort", "Create float vectors of different sizes");
+    in = psVectorAlloc(5, PS_TYPE_F32);
+    in->n = 5;
+    out = psVectorAlloc(6, PS_TYPE_F32);
+    out->n = 6;
+    in->n = 5;
+    for(int i=0; i<5; i++) {
+        printf("arr[%d] = %f\n", i, in->data.F32[i]);
+    }
+    printFooter(stdout, "psSort", "Create float vectors of different sizes", true);
+
+
+    // Test B - Sort input float vector and put results into output float vector
+    printNegativeTestHeader(stdout,"psSort", "Sort float vector",
+                            "Input and output vector sizes are not equal", 0);
+    out = psSort(out, in);
+    printFooter(stdout, "psSort", "Sort float vector", true);
+
+
+    // Test C - Free float vectors
+    printPositiveTestHeader(stdout,"psSort", "Free float vectors");
+    psFree(in);
+    psFree(out);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psSort", "Free float vectors", true);
+
+}
Index: trunk/psLib/test/collections/tst_psVectorSort_04.c
===================================================================
--- trunk/psLib/test/collections/tst_psVectorSort_04.c	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVectorSort_04.c	(revision 1233)
@@ -0,0 +1,44 @@
+/** @file  tst_psVectorSort_04.c
+ *
+ *  @brief Test driver for psVectorSort functions
+ *
+ *  This test driver contains the following tests for psVectorSort test point 4:
+ *     A)  Attempt to sort with null input vector
+ *     B)  Free vectors
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+    psVector *badIn = NULL;
+    psVector *goodOut = psVectorAlloc(5, PS_TYPE_F32);
+
+    // Test A - Attempt to sort with null input vector
+    printNegativeTestHeader(stdout,"psVectorSort", "Attempt to sort with null input vector",
+                            "Null input vector", 0);
+    goodOut = psVectorSort(goodOut, badIn);
+    printFooter(stdout, "psVectorSort", "Attempt to sort with null input vector", true);
+
+    // Test B - Free vectors
+    printPositiveTestHeader(stdout, "psVectorSort", "Free vectors");
+    psFree(goodOut);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psVectorSort", "Free arays", true);
+
+    return 0;
+}
Index: trunk/psLib/test/collections/tst_psVectorSort_04.c~
===================================================================
--- trunk/psLib/test/collections/tst_psVectorSort_04.c~	(revision 1233)
+++ trunk/psLib/test/collections/tst_psVectorSort_04.c~	(revision 1233)
@@ -0,0 +1,44 @@
+/** @file  tst_psSort_04.c
+ *
+ *  @brief Test driver for psSort functions
+ *
+ *  This test driver contains the following tests for psSort test point 4:
+ *     A)  Attempt to sort with null input vector
+ *     B)  Free vectors
+ *
+ *  @author  Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-07-15 23:52:34 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ *
+ */
+
+#include "pslib.h"
+#include "psTest.h"
+
+int main(int argc,
+         char* argv[])
+{
+    psVector *badIn = NULL;
+    psVector *goodOut = psVectorAlloc(5, PS_TYPE_F32);
+
+    // Test A - Attempt to sort with null input vector
+    printNegativeTestHeader(stdout,"psSort", "Attempt to sort with null input vector",
+                            "Null input vector", 0);
+    goodOut = psSort(goodOut, badIn);
+    printFooter(stdout, "psSort", "Attempt to sort with null input vector", true);
+
+    // Test B - Free vectors
+    printPositiveTestHeader(stdout, "psSort", "Free vectors");
+    psFree(goodOut);
+    psMemCheckLeaks(0, NULL, stdout);
+    int nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+    }
+    printFooter(stdout, "psSort", "Free arays", true);
+
+    return 0;
+}
Index: trunk/psLib/test/collections/verified/tst_psVectorSort_03.stderr
===================================================================
--- trunk/psLib/test/collections/verified/tst_psVectorSort_03.stderr	(revision 1233)
+++ trunk/psLib/test/collections/verified/tst_psVectorSort_03.stderr	(revision 1233)
@@ -0,0 +1,1 @@
+ <DATE> <TIME> |<HOST>|E|   psVectorSort| : Line 178 - Input and output vector sizes are not equal: in=5 out=6
Index: trunk/psLib/test/collections/verified/tst_psVectorSort_03.stdout
===================================================================
--- trunk/psLib/test/collections/verified/tst_psVectorSort_03.stdout	(revision 1233)
+++ trunk/psLib/test/collections/verified/tst_psVectorSort_03.stdout	(revision 1233)
@@ -0,0 +1,34 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psVectorSort_03.c                                      *
+*            TestPoint: psVectorSort{Create float vectors of different sizes}      *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+arr[0] = 0.000000
+arr[1] = 0.000000
+arr[2] = 0.000000
+arr[3] = 0.000000
+arr[4] = 0.000000
+
+---> TESTPOINT PASSED (psVectorSort{Create float vectors of different sizes} | tst_psVectorSort_03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psVectorSort_03.c                                      *
+*            TestPoint: psVectorSort{Sort float vector}                            *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Input and output vector sizes are not equal                *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psVectorSort{Sort float vector} | tst_psVectorSort_03.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psVectorSort_03.c                                      *
+*            TestPoint: psVectorSort{Free float vectors}                           *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psVectorSort{Free float vectors} | tst_psVectorSort_03.c)
+
Index: trunk/psLib/test/collections/verified/tst_psVectorSort_04.stderr
===================================================================
--- trunk/psLib/test/collections/verified/tst_psVectorSort_04.stderr	(revision 1233)
+++ trunk/psLib/test/collections/verified/tst_psVectorSort_04.stderr	(revision 1233)
@@ -0,0 +1,1 @@
+ <DATE> <TIME> |<HOST>|E|   psVectorSort| : Line 160 - Null input vector
Index: trunk/psLib/test/collections/verified/tst_psVectorSort_04.stdout
===================================================================
--- trunk/psLib/test/collections/verified/tst_psVectorSort_04.stdout	(revision 1233)
+++ trunk/psLib/test/collections/verified/tst_psVectorSort_04.stdout	(revision 1233)
@@ -0,0 +1,20 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psVectorSort_04.c                                      *
+*            TestPoint: psVectorSort{Attempt to sort with null input vector}       *
+*             TestType: Negative                                                   *
+*    ExpectedErrorText: Null input vector                                          *
+*  ExpectedStatusValue: 0                                                          *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psVectorSort{Attempt to sort with null input vector} | tst_psVectorSort_04.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psVectorSort_04.c                                      *
+*            TestPoint: psVectorSort{Free vectors}                                 *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psVectorSort{Free arays} | tst_psVectorSort_04.c)
+
