Index: /trunk/psLib/test/collections/Makefile.am
===================================================================
--- /trunk/psLib/test/collections/Makefile.am	(revision 3280)
+++ /trunk/psLib/test/collections/Makefile.am	(revision 3281)
@@ -18,6 +18,4 @@
          tst_psVector          \
          tst_psArray           \
-         tst_psArray01         \
-         tst_psArray02         \
          tst_psBitSet          \
          tst_psVectorSort_01   \
@@ -42,6 +40,4 @@
 tst_psVector_SOURCES = tst_psVector.c
 tst_psArray_SOURCES = tst_psArray.c
-tst_psArray01_SOURCES = tst_psArray01.c
-tst_psArray02_SOURCES = tst_psArray02.c
 tst_psBitSet_SOURCES = tst_psBitSet.c
 tst_psVectorSort_01_SOURCES = tst_psVectorSort_01.c
Index: /trunk/psLib/test/collections/tst_psArray.c
===================================================================
--- /trunk/psLib/test/collections/tst_psArray.c	(revision 3280)
+++ /trunk/psLib/test/collections/tst_psArray.c	(revision 3281)
@@ -17,6 +17,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2005-02-18 00:01:39 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -36,7 +36,37 @@
 testStruct;
 
-
-psS32 main(psS32 argc,
-           char* argv[])
+static int testStructCompare(const void **a, const void **b)
+{
+    testStruct* first = (testStruct*)*a;
+    testStruct* second = (testStruct*)*b;
+
+    if(first->x < second->x)
+        return -1;
+    else if (first->x > second->x)
+        return 1;
+    else
+        return 0;
+}
+
+static psS32 testArray( void );
+static psS32 testArray01( void );
+static psS32 testArrayAdd( void );
+
+testDescription tests[] = {
+                              {testArray, -1, "psArray", 0, false},
+                              {testArray01, -2, "psArray", 0, false},
+                              {testArrayAdd, 788, "psArrayAdd", 0, false},
+                              {NULL}
+                          };
+
+psS32 main( psS32 argc, char* argv[] )
+{
+    psLogSetLevel( PS_LOG_INFO );
+
+    return ( ! runTestSuite( stderr, "psArray", tests, argc, argv ) );
+}
+
+
+psS32 testArray(void)
 {
     // Create array of pointers
@@ -218,2 +248,188 @@
     return 0;
 }
+
+psS32 testArray01(void)
+{
+    // Create array of pointers
+    testStruct *mySt[10];
+
+    // Test A - Create void pointer array
+    printPositiveTestHeader(stdout,"psArray", "Create void pointer array");
+    psArray *psArr = psArrayAlloc(10);
+    if (psArr->nalloc != 10) {
+        psError(PS_ERR_UNKNOWN, true,"psArray didn't have proper number of elements.");
+        return 1;
+    }
+    printFooter(stdout, "psArray", "Create void pointer array", true);
+
+    // Test B - Add data to void pointer array
+    printPositiveTestHeader(stdout, "psArray", "Add data to void pointer array");
+    for(psS32 i = 0; i < 10; i++) {
+        testStruct *ts = psAlloc(sizeof(testStruct));
+        ts->x = 10*(10-i);
+        ts->y = 10.1*(10-i);
+        mySt[i] = ts;
+        psArr->data[i] = ts;
+        psMemIncrRefCounter(ts);
+    }
+
+    for(psS32 i = 0; i < 10; i++) {
+        testStruct *ts = (testStruct*)psArr->data[i];
+        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
+        if (fabsf(ts->x - 10*(10-i)) > 0.01f || fabsf(ts->y - 10.1*(10-i)) > 0.01f) {
+            psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array.");
+            return 2;
+        }
+    }
+    printf("array size = %d\n", psArr->nalloc);
+    if (psArr->nalloc != 10) {
+        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
+        return 3;
+    }
+    printf("array population = %d\n", psArr->n);
+    if (psArr->n != 10) {
+        psError(PS_ERR_UNKNOWN, true,"Array population wrong");
+        return 4;
+    }
+    printFooter(stdout, "psArray", "Add data to void pointer array", true);
+
+    // Test C - Sort data in array
+    printPositiveTestHeader(stdout,"psArray","Sort data in array");
+    psArr = psArraySort(psArr,testStructCompare);
+    for(psS32 i = 0; i < 10; i++) {
+        testStruct *ts = (testStruct*)psArr->data[i];
+        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
+        if (fabsf(ts->x - 10*(i+1)) > 0.01f || fabsf(ts->y - 10.1*(i+1)) > 0.01f) {
+            psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array.");
+            return 5;
+        }
+    }
+    printFooter(stdout,"psArray","Sort data in array",true);
+
+    // Test D - Attempt to sort null array
+    printPositiveTestHeader(stdout,"psArray","Attempt to sort array");
+    psArray* tempArr = psArraySort(NULL,testStructCompare);
+    if(tempArr != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Array sort did not return null when sorting null array");
+        return 6;
+    }
+    printFooter(stdout,"psArray","Attempt to sort array",true);
+
+    // Test E - Free void pointer array
+    printPositiveTestHeader(stdout, "psArray", "Free void pointer array");
+    psFree(psArr);
+    for(psS32 i = 0; i < 10; i++) {
+        psFree(mySt[i]);
+    }
+    if( psMemCheckLeaks(0, NULL, stdout, false) != 0) {
+        psError(PS_ERR_UNKNOWN,true,"Memory leaks detected.");
+        return 110;
+    }
+    psS32 nBad = psMemCheckCorruption(0);
+    if(nBad) {
+        printf("ERROR: Found %d bad memory blocks\n", nBad);
+        return 111;
+    }
+    printFooter(stdout, "psArray" ,"Free void pointer array", true);
+
+    return 0;
+}
+
+psS32 testArrayAdd( void )
+{
+    int subtest = 0;
+    float* data;
+    int nalloc = 5;
+    int n = 0;
+    int delta = 5;
+
+    // allocate the array.
+    psArray* arr = psArrayAlloc(nalloc);
+    arr->n = n;
+
+    // test arrayAdd until n == nalloc
+    while (n < nalloc) {
+        data = psAlloc(sizeof(float));
+        arr = psArrayAdd(arr, delta*2, data); // make delta unique versus next delta used.
+
+        subtest++;
+        if (arr->nalloc != nalloc) {
+            psError(PS_ERR_UNKNOWN,true,
+                    "psArrayAdd expanded the psArray unnecessarily.  n=%d",
+                    n);
+            return subtest;
+        }
+
+        subtest++;
+        if (arr->n != ++n) {
+            psError(PS_ERR_UNKNOWN,true,
+                    "psArrayAdd did not increment the size of the psArray. n=%d",
+                    n);
+            return subtest;
+        }
+
+        subtest++;
+        if (arr->data[n-1] != data) {
+            psError(PS_ERR_UNKNOWN,true,
+                    "psArrayAdd didn't set the element to data. n=%d",
+                    n);
+            return subtest;
+        }
+    }
+
+    // now try to add an element when the array is full.
+    data = psAlloc(sizeof(float));
+    arr = psArrayAdd(arr, delta, data);
+
+    // make sure the array was expanded
+    subtest++;
+    if (arr->nalloc != nalloc+delta) {
+        psError(PS_ERR_UNKNOWN,true,
+                "psArrayAdd did not expand the psArray when it was already full."
+                " old nalloc=%d, nalloc=%d, delta=%d",
+                nalloc, arr->nalloc, delta);
+        return subtest;
+    }
+    nalloc = arr->nalloc;
+
+    subtest++;
+    if (arr->n != ++n) {
+        psError(PS_ERR_UNKNOWN,true,
+                "psArrayAdd did not increment psArray.n by 1 after expanding it.");
+        return subtest;
+    }
+
+    subtest++;
+    if (arr->data[n-1] != data) {
+        psError(PS_ERR_UNKNOWN,true,
+                "psArrayAdd didn't set the second element to data.");
+        return subtest;
+    }
+
+    // make the array full again (operation tested already)
+    while (arr->n < arr->nalloc) {
+        data = psAlloc(sizeof(float));
+        arr = psArrayAdd(arr, 0, data);
+    }
+    nalloc = arr->nalloc;
+    n = arr->n;
+
+    // now add to full array with delta = 0; verify that the array is
+    // expanded by 10
+    data = psAlloc(sizeof(float));
+    arr = psArrayAdd(arr, 0, data);
+
+    subtest++;
+    if (arr->nalloc != nalloc+10) {
+        psError(PS_ERR_UNKNOWN,true,
+                "psArrayAdd did not expand the psArray by 10 when delta < 1."
+                " old nalloc=%d, nalloc=%d",
+                nalloc, arr->nalloc);
+        return subtest;
+    }
+
+    psFree(arr);
+
+    return 0;  // the value that indicates success is part of the testDescription
+}
+
Index: unk/psLib/test/collections/tst_psArray01.c
===================================================================
--- /trunk/psLib/test/collections/tst_psArray01.c	(revision 3280)
+++ 	(revision )
@@ -1,132 +1,0 @@
-/** @file  tst_psArray.c
- *
- *  @brief Test driver for psArray integer functions
- *
- *  This test driver contains the following tests for psArray test point 1:
- *     A)  Create void pointer array
- *     B)  Add data to void pointer array
- *     C)  Sort data in array
- *     D)  Attempt to sort data in invalid array
- *     E)  Free void pointer array
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-02-17 19:26:24 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include <math.h>
-
-#include "pslib.h"
-#include "psTest.h"
-
-typedef struct
-{
-    psS32 x;
-    float y;
-}
-testStruct;
-
-int testStructCompare(const void **a, const void **b)
-{
-    testStruct* first = (testStruct*)*a;
-    testStruct* second = (testStruct*)*b;
-
-    if(first->x < second->x)
-        return -1;
-    else if (first->x > second->x)
-        return 1;
-    else
-        return 0;
-}
-
-psS32 main(psS32 argc,
-           char* argv[])
-{
-    // Create array of pointers
-    testStruct *mySt[10];
-
-    // Test A - Create void pointer array
-    printPositiveTestHeader(stdout,"psArray", "Create void pointer array");
-    psArray *psArr = psArrayAlloc(10);
-    if (psArr->nalloc != 10) {
-        psError(PS_ERR_UNKNOWN, true,"psArray didn't have proper number of elements.");
-        return 1;
-    }
-    printFooter(stdout, "psArray", "Create void pointer array", true);
-
-    // Test B - Add data to void pointer array
-    printPositiveTestHeader(stdout, "psArray", "Add data to void pointer array");
-    for(psS32 i = 0; i < 10; i++) {
-        testStruct *ts = psAlloc(sizeof(testStruct));
-        ts->x = 10*(10-i);
-        ts->y = 10.1*(10-i);
-        mySt[i] = ts;
-        psArr->data[i] = ts;
-        psMemIncrRefCounter(ts);
-    }
-
-    for(psS32 i = 0; i < 10; i++) {
-        testStruct *ts = (testStruct*)psArr->data[i];
-        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
-        if (fabsf(ts->x - 10*(10-i)) > 0.01f || fabsf(ts->y - 10.1*(10-i)) > 0.01f) {
-            psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array.");
-            return 2;
-        }
-    }
-    printf("array size = %d\n", psArr->nalloc);
-    if (psArr->nalloc != 10) {
-        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
-        return 3;
-    }
-    printf("array population = %d\n", psArr->n);
-    if (psArr->n != 10) {
-        psError(PS_ERR_UNKNOWN, true,"Array population wrong");
-        return 4;
-    }
-    printFooter(stdout, "psArray", "Add data to void pointer array", true);
-
-    // Test C - Sort data in array
-    printPositiveTestHeader(stdout,"psArray","Sort data in array");
-    psArr = psArraySort(psArr,testStructCompare);
-    for(psS32 i = 0; i < 10; i++) {
-        testStruct *ts = (testStruct*)psArr->data[i];
-        printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
-        if (fabsf(ts->x - 10*(i+1)) > 0.01f || fabsf(ts->y - 10.1*(i+1)) > 0.01f) {
-            psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array.");
-            return 5;
-        }
-    }
-    printFooter(stdout,"psArray","Sort data in array",true);
-
-    // Test D - Attempt to sort null array
-    printPositiveTestHeader(stdout,"psArray","Attempt to sort array");
-    psArray* tempArr = psArraySort(NULL,testStructCompare);
-    if(tempArr != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Array sort did not return null when sorting null array");
-        return 6;
-    }
-    printFooter(stdout,"psArray","Attempt to sort array",true);
-
-    // Test E - Free void pointer array
-    printPositiveTestHeader(stdout, "psArray", "Free void pointer array");
-    psFree(psArr);
-    for(psS32 i = 0; i < 10; i++) {
-        psFree(mySt[i]);
-    }
-    if( psMemCheckLeaks(0, NULL, stdout, false) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Memory leaks detected.");
-        return 110;
-    }
-    psS32 nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-        return 111;
-    }
-    printFooter(stdout, "psArray" ,"Free void pointer array", true);
-
-    return 0;
-}
Index: unk/psLib/test/collections/tst_psArray02.c
===================================================================
--- /trunk/psLib/test/collections/tst_psArray02.c	(revision 3280)
+++ 	(revision )
@@ -1,128 +1,0 @@
-/** @file  tst_psImageManip.c
-*
-*  @brief Contains the tests for psImageManip.[ch]
-*
-*
-*  @author Robert DeSonia, MHPCC
-*
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:24 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include "psTest.h"
-#include "pslib.h"
-
-static psS32 testArrayAdd( void );
-
-testDescription tests[] = {
-                              {testArrayAdd, 788, "psArrayAdd", 0, false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psArray", tests, argc, argv ) );
-}
-
-psS32 testArrayAdd( void )
-{
-    int subtest = 0;
-    float* data;
-    int nalloc = 5;
-    int n = 0;
-    int delta = 5;
-
-    // allocate the array.
-    psArray* arr = psArrayAlloc(nalloc);
-    arr->n = n;
-
-    // test arrayAdd until n == nalloc
-    while (n < nalloc) {
-        data = psAlloc(sizeof(float));
-        arr = psArrayAdd(arr, delta*2, data); // make delta unique versus next delta used.
-
-        subtest++;
-        if (arr->nalloc != nalloc) {
-            psError(PS_ERR_UNKNOWN,true,
-                    "psArrayAdd expanded the psArray unnecessarily.  n=%d",
-                    n);
-            return subtest;
-        }
-
-        subtest++;
-        if (arr->n != ++n) {
-            psError(PS_ERR_UNKNOWN,true,
-                    "psArrayAdd did not increment the size of the psArray. n=%d",
-                    n);
-            return subtest;
-        }
-
-        subtest++;
-        if (arr->data[n-1] != data) {
-            psError(PS_ERR_UNKNOWN,true,
-                    "psArrayAdd didn't set the element to data. n=%d",
-                    n);
-            return subtest;
-        }
-    }
-
-    // now try to add an element when the array is full.
-    data = psAlloc(sizeof(float));
-    arr = psArrayAdd(arr, delta, data);
-
-    // make sure the array was expanded
-    subtest++;
-    if (arr->nalloc != nalloc+delta) {
-        psError(PS_ERR_UNKNOWN,true,
-                "psArrayAdd did not expand the psArray when it was already full."
-                " old nalloc=%d, nalloc=%d, delta=%d",
-                nalloc, arr->nalloc, delta);
-        return subtest;
-    }
-    nalloc = arr->nalloc;
-
-    subtest++;
-    if (arr->n != ++n) {
-        psError(PS_ERR_UNKNOWN,true,
-                "psArrayAdd did not increment psArray.n by 1 after expanding it.");
-        return subtest;
-    }
-
-    subtest++;
-    if (arr->data[n-1] != data) {
-        psError(PS_ERR_UNKNOWN,true,
-                "psArrayAdd didn't set the second element to data.");
-        return subtest;
-    }
-
-    // make the array full again (operation tested already)
-    while (arr->n < arr->nalloc) {
-        data = psAlloc(sizeof(float));
-        arr = psArrayAdd(arr, 0, data);
-    }
-    nalloc = arr->nalloc;
-    n = arr->n;
-
-    // now add to full array with delta = 0; verify that the array is
-    // expanded by 10
-    data = psAlloc(sizeof(float));
-    arr = psArrayAdd(arr, 0, data);
-
-    subtest++;
-    if (arr->nalloc != nalloc+10) {
-        psError(PS_ERR_UNKNOWN,true,
-                "psArrayAdd did not expand the psArray by 10 when delta < 1."
-                " old nalloc=%d, nalloc=%d",
-                nalloc, arr->nalloc);
-        return subtest;
-    }
-
-    psFree(arr);
-
-    return 0;  // the value that indicates success is part of the testDescription
-}
-
