Index: trunk/psLib/src/sys/psString.c
===================================================================
--- trunk/psLib/src/sys/psString.c	(revision 41166)
+++ trunk/psLib/src/sys/psString.c	(revision 41171)
@@ -107,4 +107,5 @@
 
     // Check the number of characters to copy is non-negative
+    // XXX need to limit nChar to < memtotal
     if (nChar < 0) {
         // Log error message and return NULL
Index: trunk/psLib/test/astro/tap_psTime_03.c
===================================================================
--- trunk/psLib/test/astro/tap_psTime_03.c	(revision 41166)
+++ trunk/psLib/test/astro/tap_psTime_03.c	(revision 41171)
@@ -494,5 +494,5 @@
             psFree(timeStr);
 
-            bool status = psTimeConvert(time, PS_TIME_TT);
+            psTimeConvert(time, PS_TIME_TT);
             timeStr = psTimeToISO(time);
             is_str(timeStr, testTimeBStrTT[i], "TT ISO string");
@@ -500,5 +500,5 @@
 
             // Verify UTC ISO string
-            status = psTimeConvert(time, PS_TIME_UTC);
+            psTimeConvert(time, PS_TIME_UTC);
             time->leapsecond = testTimeBLeapsecond[i];
             timeStr = psTimeToISO(time);
@@ -506,5 +506,5 @@
             psFree(timeStr);
 
-            status = psTimeConvert(time, PS_TIME_UT1);
+            psTimeConvert(time, PS_TIME_UT1);
             timeStr = psTimeToISO(time);
             is_str(timeStr, testTimeBStrUT1[i], "UT1 ISO string");
Index: trunk/psLib/test/fft/tst_psImageFFT.c
===================================================================
--- trunk/psLib/test/fft/tst_psImageFFT.c	(revision 41166)
+++ 	(revision )
@@ -1,664 +1,0 @@
-/** @file  tst_psImageFFT.c
- *
- *  @brief Contains the tests for psFFT.[ch]
- *
- *
- *  @author Robert DeSonia, MHPCC
- *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-13 02:46:59 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- */
-
-#include <complex.h>
-#include <math.h>
-#include <float.h>
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-#define GENIMAGE(img,c,r,TYP, valueFcn) \
-img = psImageAlloc(c,r,PS_TYPE_##TYP); \
-for (psU32 row=0;row<r;row++) { \
-    ps##TYP* imgRow = img->data.TYP[row]; \
-    for (psU32 col=0;col<c;col++) { \
-        imgRow[col] = (ps##TYP)(valueFcn); \
-    } \
-}
-
-static psS32 testImageFFT(void);
-static psS32 testImageRealImaginary(void);
-static psS32 testImageComplex(void);
-static psS32 testImageConjugate(void);
-static psS32 testImagePowerSpectrum(void);
-
-testDescription tests[] = {
-                              {testImageFFT,632,"psImageFFT",0,false},
-                              {testImageRealImaginary,633,"psImageRealImaginary",0,false},
-                              {testImageComplex,634,"psImageComplex",0,false},
-                              {testImageConjugate,635,"psImageConjugate",0,false},
-                              {testImagePowerSpectrum,636,"psImagePowerSpectrum",0,false},
-                              {NULL}
-                          };
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    return (! runTestSuite(stderr,"psFFT",tests,argc,argv) );
-}
-
-psS32 testImageFFT(void)
-{
-    psImage* img = NULL;
-    psImage* img2 = NULL;
-    psImage* img3 = NULL;
-    psU32 m = 128;
-    psU32 n = 64;
-    psImage* img4 = NULL;
-    psImage* img5 = NULL;
-
-    /*
-    1. assign a image to a radial sinisoid
-    2. perform a forward transform
-    3. verify that the only significant component cooresponds to the freqency of the input in step 1.
-    4. perform a reverse transform
-    5. compare to original (should be equal to within a reasonable error)
-    */
-
-    // 1. assign a image to a radial sinisoid
-    GENIMAGE(img,m,n,F32, sinf((32.0f-row)/32.0f*M_PI)+sinf((64.0f-col)/64.0f*M_PI));
-
-    // 2. perform a forward transform
-    img2 = psImageFFT(img2,img,PS_FFT_FORWARD);
-    if (img2->type.type != PS_TYPE_C32) {
-        psError(PS_ERR_UNKNOWN, true,"FFT didn't produce complex values?");
-        return 1;
-    }
-    if (img2->numCols != m || img2->numRows != n) {
-        psError(PS_ERR_UNKNOWN, true,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).",
-                img2->numCols,img2->numRows,m,n);
-        return 2;
-    }
-
-    // 3. verify that the only significant component cooresponds to the freqency of the input in step 1.
-    for (psU32 row=0;row<n;row++) {
-        psC32* img2Row = img2->data.C32[row];
-        for (psU32 col=0;col<m;col++) {
-            psF32 mag = cabsf(img2Row[col])/m/n;
-            if (mag > 0.1f) {
-                // must be (0,1) or (0,n-1) or (1,0) or (m-1,0)
-                if (! (col == 0 && (row == 1 || row == n-1))
-                        && ! (row == 0 && (col==1 || col == m-1)) ) {
-                    psError(PS_ERR_UNKNOWN, true,"Result invalid at %d,%d (%.2f)",col,row,mag);
-                    return 3;
-                }
-            } else
-                if ( (col == 0 && (row == 1 || row == n-1))
-                        || (row == 0 && (col==1 || col == m-1)) ) {
-                    psError(PS_ERR_UNKNOWN, true,"Result invalid at %d,%d (%.2f)",col,row,mag);
-                    return 4;
-                }
-        }
-    }
-
-
-    // 4. perform a reverse transform
-    img3 = psImageFFT(img3,img2,PS_FFT_REVERSE);
-
-    if (img3->type.type != PS_TYPE_C32) {
-        psError(PS_ERR_UNKNOWN, true,"FFT didn't produce complex values?");
-        return 5;
-    }
-
-    if (img3->numCols != m || img3->numRows != n) {
-        psError(PS_ERR_UNKNOWN, true,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).",
-                img3->numCols,img3->numRows,m,n);
-        return 6;
-    }
-
-    for (psU32 row=0;row<n;row++) {
-        psC32* img3Row = img3->data.C32[row];
-        psF32* imgRow = img->data.F32[row];
-        for (psU32 col=0;col<m;col++) {
-            psF32 pixel = creal(img3Row[col])/m/n;
-            if (fabsf(pixel-imgRow[col]) > 0.1) {
-                psError(PS_ERR_UNKNOWN, true,"Reverse FFT didn't give original image back (%d,%d %.2f vs %.2f)",
-                        col,row,pixel,imgRow[col]);
-                return 7;
-            }
-        }
-    }
-
-    // 4. perform a reverse transform to real result
-    img3 = psImageFFT(img3,img2,PS_FFT_REVERSE|PS_FFT_REAL_RESULT);
-
-    if (img3->type.type != PS_TYPE_F32) {
-        char* typeStr;
-        PS_TYPE_NAME(typeStr,img3->type.type)
-        psError(PS_ERR_UNKNOWN, true,"FFT asked to make real result, but I got a %s type image?",typeStr);
-        return 8;
-    }
-
-    if (img3->numCols != m || img3->numRows != n) {
-        psError(PS_ERR_UNKNOWN, true,"FFT didn't produce proper size result (%dx%d vs. expected %dx%d).",
-                img3->numCols,img3->numRows,m,n);
-        return 9;
-    }
-
-    for (psU32 row=0;row<n;row++) {
-        psF32* img3Row = img3->data.F32[row];
-        psF32* imgRow = img->data.F32[row];
-        for (psU32 col=0;col<m;col++) {
-            psF32 pixel = img3Row[col]/m/n;
-            if (fabsf(pixel-imgRow[col]) > 0.1) {
-                psError(PS_ERR_UNKNOWN, true,"Reverse FFT didn't give original image back (%d,%d %.2f vs %.2f)",
-                        col,row,pixel,imgRow[col]);
-                return 10;
-            }
-        }
-    }
-
-    // check if error occurs if FORWARD and REVERSE are both given.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error.");
-    if (psImageFFT(NULL,img2,PS_FFT_REVERSE|PS_FFT_FORWARD) != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"PS_FFT_REVERSE|PS_FFT_FORWARD option produced something?");
-        return 11;
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error.");
-    if (psImageFFT(NULL,img2,PS_FFT_FORWARD|PS_FFT_REAL_RESULT) != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"PS_FFT_FORWARD|PS_FFT_REAL_RESULT option produced something?");
-        return 12;
-    }
-
-    /* Verify return null and program execution doesn't stop if input image is null */
-    img4 = psImageFFT(NULL,NULL,PS_FFT_FORWARD);
-    if (img4 != NULL ) {
-        psError(PS_ERR_UNKNOWN, true,"psImageFFT should return null for a null input image.");
-        return 10;
-    }
-
-    /* Verify return null and program execution doesn't stop if input image is invalid direction */
-    GENIMAGE(img4,8,8,S8,row+col);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error for invalid direction.");
-    img5 = psImageFFT(NULL,img4,PS_FFT_REAL_RESULT);
-    if (img5 != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psImageFFT should return null for an invalid FFT direction.");
-        return 11;
-    }
-    psFree(img4);
-
-    psFree(img);
-    psFree(img2);
-    psFree(img3);
-
-    return 0;
-}
-
-psS32 testImageRealImaginary(void)
-{
-    psImage* img = NULL;
-    psImage* img2 = NULL;
-    psImage* img3 = NULL;
-    psImage* c64Img = NULL;
-    psImage* c64Img2 = NULL;
-    psImage* c64Img3 = NULL;
-    psImage* ncImg = NULL;
-    psImage* ncImg2 = NULL;
-    psImage* ncImg3 = NULL;
-
-    psU32 m = 128;
-    psU32 n = 64;
-
-    /*
-    1. create a C32 complex vector with distinctly different real and imaginary parts.
-    2. call psImageReal and psImageImaginary
-    3. compare results to the real/imaginary components of input
-    */
-
-    // 1. create a C32 complex vector with distinctly different real and imaginary parts.
-    GENIMAGE(img,m,n,C32, row + I * col);
-
-    // 2. call psImageReal and psImageImaginary
-    img2 = psImageReal(img2,img);
-    if (img2 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psImageReal returned a NULL?");
-        return 1;
-    }
-    if (img2->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN, true,"psImageReal returned a wrong type (%d)?",
-                img2->type.type);
-        return 2;
-    }
-
-    img3 = psImageImaginary(img3,img);
-    if (img3 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psImageImaginary returned a NULL?");
-        return 3;
-    }
-    if (img3->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN, true,"psImageImaginary returned a wrong type (%d)?",
-                img3->type.type);
-        return 4;
-    }
-
-    // 3. compare results to the real/imaginary components of input
-    for (psU32 row=0;row<n;row++) {
-        psF32* img2Row = img2->data.F32[row];
-        psF32* img3Row = img3->data.F32[row];
-        for (psU32 col=0;col<m;col++) {
-            if (fabsf(img2Row[col] - row) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, true,"psImageReal didn't return the real portion at n=%d",
-                        n);
-                return 5;
-            }
-            if (fabsf(img3Row[col] - col) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, true,"psImageImaginary didn't return the imag portion at n=%d",
-                        n);
-                return 6;
-            }
-        }
-    }
-
-    psFree(img);
-    psFree(img2);
-    psFree(img3);
-
-    /*
-    1. create a C64 complex vector with distinctly different real and imaginary parts.
-    2. call psImageReal and psImageImaginary
-    3. compare results to the real/imaginary components of input
-    */
-
-    // 1. create a C64 complex vector with distinctly different real and imaginary parts.
-    GENIMAGE(c64Img,m,n,C64, row + I * col);
-
-    // 2. call psImageReal and psImageImaginary
-    c64Img2 = psImageReal(c64Img2,c64Img);
-    if (c64Img2 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psImageReal returned a NULL?");
-        return 1;
-    }
-    if (c64Img2->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN, true,"psImageReal returned a wrong type (%d)?",
-                img2->type.type);
-        return 2;
-    }
-
-    c64Img3 = psImageImaginary(c64Img3,c64Img);
-    if (c64Img3 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psImageImaginary returned a NULL?");
-        return 3;
-    }
-    if (c64Img3->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN, true,"psImageImaginary returned a wrong type (%d)?",
-                c64Img3->type.type);
-        return 4;
-    }
-
-    // 3. compare results to the real/imaginary components of input
-    for (psU32 row=0;row<n;row++) {
-        psF64* img2Row = c64Img2->data.F64[row];
-        psF64* img3Row = c64Img3->data.F64[row];
-        for (psU32 col=0;col<m;col++) {
-            if (fabsf(img2Row[col] - row) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, true,"psImageReal didn't return the real portion at n=%d",
-                        n);
-                return 5;
-            }
-            if (fabsf(img3Row[col] - col) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, true,"psImageImaginary didn't return the imag portion at n=%d",
-                        n);
-                return 6;
-            }
-        }
-    }
-
-    GENIMAGE(ncImg,m,n,F32,row+col);
-    ncImg2 = psImageReal(ncImg2,ncImg);
-    ncImg3 = psImageImaginary(ncImg3,ncImg);
-    if(ncImg2 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageReal returned NULL");
-        return 40;
-    }
-    if(ncImg2->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"psImageReal returned a wrong type");
-        return 41;
-    }
-    if(ncImg3 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageImaginary returned NULL");
-        return 42;
-    }
-    if(ncImg3->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"psImageImaginary returned NULL");
-        return 43;
-    }
-    for(psU32 row=0; row<n; row++) {
-        psF32* ncImg2Row = ncImg2->data.F32[row];
-        psF32* ncImg3Row = ncImg3->data.F32[row];
-        for(psU32 col=0; col<m; col++) {
-            if(fabsf(ncImg2Row[col] - (row+col)) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN,true,"psImageReal didn't return the real portion");
-                return 45;
-            }
-            if(fabsf(ncImg3Row[col] - 0) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN,true,"psImageImaginary didn't return the imaginary portion");
-                return 46;
-            }
-        }
-    }
-    psFree(ncImg);
-    psFree(ncImg2);
-    psFree(ncImg3);
-
-    psFree(c64Img);
-    psFree(c64Img2);
-    psFree(c64Img3);
-
-    // Perform psImageReal with null input
-    if(psImageReal(NULL,NULL) != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"psImageReal did not return null with null input");
-        return 10;
-    }
-
-    // Perform psImageImaginary with null input
-    if(psImageImaginary(NULL,NULL) != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"psImageImaginary did not return null with null input");
-        return 10;
-    }
-
-    return 0;
-}
-
-psS32 testImageComplex(void)
-{
-    psImage* img = NULL;
-    psImage* img2 = NULL;
-    psImage* img3 = NULL;
-    psImage* c64Img = NULL;
-    psImage* c64Img2 = NULL;
-    psImage* c64Img3 = NULL;
-    psImage* pImg = NULL;
-    psImage* pImg2 = NULL;
-    psImage* pImg3 = NULL;
-
-    psU32 m = 128;
-    psU32 n = 64;
-
-    /*
-    1. create two unique psF32 vectors of the same size
-    2. call psImageComplex
-    3. verify that the result is a psC32
-    4. use crealf and cimagf on step 2 results
-    5. compare step 4 results to input.
-
-    6. create a psF32 and a psF64 vector of the same size
-    7. call psImageComplex
-    8. verify that an appropriate error occurred.
-
-    9. create two psf32 vectors of different sizes
-    10. call psImageComplex
-    11. verify thet an appropriate error occurred.
-    */
-
-    // 1. create two unique psF32 vectors of the same size
-    GENIMAGE(img,m,n,F32,row);
-    GENIMAGE(img2,m,n,F32,col);
-    GENIMAGE(c64Img,m,n,F64,row);
-    GENIMAGE(c64Img2,m,n,F64,col);
-    GENIMAGE(pImg,m,n,S16,row);
-    GENIMAGE(pImg2,m,n,S16,col);
-
-    // 2. call psImageComplex
-    img3 = psImageComplex(img3,img,img2);
-    c64Img3 = psImageComplex(c64Img3,c64Img,c64Img2);
-
-    // 3. verify that the result is a psC32
-    if (img3->type.type != PS_TYPE_C32) {
-        psError(PS_ERR_UNKNOWN, true,"Image Type from psImageComplex is not complex? (%d)",
-                img3->type.type);
-        return 1;
-    }
-    if (c64Img3->type.type != PS_TYPE_C64) {
-        psError(PS_ERR_UNKNOWN,true,"Image type from psImageComplex is not complex");
-        return 10;
-    }
-
-    // 4. call psImageReal and psImageImaginary on step 2 results (not needed, just use crealf/cimagf)
-    // 5. compare step 4 results to input.
-    for (psU32 row=0;row<n;row++) {
-        psC32* img3Row = img3->data.C32[row];
-        psC64* c64Img3Row = c64Img3->data.C64[row];
-        for (psU32 col=0;col<m;col++) {
-            if (fabsf(crealf(img3Row[col]) - row) > FLT_EPSILON ||
-                    fabsf(cimagf(img3Row[col]) - col) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, true,"psImageComplex result is invalid (%d,%d, %.2f+%.2fi)",
-                        col,row,crealf(img3Row[col]),cimagf(img3Row[col]));
-                return 2;
-            }
-            if (fabsf(crealf(c64Img3Row[col]) - row) > FLT_EPSILON ||
-                    fabsf(cimagf(c64Img3Row[col]) - col) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN,true,"psImageComplex result is invalid");
-                return 3;
-            }
-        }
-    }
-
-    // 6. create a psF32 and a psF64 image of the same size
-    img2 = psImageRecycle(img2,m,n,PS_TYPE_F64);
-
-    // 7. call psImageComplex
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error (type mismatch).");
-    img3 = psImageComplex(img3,img,img2);
-    // 8. verify that an appropriate error occurred. (this partially has to be done via inspection)
-    if (img3 != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psImageComplex returned a image though input types mismatched.");
-        return 3;
-    }
-
-    // 9. create two psf32 vectors of different sizes
-    img2 = psImageRecycle(img2,m/2,n,PS_TYPE_F32);
-
-    // 10. call psImageComplex
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error (size mismatch).");
-    img3 = psImageComplex(img3,img,img2);
-
-    // 11. verify thet an appropriate error occurred.
-    if (img3 != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psImageComplex returned a image though input sizes mismatched.");
-        return 4;
-    }
-
-    // Perform psImageComplex with invalid type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
-    pImg3 = psImageComplex(pImg3,pImg,pImg2);
-    if ( pImg3 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psImageComplex did not return NULL");
-        return 50;
-    }
-
-    psFree(img);
-    psFree(img2);
-    psFree(img3);
-    psFree(c64Img);
-    psFree(c64Img2);
-    psFree(c64Img3);
-    psFree(pImg);
-    psFree(pImg2);
-
-    // Perform psImageComplex with null input
-    if(psImageComplex(NULL,NULL,NULL) != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"psImageComplex did not return null with null input");
-        return 20;
-    }
-
-    return 0;
-}
-
-psS32 testImageConjugate(void)
-{
-    psImage* img = NULL;
-    psImage* img2 = NULL;
-    psImage* c64Img = NULL;
-    psImage* c64Img2 = NULL;
-    psImage* pImg = NULL;
-    psImage* pImg2 = NULL;
-
-    psU32 m = 128;
-    psU32 n = 64;
-
-    /*
-    1. create a psC32 with unique real and imaginary values.
-    2. call psImageConjugate
-    3. verify result is psC32
-    4. verify each value is conjugate of input (a+bi -> a-bi)
-    */
-
-    // 1. create a psC32 with unique real and imaginary values.
-    GENIMAGE(img,m,n,C32, row + I * col);
-    GENIMAGE(c64Img,m,n,C64,row + I*col);
-    GENIMAGE(pImg,m,n,F32,row+col);
-
-    // 2. call psImageConjugate
-    img2 = psImageConjugate(img2,img);
-    c64Img2 = psImageConjugate(c64Img2,c64Img);
-    pImg2 = psImageConjugate(pImg2,pImg);
-
-    // 3. verify result is psC32
-    if (img2->type.type != PS_TYPE_C32) {
-        psError(PS_ERR_UNKNOWN, true,"the psImageConjugate didn't return a C32 image.");
-        return 1;
-    }
-    if (c64Img2->type.type != PS_TYPE_C64) {
-        psError(PS_ERR_UNKNOWN,true,"psImageConjugate did not return a C64 image");
-        return 10;
-    }
-    if (pImg2->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"psImageConjugate did not return a F32 image");
-        return 11;
-    }
-
-    // 4. verify each value is conjugate of input (a+bi -> a-bi)
-    for (psU32 row=0;row<n;row++) {
-        psC32* img2Row = img2->data.C32[row];
-        psC64* c64Img2Row = c64Img2->data.C64[row];
-        psF32* pImg2Row = pImg2->data.F32[row];
-        for (psU32 col=0;col<m;col++) {
-            if (fabsf(crealf(img2Row[col]) - row) > FLT_EPSILON ||
-                    fabsf(cimagf(img2Row[col]) + col) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, true,"psImageComplex result is invalid (%d,%d, %.2f+%.2fi)",
-                        col,row,crealf(img2Row[col]),cimagf(img2Row[col]));
-                return 2;
-            }
-            if (fabsf(crealf(c64Img2Row[col]) - row) > FLT_EPSILON ||
-                    fabsf(cimagf(c64Img2Row[col]) + col) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN,true,"psImageComplex result is invalid");
-                return 20;
-            }
-            if (fabsf(pImg2Row[col] - (row+col)) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN,true,"psImageComplex result is invalid");
-                return 21;
-            }
-        }
-    }
-
-    psFree(img);
-    psFree(img2);
-    psFree(c64Img);
-    psFree(c64Img2);
-    psFree(pImg);
-    psFree(pImg2);
-
-    // Perform psImageConjugate with null input
-    if(psImageConjugate(NULL,NULL) != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"psImageConjugate did not return null with null input");
-        return 30;
-    }
-
-    return 0;
-}
-
-psS32 testImagePowerSpectrum(void)
-{
-    psImage* img = NULL;
-    psImage* img2 = NULL;
-    psImage* c64Img = NULL;
-    psImage* c64Img2 = NULL;
-    psImage* pImg = NULL;
-
-    psU32 m = 128;
-    psU32 n = 64;
-
-    /*
-    1. create a psC32 vector with unique real and imaginary components
-    2. call psImagePowerSpectrum
-    3. verify result is psF32
-    4. verify the values are the square of the absolute values of the original
-    */
-
-    // 1. create a psC32 vector with unique real and imaginary components
-    GENIMAGE(img,m,n,C32, row + I * col);
-    GENIMAGE(c64Img,m,n,C64,row+I*col);
-    GENIMAGE(pImg,m,n,F32,row+col);
-
-    // 2. call psImagePowerSpectrum
-    img2 = psImagePowerSpectrum(img2,img);
-    c64Img2 = psImagePowerSpectrum(c64Img2, c64Img);
-
-    // 3. verify result is psF32
-    if (img2->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN, true,"the type was not PS_TYPE_F32.");
-        return 1;
-    }
-    if (c64Img2->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"psImagePowerSpectrum did not return PS_TYPE_F64");
-        return 10;
-    }
-
-    // 4. verify the values are the square of the absolute values of the original
-    for (psU32 row=0;row<n;row++) {
-        psC32* imgRow = img->data.C32[row];
-        psF32* img2Row = img2->data.F32[row];
-        psC64* c64ImgRow = c64Img->data.C64[row];
-        psF64* c64Img2Row = c64Img2->data.F64[row];
-        for (psU32 col=0;col<m;col++) {
-            psF32 power = cabs(imgRow[col]);
-            psF64 power64 = cabs(c64ImgRow[col]);
-            power *= power/n/n/m/m;
-            power64 *= power64/n/n/m/m;
-
-            if (fabsf(img2Row[col] - power) > 2.0f*FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, true,"psImagePowerSpectrum result is invalid (%d,%d, %.2f vs %.2f)",
-                        col,row,img2Row[col],power);
-                return 2;
-            }
-            if (fabsf(c64Img2Row[col] - power64) > 2.0f*FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN,true,"psImagePowerSpectrum result is invalid");
-                return 22;
-            }
-        }
-    }
-
-    psFree(img);
-    psFree(img2);
-    psFree(c64Img);
-    psFree(c64Img2);
-
-    // Perform psImagePowerSpectrum with invalid input
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message.");
-    if(psImagePowerSpectrum(NULL,pImg) != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"psImagePowerSpectrum did not return null with invalid type");
-        return 41;
-    }
-    psFree(pImg);
-
-    // Perform psImagePowerSpectrum with null input
-    if(psImagePowerSpectrum(NULL,NULL) != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"psImagePowerSpectrum did not return null with null input");
-        return 40;
-    }
-
-    return 0;
-}
Index: trunk/psLib/test/fft/tst_psVectorFFT.c
===================================================================
--- trunk/psLib/test/fft/tst_psVectorFFT.c	(revision 41166)
+++ 	(revision )
@@ -1,642 +1,0 @@
-/** @file  tst_psVectorFFT.c
-*
-*  @brief Contains the tests for psFFT.[ch]
-*
-*
-*  @author Robert DeSonia, MHPCC
-*
-*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-07-13 02:46:59 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include <math.h>
-#include <float.h>
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-#define GENIMAGE(img,c,r,TYP, valueFcn) \
-img = psImageAlloc(c,r,PS_TYPE_##TYP); \
-for (psU32 row=0;row<r;row++) { \
-    ps##TYP* imgRow = img->data.TYP[row]; \
-    for (psU32 col=0;col<c;col++) { \
-        imgRow[col] = (ps##TYP)(valueFcn); \
-    } \
-}
-
-static psS32 testVectorFFT( void );
-static psS32 testVectorRealImaginary( void );
-static psS32 testVectorComplex( void );
-static psS32 testVectorConjugate( void );
-static psS32 testVectorPowerSpectrum( void );
-
-testDescription tests[] = {
-                              {testVectorFFT, 600, "psVectorFFT", 0, false},
-                              {testVectorRealImaginary, 601, "psVectorRealImaginary", 0, false},
-                              {testVectorComplex, 602, "psVectorComplex", 0, false},
-                              {testVectorConjugate, 603, "psVectorConjugate", 0, false},
-                              {testVectorPowerSpectrum, 604, "psVectorPowerSpectrum", 0, false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psFFT", tests, argc, argv ) );
-}
-
-psS32 testVectorFFT( void )
-{
-    psVector * vec = NULL;
-    psVector* vec2 = NULL;
-    psVector* vec3 = NULL;
-    psVector* vec4 = NULL;
-
-    /*
-    1. assign a vector to a sinisoid
-    2. perform a forward transform
-    3. verify that the only significant component cooresponds to the freqency of the input in step 1.
-    4. perform a reverse transform
-    5. compare to original (should be equal to within a reasonable error)
-    */
-
-    // 1. assign a vector to a sinisoid
-    vec = psVectorAlloc( 100, PS_TYPE_F32 );
-    vec->n = vec->nalloc;
-    for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.F32[ n ] = sinf( ( psF32 ) n / 50.0f * M_PI );
-    }
-
-    // 2. perform a forward transform
-    vec2 = psVectorFFT( NULL, vec, PS_FFT_FORWARD );
-    if ( vec2->type.type != PS_TYPE_C32 ) {
-        psError(PS_ERR_UNKNOWN,true, "FFT didn't produce complex values?" );
-        return 1;
-    }
-
-    // 2a. verify output vector is same size as input
-    if ( vec2->n != vec->n ) {
-        psError(PS_ERR_UNKNOWN,true, "FFT didn't return vector with same size as input");
-        return 10;
-    }
-
-
-    // 3. verify that the only significant component cooresponds to the freqency of the input in step 1.
-    for ( psU32 n = 0; n < 100; n++ ) {
-        if ( n == 1 || n == 99 ) {
-            if ( fabsf( cabsf( vec2->data.C32[ n ] ) - 50.0f ) > 0.1f ) {
-                psError(PS_ERR_UNKNOWN,true, "FFT didn't work for vector (n=%d)", n );
-                return 2;
-            }
-        } else {
-            if ( fabsf( cabsf( vec2->data.C32[ n ] ) ) > 0.1f ) {
-                psError(PS_ERR_UNKNOWN,true, "FFT didn't work for vector (n=%d)", n );
-                return 3;
-            }
-        }
-    }
-
-    // 4. perform a reverse transform
-    vec3 = psVectorFFT( NULL, vec2, PS_FFT_REVERSE );
-    if ( vec3->type.type != PS_TYPE_C32 ) {
-        psError(PS_ERR_UNKNOWN,true, "FFT didn't produce complex values?" );
-        return 4;
-    }
-    if ( vec3->n != vec2->n ) {
-        psError(PS_ERR_UNKNOWN,true, "FFT didn't return vector with same size as input");
-        return 40;
-    }
-    for ( psU32 n = 0; n < 100; n++ ) {
-        psF32 val = sinf( ( psF32 ) n / 50.0f * M_PI );
-        psF32 vecVal = crealf( vec3->data.C32[ n ] ) / 100;
-        if ( fabsf( vecVal - val ) > 0.1f ) {
-            psError(PS_ERR_UNKNOWN,true, "Reverse FFT didn't give me the original vector back (n=%d) (%.2f vs %.2f)",
-                    n, vecVal, val );
-            return 5;
-        }
-    }
-
-    // Perform a reverse transform with real flag set
-    vec4 = psVectorFFT(NULL,vec2, (PS_FFT_REVERSE | PS_FFT_REAL_RESULT));
-    if(vec4->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"FFT with real result did not produce real values");
-        return 80;
-    }
-
-    // Perform vector FFT with invalid direction flags
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
-    if ( psVectorFFT(NULL,vec2,(psFFTFlags)0) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid direction");
-        return 70;
-    }
-
-    psFree( vec );
-    psFree( vec2 );
-    psFree( vec3 );
-    psFree( vec4 );
-
-    // Perform vector FFT with null input
-    if ( psVectorFFT(NULL,NULL,PS_FFT_FORWARD) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with null input vector");
-        return 64;
-    }
-
-    return 0;
-}
-
-psS32 testVectorRealImaginary( void )
-{
-    psVector * vec = NULL;
-    psVector* vec2 = NULL;
-    psVector* vec3 = NULL;
-    psVector* vec4 = NULL;
-    psVector* vec5 = NULL;
-    psVector* vec6 = NULL;
-    psVector* vec7 = NULL;
-    psVector* vec8 = NULL;
-    psVector* vec9 = NULL;
-    psVector* vec10 = NULL;
-    psVector* vec11 = NULL;
-
-    /*
-    1. create a C32 complex vector with distinctly different real and imaginary parts.
-    2. call psVectorReal and psVectorImaginary
-    3. compare results to the real/imaginary components of input
-    */
-
-    // 1. create a C32 complex vector with distinctly different real and imaginary parts.
-    vec = psVectorAlloc( 100, PS_TYPE_C32 );
-    vec8 = psVectorAlloc( 100, PS_TYPE_C64 );
-    vec10 = psVectorAlloc( 100, PS_TYPE_C64 );
-    vec->n = vec->nalloc;
-    vec8->n = vec8->nalloc;
-    vec10->n = vec10->nalloc;
-    for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.C32[ n ] = n + I * ( n * 2 );
-        vec8->data.C64[n] = n + I * ( n * 2 );
-        vec10->data.C64[n] = n + I * ( n * 2 );
-    }
-    vec4 = psVectorAlloc( 100, PS_TYPE_F32);
-    vec4->n = vec4->nalloc;
-    vec6 = psVectorAlloc( 100, PS_TYPE_F32);
-    vec6->n = vec6->nalloc;
-    for ( psU32 n = 0; n < 100; n++ ) {
-        vec4->data.F32[n] = n;
-        vec6->data.F32[n] = n;
-    }
-
-    // 2. call psVectorReal and psVectorImaginary
-    vec2 = psVectorReal( vec2, vec );
-    if ( vec2 == NULL ) {
-        psError(PS_ERR_UNKNOWN,true, "psVectorReal returned a NULL?" );
-        return 1;
-    }
-    if ( vec2->type.type != PS_TYPE_F32 ) {
-        psError(PS_ERR_UNKNOWN,true, "psVectorReal returned a wrong type (%d)?",
-                vec2->type.type );
-        return 2;
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate a warning.");
-    vec5 = psVectorReal(vec5, vec4);
-    if (vec5 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorReal returned NULL");
-        return 10;
-    }
-    if ( vec5->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorReal returned the wrong type");
-        return 11;
-    }
-
-    vec9 = psVectorReal(vec9,vec8);
-    if(vec9 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorReal returned NULL");
-        return 20;
-    }
-    if(vec9->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorReal returned the wrong type");
-        return 21;
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate a warning.");
-    vec3 = psVectorImaginary( vec3, vec );
-    if ( vec3 == NULL ) {
-        psError(PS_ERR_UNKNOWN,true, "psVectorImaginary returned a NULL?" );
-        return 3;
-    }
-    if ( vec3->type.type != PS_TYPE_F32 ) {
-        psError(PS_ERR_UNKNOWN,true, "psVectorImaginary returned a wrong type (%d)?",
-                vec3->type.type );
-        return 4;
-    }
-
-    vec7 = psVectorImaginary(vec7, vec6);
-    if(vec7 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorImage returned NULL");
-        return 12;
-    }
-    if(vec7->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorImaginary returned the wrong type");
-        return 13;
-    }
-
-    vec11 = psVectorImaginary(vec11, vec10);
-    if(vec11 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorImaginary returned NULL");
-        return 14;
-    }
-    if(vec11->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorImaginary returned the wrong type");
-        return 15;
-    }
-
-    // 3. compare results to the real/imaginary components of input
-    for ( psU32 n = 0; n < 100; n++ ) {
-        psF32 r = n;
-        psF32 i = ( n * 2 );
-        psF64 rr = n;
-        psF64 ii = ( n * 2 );
-        if ( fabsf( vec2->data.F32[ n ] - r ) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true, "psVectorReal didn't return the real portion at n=%d",
-                    n );
-            return 5;
-        }
-        if ( fabsf( vec3->data.F32[ n ] - i ) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true, "psVectorImaginary didn't return the real portion at n=%d",
-                    n );
-            return 6;
-        }
-        if ( fabsf( vec5->data.F32[n] - r) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN,true,"psVectorReal didn't return the real portion at n=%d",n);
-            return 50;
-        }
-        if ( fabsf( vec7->data.F32[n] - 0) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN,true,"psVectorImaginary did not return the imaginary portion at n=%d",n);
-            return 51;
-        }
-        if ( fabsf(vec9->data.F64[n] - rr) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true,"psVectorReal did not return the real portion at n=%d",n);
-            return 52;
-        }
-        if ( fabsf(vec11->data.F64[n] - ii) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN,true,"psVectorImaginary did not return the imaginary portion at n=%d",n);
-            return 53;
-        }
-    }
-
-    psFree( vec );
-    psFree( vec2 );
-    psFree( vec3 );
-    psFree( vec4 );
-    psFree( vec5 );
-    psFree( vec6 );
-    psFree( vec7 );
-    psFree( vec8 );
-    psFree( vec9 );
-    psFree( vec10 );
-    psFree( vec11 );
-
-    // Perform vector Real with null input
-    if ( psVectorReal(NULL,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with null input vector");
-        return 63;
-    }
-    // Perform vector Imaginary with null input
-    if ( psVectorImaginary(NULL,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with null input vector");
-        return 73;
-    }
-
-    return 0;
-}
-
-psS32 testVectorComplex( void )
-{
-    psVector * vec = NULL;
-    psVector* vec2 = NULL;
-    psVector* vec3 = NULL;
-    psVector* vec4 = NULL;
-    psVector* vec5 = NULL;
-    psVector* vec6 = NULL;
-
-    /*
-    1. create two unique psF32 vectors of the same size
-    2. call psVectorComplex
-    3. verify that the result is a psC32
-    4. call psVectorReal and psVectorImaginary on step 2 results
-    5. compare step 4 results to input.
-
-    6. create a psF32 and a psF64 vector of the same size
-    7. call psVectorComplex
-    8. verify that an appropriate error occurred.
-
-    9. create two psf32 vectors of different sizes
-    10. call psVectorComplex
-    11. verify thet an appropriate error occurred.
-    */
-
-    // 1. create two unique psF32 vectors of the same size
-    vec = psVectorAlloc( 100, PS_TYPE_F32 );
-    vec2 = psVectorAlloc( 100, PS_TYPE_F32 );
-    vec4 = psVectorAlloc( 100, PS_TYPE_F64 );
-    vec5 = psVectorAlloc( 100, PS_TYPE_F64 );
-    vec->n = vec->nalloc;
-    vec2->n = vec2->nalloc;
-    vec4->n = vec4->nalloc;
-    vec5->n = vec5->nalloc;
-    for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.F32[ n ] = n;
-        vec2->data.F32[ n ] = ( n * 2 );
-        vec4->data.F64[ n ] = n;
-        vec5->data.F64[ n ] = ( n * 2 );
-    }
-
-    // 2. call psVectorComplex
-    vec3 = psVectorComplex( vec3, vec, vec2 );
-
-    // 3. verify that the result is a psC32
-    if ( vec3->type.type != PS_TYPE_C32 ) {
-        psError(PS_ERR_UNKNOWN,true, "Vector Type from psVectorComplex is not complex? (%d)",
-                vec3->type.type );
-        return 1;
-    }
-
-    // 4. call psVectorReal and psVectorImaginary on step 2 results (not needed, just use crealf/cimagf)
-    // 5. compare step 4 results to input.
-    for ( psU32 n = 0; n < 100; n++ ) {
-        if ( fabsf( crealf( vec3->data.C32[ n ] ) - n ) > FLT_EPSILON ||
-                fabsf( cimagf( vec3->data.C32[ n ] ) - ( n * 2 ) ) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)",
-                    n, crealf( vec3->data.C32[ n ] ), cimagf( vec3->data.C32[ n ] ) );
-            return 2;
-        };
-    }
-
-
-    // 6. create a psF32 and a psF64 vector of the same size
-    vec2 = psVectorRecycle( vec2, 100, PS_TYPE_F64 );
-
-    // 7. call psVectorComplex
-    psLogMsg(__func__, PS_LOG_INFO, "Following should be an error (type mismatch)." );
-    vec3 = psVectorComplex( vec3, vec, vec2 );
-    // 8. verify that an appropriate error occurred. (this partially has to be done via inspection)
-    if ( vec3 != NULL ) {
-        psError(PS_ERR_UNKNOWN,true, "psVectorComplex returned a vector though input types mismatched." );
-        return 3;
-    }
-
-    // 9. create two psf32 vectors of different sizes
-    vec2 = psVectorRecycle( vec2, 200, PS_TYPE_F32 );
-
-    // 10. call psVectorComplex
-    vec3 = psVectorComplex( vec3, vec, vec2 );
-
-    // 11. verify thet an appropriate error occurred. (actually, it isn't an error...)
-    if ( vec3->n != 100 ) {
-        psError(PS_ERR_UNKNOWN,true, "psVectorComplex returned a larger vector than the input supported (%d).", vec3->n );
-        return 4;
-    }
-
-    // Verify the function works with psF64 type
-    vec6 = psVectorComplex(vec6, vec4, vec5);
-    if( vec6->type.type != PS_TYPE_C64 ) {
-        psError(PS_ERR_UNKNOWN,true,"Vector return type is not complex");
-        return 40;
-    }
-
-    // Verify error message generated with input of invalid type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
-    vec4->type.type = PS_TYPE_S8;
-    vec5->type.type = PS_TYPE_S8;
-    vec6 = psVectorComplex(vec6, vec4, vec5);
-    if(vec6 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid type");
-        return 50;
-    }
-    vec4->type.type = PS_TYPE_F64;
-    vec5->type.type = PS_TYPE_F64;
-
-    psFree( vec );
-    psFree( vec2 );
-    psFree( vec3 );
-    psFree( vec4 );
-    psFree( vec5 );
-
-    // Perform vector complex with null input
-    if ( psVectorComplex(NULL,NULL,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with null input vector");
-        return 62;
-    }
-
-    return 0;
-}
-
-psS32 testVectorConjugate( void )
-{
-    psVector * vec = NULL;
-    psVector* vec2 = NULL;
-
-    /*
-    1. create a psC32 with unique real and imaginary values.
-    2. call psVectorConjugate
-    3. verify result is psC32
-    4. verify each value is conjugate of input (a+bi -> a-bi)
-    */
-
-    // 1. create a psC32 with unique real and imaginary values.
-    vec = psVectorAlloc( 100, PS_TYPE_C32 );
-    vec->n = vec->nalloc;
-    for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.C32[ n ] = n + I * ( n * 2 );
-    }
-
-    // 2. call psVectorConjugate
-    vec2 = psVectorConjugate( vec2, vec );
-
-    // 3. verify result is psC32
-    if ( vec2->type.type != PS_TYPE_C32 ) {
-        psError(PS_ERR_UNKNOWN,true, "the psVectorConjugate didn't return a C32 vector" );
-        return 1;
-    }
-
-    // 4. verify each value is conjugate of input (a+bi -> a-bi)
-    for ( psU32 n = 0; n < 100; n++ ) {
-        if ( fabsf( crealf( vec->data.C32[ n ] ) - crealf( vec2->data.C32[ n ] ) ) > FLT_EPSILON ||
-                fabsf( cimagf( vec->data.C32[ n ] ) + cimagf( vec2->data.C32[ n ] ) ) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true, "psVectorConjugate result is invalid (n=%d, %.2f+%.2fi)",
-                    n, crealf( vec2->data.C32[ n ] ), cimagf( vec2->data.C32[ n ] ) );
-            return 2;
-        };
-    }
-
-    psFree( vec );
-
-    // Perform conjugate for non-complex number
-    vec = psVectorAlloc( 100, PS_TYPE_F32 );
-    vec->n = vec->nalloc;
-    for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.F32[ n ] = n;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate a warning message.");
-    vec2 = psVectorConjugate(vec2,vec);
-    if(vec2->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorConjugate did not return a F32 vector");
-        return 10;
-    }
-    for ( psU32 n = 0; n < 100; n++ ) {
-        if( vec->data.F32[n] != vec2->data.F32[n] ) {
-            psError(PS_ERR_UNKNOWN,true,"psVectorConjugate result is invalid (n=%d)",n);
-            return 11;
-        }
-    }
-    psFree(vec);
-
-    // Perform vector conjugate with C64 type
-    vec = psVectorAlloc( 100, PS_TYPE_C64 );
-    vec->n = vec->nalloc;
-    for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.C64[n] = n + I * ( n * 2 );
-    }
-    vec2 = psVectorConjugate(vec2,vec);
-    if(vec2->type.type != PS_TYPE_C64) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorConjugate did not return a C64 vector");
-        return 12;
-    }
-    for ( psU32 n = 0; n < 100; n++ ) {
-        if ( fabsf( crealf(vec->data.C64[n]) - crealf(vec2->data.C64[n])) > FLT_EPSILON ||
-                fabsf( cimagf(vec->data.C64[n]) + cimagf(vec2->data.C64[n])) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true,"psVectorConjugate result is invalid (n=%d)",n);
-            return 13;
-        }
-    }
-    psFree(vec);
-
-    // Perform vector conjugate with null input (vec2 should be freed too)
-    if ( psVectorConjugate(vec2,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with null input vector");
-        return 61;
-    }
-
-    return 0;
-}
-
-psS32 testVectorPowerSpectrum( void )
-{
-    psVector * vec = NULL;
-    psVector* vec2 = NULL;
-    psVector* vec3 = NULL;
-    psVector* vec4 = NULL;
-
-    psF32 val;
-    psF64 val1;
-
-    /*
-    1. create a psC32 vector with unique real and imaginary components
-    2. call psVectorPowerSpectrum
-    3. verify result is psF32
-    4. verify the values are the square of the absolute values of the original
-    */
-
-    // 1. create a psC32 vector with unique real and imaginary components
-    vec = psVectorAlloc( 100, PS_TYPE_C32 );
-    vec->n = vec->nalloc;
-    vec3 = psVectorAlloc(100,PS_TYPE_C64);
-    vec3->n = vec3->nalloc;
-    for ( psU32 n = 0; n < 100; n++ ) {
-        vec->data.C32[ n ] = n + I * sinf( ( ( psF32 ) n ) / 50.f * M_PI );
-        vec3->data.C64[ n ] = n + I * sinf( ( ( psF64 ) n ) / 50.f * M_PI );
-    }
-
-    // 2. call psVectorPowerSpectrum
-    vec2 = psVectorPowerSpectrum( vec2, vec );
-    vec4 = psVectorPowerSpectrum( vec4, vec3 );
-
-    // 3. verify result is psF32
-    if ( vec2->type.type != PS_TYPE_F32 ) {
-        psError(PS_ERR_UNKNOWN,true, "the type was not PS_TYPE_F32." );
-        return 1;
-    }
-    if ( vec4->type.type != PS_TYPE_F64 ) {
-        psError(PS_ERR_UNKNOWN,true,"psPowerSpectrum did not return type PS_TYPE_F64 type = %d",vec4->type.type);
-        return 20;
-    }
-
-    // 3a. verify result is the same size a input
-    // Awaiting IfA direction on bug #228
-    //    if ( vec2->n != vec->n ) {
-    //       psError(PS_ERR_UNKNOWN,true, "Output vector size different(%d) than input vector(%d)",vec2->n, vec->n);
-    //       return 10;
-    //    }
-
-    // 4. verify the values are the square of the absolute values of the original
-    //   (ADD specifies something else)
-    //   P_0 = |C_0|^2/N^2
-    //   P_j = (|C_j|^2+|C_N-j|^2)/N^2
-    //   P_N/2 = |C_N/2|^2/N^2
-    //  where j = 1,2,...,(N/2-1)
-
-    val = cabsf( vec->data.C32[ 0 ] ) * cabsf( vec->data.C32[ 0 ] ) / 100 / 100;
-    val1= cabsf( vec3->data.C64[0] ) * cabsf(vec3->data.C64[0])/100/100;
-    if ( fabsf( vec2->data.F32[ 0 ] - val ) > FLT_EPSILON ) {
-        psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=0, %.2f %.2f)",
-                vec2->data.F32[ 0 ], val );
-        return 2;
-    }
-    if ( fabsf( vec4->data.C64[0] - val1 ) > FLT_EPSILON ) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorPowerSpectrum result is invalid (n=0)");
-        return 21;
-    }
-
-    for ( psU32 n = 1; n < 50; n++ ) {
-        val = ( cabsf( vec->data.C32[ n ] ) * cabsf( vec->data.C32[ n ] ) +
-                cabsf( vec->data.C32[ 100 - n ] ) * cabsf( vec->data.C32[ 100 - n ] ) ) / 100 / 100;
-        val1 = (cabsf(vec3->data.C64[n]) * cabsf(vec3->data.C64[n]) +
-                cabsf(vec3->data.C64[100-n]) * cabsf(vec3->data.C64[100-n]))/100/100;
-        if ( fabsf( val - vec2->data.F32[ n ] ) > 10*FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=%d, %.2f %.2f)",
-                    n, vec2->data.F32[ n ], val );
-            return 2;
-        }
-        if (fabsf(val1 - vec4->data.F64[n]) > 10*FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN,true,"psVectorPowerSpectrum result is invalid (n=%d, %.2f %.2f)",n,vec4->data.F64[n],val1);
-            return 22;
-        }
-    }
-
-    val = cabsf( vec->data.C32[ 50 ] ) * cabsf( vec->data.C32[ 50 ] ) / 100 / 100;
-    if ( fabsf( vec2->data.F32[ 50 ] - val ) > 10*FLT_EPSILON ) {
-        psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=50, %.2f %.2f)",
-                vec2->data.F32[ 0 ], val );
-        return 2;
-    };
-
-    psFree( vec );
-    psFree( vec2 );
-    psFree( vec3 );
-    psFree( vec4 );
-
-    // Perform vector power spectrum with non-complex number
-    vec = psVectorAlloc(100,PS_TYPE_F32);
-    vec->n = vec->nalloc;
-    for( psU32 n=0; n<100; n++) {
-        vec->data.F32[n] = n;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
-    if(psVectorPowerSpectrum(NULL,vec) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psVectorPowerSpectrum did not return a null vector.");
-        return 10;
-    }
-
-    // Perform vector power spectrum with null input
-    if ( psVectorPowerSpectrum(NULL,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with null input vector");
-        return 60;
-    }
-
-    psFree(vec);
-
-    return 0;
-}
Index: trunk/psLib/test/sys/tap_psError.c
===================================================================
--- trunk/psLib/test/sys/tap_psError.c	(revision 41166)
+++ trunk/psLib/test/sys/tap_psError.c	(revision 41171)
@@ -324,38 +324,25 @@
 
         for (psS32 i = 0; i < numErr; i++) {
-            const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i);
-            ok(desc != NULL,
-                "psErrorCode didn't find registered error code.");
-
-            ok(strcmp(desc,errDesc[i].description) == 0,
-                "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.", desc,errDesc[i].description);
-        }
-
-        /*
-            2. invoke psErrorCodeString with a static/builtin psLib error code. Verify:
+            const char *desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i);
+            ok(desc, "psErrorCode found registered error code.");
+            ok(!strcmp(desc,errDesc[i].description), "psErrorCode returned the proper description.  Got '%s', expected '%s'.", desc, errDesc[i].description);
+        }
+
+        /* 2. invoke psErrorCodeString with a static/builtin psLib error code. Verify:
                 a. the result is correct.
         */
-        const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES);
-        ok(desc != NULL, "psErrorCode didn't find static error code.");
-        ok(strcmp(desc,"error classes end marker") == 0,
-            "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.",
-            desc,"error classes end marker");
+        const char *desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES);
+        ok(desc, "psErrorCode found static error code.");
+        ok(!strcmp(desc, "error classes end marker"), "psErrorCode returned the proper description.  Got '%s', expected '%s'.", desc, "error classes end marker");
 
         desc = psErrorCodeString(PS_ERR_NONE);
-        ok(desc != NULL,
-            "psErrorCode didn't find static error code.");
-        ok(strcmp(desc,"not an error") == 0,
-            "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.",
-            desc,"not an error");
+        ok(desc, "psErrorCode found static error code.");
+        ok(!strcmp(desc,"not an error"), "psErrorCode returned the proper description.  Got '%s', expected '%s'.", desc, "not an error");
     
-        /*
-            3. invoke psErrorCodeString with an invalid code. Verify a NULL is returned.
-        */
+        /* 3. invoke psErrorCodeString with an invalid code. Verify a NULL is returned. */
         desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+numErr+1);
-        ok(desc == NULL,
-            "psErrorCode didn't return a NULL with a bogus input code.");
-
-        /*
-            4. invoke psErrorRegister with a NULL psErrorDescription. Verify that:
+        ok(!desc, "psErrorCode returns a NULL with a bogus input code.");
+
+        /* 4. invoke psErrorRegister with a NULL psErrorDescription. Verify that:
                 a. the execution does not cease.
                 b. an appropriate error is generated.
@@ -366,5 +353,5 @@
         psErr* err = psErrorLast();
         ok(err->code == PS_ERR_BAD_PARAMETER_NULL,
-        "psErrorCode didn't generate proper error code for NULL input.");
+        "psErrorCode generated proper error code for NULL input.");
 
         psFree(err);
@@ -377,5 +364,5 @@
         err = psErrorLast();
         ok(err->code == PS_ERR_NONE,
-            "psErrorCode generated an error for nErrors = 0.");
+            "psErrorCode did not generate an error for nErrors = 0.");
         psFree(err);
     }
Index: trunk/psLib/test/sys/tap_psLine.c
===================================================================
--- trunk/psLib/test/sys/tap_psLine.c	(revision 41166)
+++ trunk/psLib/test/sys/tap_psLine.c	(revision 41171)
@@ -23,14 +23,13 @@
     psLogSetLevel(PS_LOG_INFO);
 
-    //testLineAlloc()
+    // testLineAlloc()
     {
         psMemId id = psMemGetId();
         psLine *lineline = NULL;
         lineline = psLineAlloc(20);
-        ok(lineline->NLINE==20, "psLine set NLINE parameter during Allocation");
-        ok(lineline->Nline == 0, "psLine set Nline parameter during Allocation");
+        ok(lineline->NLINE == 20, "psLine set NLINE parameter during Allocation");
+        ok(lineline->Nline ==  0, "psLine set Nline parameter during Allocation");
         strncpy(lineline->line, "Hello World", 20);
-        ok(!strncmp(lineline->line, "Hello World", 20),
-            "psLine was stored a simple string!");
+        ok(!strncmp(lineline->line, "Hello World", 20), "psLine was stored a simple string!");
         psFree(lineline);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -41,8 +40,8 @@
         psMemId id = psMemGetId();
         psLine *line = NULL;
-        //Return false for NULL input
+        // Return false for NULL input
         int okay = !psLineInit(line);
         ok(okay, "psLineInit.  Expected false for NULL psLine input");
-        //Allocate a line and return true on Init
+        // Allocate a line and return true on Init
         line = psLineAlloc(1);
         okay = psLineInit(line);
@@ -65,8 +64,6 @@
         int okay = psLineAdd(line, "Hello %s", "World");
         ok( okay, "psLineAdd.  Expected true for valid psLine input");
-        ok(line->NLINE == 20 && line->Nline == 11,
-            "psLineAdd failed to return the correct line parameters");
-        ok(!strncmp(line->line, "Hello World", 20),
-            "psLineAdd failed to store the correct line string.");
+        ok(line->NLINE == 20 && line->Nline == 11, "psLineAdd failed to return the correct line parameters");
+        ok(!strncmp(line->line, "Hello World", 20), "psLineAdd failed to store the correct line string.");
         psFree(line);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -79,9 +76,7 @@
         psLine *line = NULL;
         //Return false for Null input line
-        ok(!psMemCheckLine(line),
-            "psMemCheckLine return false for NULL line input");
+        ok(!psMemCheckLine(line), "psMemCheckLine return false for NULL line input");
         line = psLineAlloc(1);
-        ok(psMemCheckLine(line),
-            "psMemCheckLine return true for valid line input");
+        ok(psMemCheckLine(line), "psMemCheckLine return true for valid line input");
         psFree(line);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
Index: trunk/psLib/test/sys/tap_psMemory.c
===================================================================
--- trunk/psLib/test/sys/tap_psMemory.c	(revision 41166)
+++ trunk/psLib/test/sys/tap_psMemory.c	(revision 41171)
@@ -41,5 +41,5 @@
     psLogSetFormat("HLNM");
     psLogSetLevel(PS_LOG_INFO);
-    plan_tests(46);
+    plan_tests(54);
 
     // TPFreeReferencedMemory()
@@ -79,5 +79,6 @@
     // the psMemExhaustedCallback.
     // XXXX: Skipping TPOutOfMemory() because of test abort failure
-    if (0) {
+    skip_start (1, 2, "Skipping TPOutOfMemory() because of test abort failure");
+    {
         psMemId id = psMemGetId();
         psS32 *mem[ 100 ];
@@ -88,5 +89,5 @@
         exhaustedCallbackCalled = 0;
         cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback );
-        #ifdef COMMENTED_OUT
+        // #ifdef COMMENTED_OUT
         // Don't include since intentionally aborts
         for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
@@ -99,8 +100,8 @@
             psFree( mem[ lcv ] );
         }
-        #endif
-        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
-    }
-
+	// #endif
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
+    }
+    skip_end();
 
 
@@ -108,5 +109,6 @@
     // psRealloc shall call the psMemExhaustedCallback.
     // XXXX: Skipping TPReallocOutOfMemory() because of test abort failure
-    if (0) {
+    skip_start (1, 2, "Skipping TPReallocOutOfMemory() because of test abort failure");
+    {
         psMemId id = psMemGetId();
         psS32 *mem[ 100 ];
@@ -131,5 +133,5 @@
         ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
-
+    skip_end();
 
     // psAlloc shall allocate memory blocks writeable by caller.
@@ -236,5 +238,6 @@
     // TPcheckLeaks()
     // XXXX: Skipping TPcheckLeaks() because of test abort failure
-    if (0) {
+    skip_start (1, 6, "Skipping TPcheckLeaks() because of test abort failure");
+    {
         const psS32 numBuffers = 5;
         psS32* buffers[ 5 ];
@@ -288,4 +291,5 @@
         psFree(buffers[3]);
     }
+    skip_end();
 
 
@@ -304,26 +308,24 @@
         psArray *array = psArrayAlloc(100);
         int okay = psMemCheckType(PS_DATA_ARRAY,array);
-        if (!okay) {
-            psFree(array);
-        }
-        ok(okay, "psMemCheckArray in memCheckType");
-
-        ok(!psMemCheckType(PS_DATA_ARRAY, neg), "psMemCheckType with metadata input");
+        if (!okay) psFree(array);
+        ok(okay, "psMemCheckType PS_DATA_ARRAY in memCheckType");
+
+        ok(!psMemCheckType(PS_DATA_ARRAY, neg), "psMemCheckType PS_DATA_ARRAY with metadata input");
         psFree(array);
 
-        psBitSet *bits;
-        bits = psBitSetAlloc(100);
-        okay = psMemCheckType(PS_DATA_BITSET, bits);
-        if (!okay )
-            psFree(bits);
-        ok(okay, "psMemCheckBitSet in memCheckType");
-        ok(!psMemCheckType(PS_DATA_BITSET, negative), "psMemCheckType on psArray");
-        psFree(bits);
+	// XXX EAM 2019.11.08 : this data type no longer exists
+        // psBitSet *bits;
+        // bits = psBitSetAlloc(100);
+        // okay = psMemCheckType(PS_DATA_BITSET, bits);
+        // if (!okay ) psFree(bits);
+	// 
+        // ok(okay, "psMemCheckBitSet in memCheckType");
+        // ok(!psMemCheckType(PS_DATA_BITSET, negative), "psMemCheckType on psArray");
+        // psFree(bits);
 
         psCube *cube;
         cube = psCubeAlloc();
         okay = psMemCheckType(PS_DATA_CUBE, cube);
-        if (!okay )
-            psFree(cube);
+        if (!okay ) psFree(cube);
         ok(okay, "psMemCheckCube in memCheckType");
         psFree(cube);
@@ -335,6 +337,5 @@
         psFree(img);
         okay = psMemCheckType(PS_DATA_FITS, fits);
-        if (!okay )
-            psFree(fits);
+        if (!okay ) psFree(fits);
         ok(okay, "psMemCheckFits in memCheckType");
         psFitsClose(fits);
@@ -343,6 +344,5 @@
         hash = psHashAlloc(100);
         okay = psMemCheckType(PS_DATA_HASH, hash);
-        if (!okay )
-            psFree(hash);
+        if (!okay ) psFree(hash);
         ok(okay, "psMemCheckHash in memCheckType");
         psFree(hash);
@@ -351,6 +351,5 @@
         histogram = psHistogramAlloc(1.1, 2.2, 2);
         okay = psMemCheckType(PS_DATA_HISTOGRAM, histogram);
-        if (!okay )
-            psFree(histogram);
+        if (!okay ) psFree(histogram);
         ok(okay, "psMemCheckHistogram in memCheckType");
         psFree(histogram);
@@ -359,6 +358,5 @@
         image = psImageAlloc(5, 5, PS_TYPE_F32);
         okay = psMemCheckType(PS_DATA_IMAGE, image);
-        if (!okay )
-            psFree(image);
+        if (!okay ) psFree(image);
         ok(okay, "psMemCheckImage in memCheckType");
         psFree(image);
@@ -367,6 +365,5 @@
         kernel = psKernelAlloc(0, 1, 0, 1);
         okay = psMemCheckType(PS_DATA_KERNEL, kernel);
-        if (!okay )
-            psFree(kernel);
+        if (!okay ) psFree(kernel);
         ok(okay, "psMemCheckKernel in memCheckType");
         psFree(kernel);
@@ -375,6 +372,5 @@
         list = psListAlloc(NULL);
         okay = psMemCheckType(PS_DATA_LIST, list);
-        if (!okay )
-            psFree(list);
+        if (!okay ) psFree(list);
         ok(okay, "psMemCheckList in memCheckType");
         psFree(list);
@@ -385,6 +381,5 @@
         lookup = psLookupTableAlloc(file, format, 10);
         okay = psMemCheckType(PS_DATA_LOOKUPTABLE, lookup);
-        if (!okay )
-            psFree(lookup);
+        if (!okay ) psFree(lookup);
         ok(okay, "psMemCheckLookupTable in memCheckType");
         psFree(lookup);
@@ -393,6 +388,5 @@
         metadata = psMetadataAlloc();
         okay = psMemCheckType(PS_DATA_METADATA, metadata);
-        if (!okay )
-            psFree(metadata);
+        if (!okay ) psFree(metadata);
         ok(okay, "psMemCheckMetadata in memCheckType");
         psFree(metadata);
@@ -401,14 +395,12 @@
         metaItem = psMetadataItemAlloc("name", PS_DATA_S32, "COMMENT", 1);
         okay = psMemCheckType(PS_DATA_METADATAITEM, metaItem);
-        if (!okay )
-            psFree(metaItem);
+        if (!okay ) psFree(metaItem);
         ok(okay, "psMemCheckMetadataItem in memCheckType");
         psFree(metaItem);
 
         psMinimization *min;
-        min = psMinimizationAlloc(3, 0.1);
+        min = psMinimizationAlloc(3, 0.1, 1.0);
         okay = psMemCheckType(PS_DATA_MINIMIZATION, min);
-        if (!okay )
-            psFree(min);
+        if (!okay ) psFree(min);
         ok(okay, "psMemCheckMinimization in memCheckType");
         psFree(min);
@@ -417,6 +409,5 @@
         pixels = psPixelsAlloc(100);
         okay = psMemCheckType(PS_DATA_PIXELS, pixels);
-        if (!okay )
-            psFree(pixels);
+        if (!okay ) psFree(pixels);
         ok(okay, "psMemCheckPixels in memCheckType");
         psFree(pixels);
@@ -425,6 +416,5 @@
         plane = psPlaneAlloc();
         okay = psMemCheckType(PS_DATA_PLANE, plane);
-        if (!okay )
-            psFree(plane);
+        if (!okay ) psFree(plane);
         ok(okay, "psMemCheckPlane in memCheckType.");
         psFree(plane);
@@ -433,6 +423,5 @@
         planeDistort = psPlaneDistortAlloc(1, 1, 1, 1);
         okay =  psMemCheckType(PS_DATA_PLANEDISTORT, planeDistort);
-        if (!okay )
-            psFree(planeDistort);
+        if (!okay ) psFree(planeDistort);
         ok(okay, "psMemCheckPlaneDistort in memCheckType.");
         psFree(planeDistort);
@@ -441,6 +430,5 @@
         planeTransform = psPlaneTransformAlloc(1, 1);
         okay = psMemCheckType(PS_DATA_PLANETRANSFORM, planeTransform);
-        if (!okay )
-            psFree(planeTransform);
+        if (!okay ) psFree(planeTransform);
         ok(okay, "psMemCheckPlaneTransform in memCheckType");
         psFree(planeTransform);
@@ -449,6 +437,5 @@
         poly1 = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, 2);
         okay = psMemCheckType(PS_DATA_POLYNOMIAL1D, poly1);
-        if (!okay )
-            psFree(poly1);
+        if (!okay ) psFree(poly1);
         ok(okay, "psMemCheckPolynomial1D in memCheckType");
         psFree(poly1);
@@ -457,6 +444,5 @@
         poly2 = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 1);
         okay = psMemCheckType(PS_DATA_POLYNOMIAL2D, poly2);
-        if (!okay )
-            psFree(poly2);
+        if (!okay ) psFree(poly2);
         ok(okay, "psMemCheckPolynomial2D in memCheckType");
         psFree(poly2);
@@ -465,6 +451,5 @@
         poly3 = psPolynomial3DAlloc(PS_POLYNOMIAL_ORD, 2, 1, 1);
         okay = psMemCheckType(PS_DATA_POLYNOMIAL3D, poly3);
-        if (!okay )
-            psFree(poly3);
+        if (!okay ) psFree(poly3);
         ok(okay, "psMemCheckPolynomial3D in memCheckType");
         psFree(poly3);
@@ -473,6 +458,5 @@
         poly4 = psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, 2, 1, 2, 1);
         okay = psMemCheckType(PS_DATA_POLYNOMIAL4D, poly4);
-        if (!okay )
-            psFree(poly4);
+        if (!okay ) psFree(poly4);
         ok(okay, "psMemCheckPolynomial4D in memCheckType");
         psFree(poly4);
@@ -481,6 +465,5 @@
         proj = psProjectionAlloc(1, 1, 2.1, 2.1, PS_PROJ_TAN);
         okay = psMemCheckType(PS_DATA_PROJECTION, proj);
-        if (!okay )
-            psFree(proj);
+        if (!okay ) psFree(proj);
         ok(okay, "psMemCheckProjection in memCheckType.");
         psFree(proj);
@@ -490,6 +473,5 @@
         scalar = psScalarAlloc(f64, PS_TYPE_F64);
         okay = psMemCheckType(PS_DATA_SCALAR, scalar);
-        if (!okay )
-            psFree(scalar);
+        if (!okay ) psFree(scalar);
         ok(okay, "psMemCheckScalar in memCheckType");
         psFree(scalar);
@@ -498,6 +480,5 @@
         sphere = psSphereAlloc();
         okay = psMemCheckType(PS_DATA_SPHERE, sphere);
-        if (!okay )
-            psFree(sphere);
+        if (!okay ) psFree(sphere);
         ok(okay, "psMemCheckSphere in memCheckType");
         psFree(sphere);
@@ -506,6 +487,5 @@
         sphereRot = psSphereRotAlloc(0, 0, 20);
         okay = psMemCheckType(PS_DATA_SPHEREROT, sphereRot);
-        if (!okay )
-            psFree(sphereRot);
+        if (!okay ) psFree(sphereRot);
         ok(okay, "psMemCheckSphereRot in memCheckType");
         psFree(sphereRot);
@@ -516,6 +496,5 @@
         spline = psSpline1DAlloc();
         okay = psMemCheckType(PS_DATA_SPLINE1D, spline);
-        if (!okay )
-            psFree(spline);
+        if (!okay ) psFree(spline);
         ok(okay, "psMemCheckSpline1D in memCheckType");
         psFree(spline);
@@ -524,6 +503,5 @@
         stats = psStatsAlloc(PS_STAT_MAX);
         okay = psMemCheckType(PS_DATA_STATS, stats);
-        if (!okay )
-            psFree(stats);
+        if (!okay ) psFree(stats);
         ok(okay, "psMemCheckStats in memCheckType");
         psFree(stats);
@@ -532,6 +510,5 @@
         time = psTimeAlloc(PS_TIME_UT1);
         okay = psMemCheckType(PS_DATA_TIME, time);
-        if (!okay )
-            psFree(time);
+        if (!okay ) psFree(time);
         ok(okay, "psMemCheckTime in memCheckType");
         psFree(time);
@@ -548,5 +525,4 @@
 }
 
-
 #if 0
 void TPmemCorruption( void )
Index: trunk/psLib/test/sys/tap_psString.c
===================================================================
--- trunk/psLib/test/sys/tap_psString.c	(revision 41166)
+++ trunk/psLib/test/sys/tap_psString.c	(revision 41171)
@@ -111,16 +111,16 @@
     {
         psMemId id = psMemGetId();
-        psS32   result = 0;
-        psS32   result1 = 0;
-        char  *strResult;
         char  *stringvalnocopy = "F A I L";
 
         // Test point #4 Verify empty string copy with length - psStringNCopy
-        strResult = psStringNCopy(stringvalnocopy, 0);
-        // Perform string compare and get sting length
-        result = strcmp(strResult, stringvalnocopy);
-        result1 = strlen(strResult);
-        ok(result != 0,
-             "test point #4 strcmp result = %d didn't expected %d",result,0);
+        char *strResult = psStringNCopy(stringvalnocopy, 0);
+
+        // Perform string compare and get string length
+        int result = strcmp(strResult, stringvalnocopy);
+        ok(result != 0, "test point #4 strcmp result = %d, expected %d", result, 4);
+
+        int resultLen = strlen(strResult);
+        ok(resultLen == 0, "test point #4 strcmp result = %d, expected %d", resultLen, 0);
+
         psFree(strResult);
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -149,25 +149,24 @@
     }
 
-// XXX This test needs to be modified to check for maximum size
-//     This will require a mod to psStringNCopy source to check for maximum size
-//
-//psS32 testStringCopy05()
-//{
-//    char  *strResult;
-//    char  stringval[20] = "E R R O R";
-//    psS32   negativeSize = -5;
-//
-//    // Test point #6 Copy string with negative size - psStringNCopy
-//    strResult = psStringNCopy(stringval, negativeSize);
-//    if ( strResult != NULL ) {
-//        fprintf(stderr,"Failed test point #6 return value = %p expected NULL\n",
-//                strResult);
-//        return 1;
-//    }
-//    // Memory should not have been allocated
-//
-//    return 0;
-//}
-
+    // XXX This test needs to be modified to check for maximum size
+    // This will require a mod to psStringNCopy source to check for maximum size
+
+    // psS32 testStringCopy05()
+    skip_start (1, 6, "Skipping psSTringNCopy() because of failure to test max value");
+    {
+      char  *strResult;
+      char  stringval[20] = "E R R O R";
+      psS32   negativeSize = -5;
+
+      // Test point #6 Copy string with negative size - psStringNCopy
+      strResult = psStringNCopy(stringval, negativeSize);
+      if ( strResult != NULL ) {
+        fprintf(stderr,"Failed test point #6 return value = %p expected NULL\n",
+                strResult);
+        return 1;
+      }
+      // Memory should not have been allocated
+    }
+    skip_end();
 
     // testStringCopy06()
@@ -200,17 +199,15 @@
     }
 
-#if 0
     // testStrAppend01()
     {
         psMemId id = psMemGetId();
-        char *str=NULL;
+        char *str = NULL;
         // test nonsensical invocations ...
         ssize_t sz = psStringAppend(NULL, NULL);
-        ok(sz == 0, "Failed test point");
+        ok(!sz, "append NULL string to NULL string");
         sz = psStringAppend(&str, NULL);
-        ok(sz == 0, "Failed test point");
-        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
-    }
-#endif
+        ok(!sz, "append NULL string to NULL string");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
 
     // testStrAppend02()
@@ -251,5 +248,4 @@
     }
 
-#if 0
     // testStrPrepend01()
     {
@@ -263,5 +259,4 @@
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
-#endif
 
     // testStrPrepend02()
Index: trunk/psLib/test/sys/tap_psTrace.c
===================================================================
--- trunk/psLib/test/sys/tap_psTrace.c	(revision 41166)
+++ trunk/psLib/test/sys/tap_psTrace.c	(revision 41171)
@@ -2,7 +2,9 @@
     This code will test whether trace levels can be set successfully.
  
-    XXX: For the last two testpoints, must verify that the results are
-    correct, and put that verification in the test as well.
- *****************************************************************************/
+  XXX : various tests result in text sent to stdout -- these should go to a file 
+        or buffer and be validated against a truth set.
+
+  XXX : some of the error messages have the wrong sense (they report a negative result even if the test is successful)
+*****************************************************************************/
 #include <stdio.h>
 #include <fcntl.h>
@@ -20,5 +22,5 @@
 
 # define DEBUG 1
-# if (DEBUG)
+# if (!DEBUG)
     FILE *output = fopen ("/dev/null", "w");
     int outFD = fileno (output);
@@ -30,33 +32,27 @@
     {
         psMemId id = psMemGetId();
-        psS32 lev = 0;
-        (void)psTraceSetDestination(outFD);
-        for (int i=0;i<10;i++) {
-            (void)psTraceSetLevel(".", i);
-            lev = psTraceGetLevel(".");
-            ok(lev == i, "trace level was %d, actual was %d", i, lev);
-        }
-
-        (void)psTraceSetLevel(".", 3);
-        for (int i=5;i<10;i++) {
-            (void)psTraceSetLevel(".NODE00", i);
-            lev = psTraceGetLevel(".NODE00");
-            ok (lev == i,"(.NODE00) expected trace level was %d, actual was %d",
-                i, lev);
+        psTraceSetDestination(outFD);
+        for (int i = 0; i < 10; i++) {
+            psTraceSetLevel(".", i);
+            int lev = psTraceGetLevel(".");
+            ok (lev == i, "trace level was %d, actual was %d", i, lev);
+        }
+
+        psTraceSetLevel(".", 3);
+        for (int i = 5; i < 10;i++) {
+            psTraceSetLevel(".NODE00", i);
+            int lev1 = psTraceGetLevel(".NODE00");
+            ok (lev1 == i,"(.NODE00) expected trace level was %d, actual was %d", i, lev1);
     
-            lev = psTraceGetLevel(".");
-            ok (lev == 3,
-                "expected trace level was %d, actual was %d", i, 3);
+            int lev2 = psTraceGetLevel(".");
+            ok (lev2 == 3, "expected trace level was %d, actual was %d", 3, lev2);
         }
     
-        (void)psTraceSetLevel(".NODE00.NODE01", 4);
-        for (int i=0;i<10;i++) {
-            (void)psTraceSetLevel(".NODE00.NODE01", i);
-            lev = psTraceGetLevel(".NODE00.NODE01");
-            ok (lev == i,
-                "(.NODE00.NODE01) expected trace level was %d, actual was %d",
-                i, lev);
-        }
-
+        psTraceSetLevel(".NODE00.NODE01", 4);
+        for (int i = 0; i < 10; i++) {
+            psTraceSetLevel(".NODE00.NODE01", i);
+            int lev = psTraceGetLevel(".NODE00.NODE01");
+            ok (lev == i, "(.NODE00.NODE01) expected trace level was %d, actual was %d", i, lev);
+        }
         ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
@@ -64,15 +60,15 @@
 
     // testTrace01()
-    {
-        psMemId id = psMemGetId();
-        (void)psTraceSetDestination(outFD);
-        (void)psTraceSetLevel(".A.B.C.D.E", 5);
-        psTrace(".A.C.D.C",1,"You should not see this");
-        psTrace(".A.B.C.D.E",2,"You should see this");
-        psTrace(".A.B.C.D.E.F",3,"You should see this too");
-        psTracePrintLevels();
-        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
-    }
-
+    // XXX need to check the output on these as part of the test
+    {
+        psMemId id = psMemGetId();
+        psTraceSetDestination(outFD);
+        psTraceSetLevel(".A.B.C.D.E", 5);
+        psTrace(".A.C.D.C",     1, "You should not see this");
+        psTrace(".A.B.C.D.E",   2, "You should see this");
+        psTrace(".A.B.C.D.E.F", 3, "You should see this too");
+        psTracePrintLevels();
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
+    }
 
     // testTrace02()
@@ -80,59 +76,45 @@
         psMemId id = psMemGetId();
         psTraceReset();
-        (void)psTraceSetDestination(outFD);
-        (void)psTraceSetLevel(".A.B", 2);
-        (void)psTraceSetLevel(".A.B.C.D.E", 5);
-        psTracePrintLevels();
-        (void)psTraceSetLevel(".A.B", 10);
-        psTracePrintLevels();
-
-        ok (10 == psTraceGetLevel(".A.B.C"),
-            ".A.B.C did not dynamically inherit a trace level (%d)",
-            psTraceGetLevel(".A.B.C"));
-
-        ok (10 == psTraceGetLevel(".A.B.C.D"),
-            ".A.B.C.D did not dynamically inherit a trace level (%d)",
-            psTraceGetLevel(".A.B.C.D"));
-
-        ok (5 == psTraceGetLevel(".A.B.C.D.E"),
-            ".A.B.C.D.E did dynamically inherit a trace level (%d)",
-            psTraceGetLevel(".A.B.C.D.E"));
-        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
-    }
-
+        psTraceSetDestination(outFD);
+        psTraceSetLevel(".A.B", 2);
+        psTraceSetLevel(".A.B.C.D.E", 5);
+        psTracePrintLevels();
+        psTraceSetLevel(".A.B", 10);
+        psTracePrintLevels();
+
+        ok (10 == psTraceGetLevel(".A.B.C"),     ".A.B.C did not dynamically inherit a trace level (%d)", psTraceGetLevel(".A.B.C"));
+        ok (10 == psTraceGetLevel(".A.B.C.D"),   ".A.B.C.D did not dynamically inherit a trace level (%d)", psTraceGetLevel(".A.B.C.D"));
+        ok ( 5 == psTraceGetLevel(".A.B.C.D.E"), ".A.B.C.D.E did dynamically inherit a trace level (%d)", psTraceGetLevel(".A.B.C.D.E"));
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
+    }
 
     // testTrace03()
     {
         psMemId id = psMemGetId();
-        (void)psTraceSetDestination(outFD);
-
-        for (int i=0;i<10;i++) {
-            (void)psTraceSetLevel(".", i);
+        psTraceSetDestination(outFD);
+
+        for (int i = 0; i < 10; i++) {
+            psTraceSetLevel(".", i);
             psTraceReset();
             int lev = psTraceGetLevel(".");
-            ok (lev == PS_UNKNOWN_TRACE_LEVEL,
-                "expected trace level was %d, actual was %d",
-                PS_UNKNOWN_TRACE_LEVEL, lev);
-        }
-
-        (void)psTraceSetLevel(".", 5);
-        (void)psTraceSetLevel(".a", 4);
-        (void)psTraceSetLevel(".a.b", 3);
-        (void)psTraceSetLevel(".a.b.c", 2);
-        ok (!((5 != psTraceGetLevel(".")) ||
-              (4 != psTraceGetLevel(".a")) ||
-              (3 != psTraceGetLevel(".a.b")) ||
-              (2 != psTraceGetLevel(".a.b.c"))),
-            "trace successFlag = false;levels were not settable?");
-
-        psTraceReset();
-        ok (!((PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".")) ||
-              (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a")) ||
-              (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a.b")) ||
-              (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a.b.c"))),
-            "trace levels were not reset properly");
-        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
-    }
-
+            ok (lev == PS_UNKNOWN_TRACE_LEVEL, "expected trace level was %d, actual was %d", PS_UNKNOWN_TRACE_LEVEL, lev);
+        }
+
+        psTraceSetLevel(".", 5);
+        psTraceSetLevel(".a", 4);
+        psTraceSetLevel(".a.b", 3);
+        psTraceSetLevel(".a.b.c", 2);
+        ok (5 == psTraceGetLevel("."), "level 0");
+	ok (4 == psTraceGetLevel(".a"), "level 1");
+	ok (3 == psTraceGetLevel(".a.b"), "level 2");
+	ok (2 == psTraceGetLevel(".a.b.c"), "level 3");
+
+        psTraceReset();
+        ok (PS_UNKNOWN_TRACE_LEVEL == psTraceGetLevel("."), "trace levels were not reset properly");
+	ok (PS_UNKNOWN_TRACE_LEVEL == psTraceGetLevel(".a"), "trace levels were not reset properly");
+	ok (PS_UNKNOWN_TRACE_LEVEL == psTraceGetLevel(".a.b"), "trace levels were not reset properly");
+	ok (PS_UNKNOWN_TRACE_LEVEL == psTraceGetLevel(".a.b.c"), "trace levels were not reset properly");
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
+    }
 
     // testTrace04()
@@ -140,37 +122,27 @@
         psMemId id = psMemGetId();
         int FD = creat("tst_psTrace02_OUT", 0666);
-        for (int nb = 0 ; nb<4;nb++) {
-            if (nb == 0)
-                (void)psTraceSetDestination(((outFD == 2) ? 1 : outFD));
-            if (nb == 1)
-                (void)psTraceSetDestination(((outFD == 2) ? 2 : outFD));
-            if (nb == 2)
-                (void)psTraceSetDestination(((outFD == 2) ? 0 : outFD));
-            if (nb == 3)
-                (void)psTraceSetDestination(FD);
-
-            (void)psTraceSetLevel(".", 4);
-            psTrace(".", 5, "(0) This message should not be displayed (%x)",
-                    0xbeefface);
-            (void)psTraceSetLevel(".", 7);
-            psTrace(".", 5, "(0) This message should be displayed (%x)",
-                    0xbeefface);
-
-            (void)psTraceSetLevel(".a", 4);
-            psTrace(".a", 5, "(1) This message should not be displayed (%x)",
-                    0xbeefface);
-            (void)psTraceSetLevel(".a", 7);
-            psTrace(".a", 5, "(1) This message should be displayed (%x)",
-                    0xbeefface);
-
-            (void)psTraceSetLevel(".a.b", 4);
-            psTrace(".a.b", 5, "(2) This message should not be displayed (%x)",
-                    0xbeefface);
-            (void)psTraceSetLevel(".a.b", 7);
-            psTrace(".a.b", 5, "(2) This message should be displayed (%x)",
-                    0xbeefface);
-            (void)psTraceSetLevel(".a.b.c", 12);
-            psTrace(".a.b.c", 11, "(3) This message should be displayed (%x)",
-                    0xbeefface);
+        for (int nb = 0; nb < 4; nb++) {
+            if (nb == 0) psTraceSetDestination(((outFD == 2) ? 1 : outFD));
+            if (nb == 1) psTraceSetDestination(((outFD == 2) ? 2 : outFD));
+            if (nb == 2) psTraceSetDestination(((outFD == 2) ? 0 : outFD));
+            if (nb == 3) psTraceSetDestination(FD);
+
+            psTraceSetLevel(".", 4);
+            psTrace(".", 5, "(0) This message should not be displayed (%x)", 0xbeefface);
+            psTraceSetLevel(".", 7);
+            psTrace(".", 5, "(0) This message should be displayed (%x)", 0xbeefface);
+
+            psTraceSetLevel(".a", 4);
+            psTrace(".a", 5, "(1) This message should not be displayed (%x)", 0xbeefface);
+            psTraceSetLevel(".a", 7);
+            psTrace(".a", 5, "(1) This message should be displayed (%x)", 0xbeefface);
+
+            psTraceSetLevel(".a.b", 4);
+            psTrace(".a.b", 5, "(2) This message should not be displayed (%x)", 0xbeefface);
+            psTraceSetLevel(".a.b", 7);
+            psTrace(".a.b", 5, "(2) This message should be displayed (%x)", 0xbeefface);
+
+            psTraceSetLevel(".a.b.c", 12);
+            psTrace(".a.b.c", 11, "(3) This message should be displayed (%x)", 0xbeefface);
         }
         close(FD);
@@ -182,16 +154,16 @@
     {
         psMemId id = psMemGetId();
-        (void)psTraceSetDestination(outFD);
-        (void)psTraceSetLevel(".", 9);
-        (void)psTraceSetLevel(".a", 8);
-        (void)psTraceSetLevel(".b", 7);
-        (void)psTraceSetLevel(".c", 5);
-        (void)psTraceSetLevel(".a.a", 4);
-        (void)psTraceSetLevel(".a.b", 3);
-        (void)psTraceSetLevel(".b.a", 2);
-        (void)psTraceSetLevel(".b.b", 1);
-        (void)psTraceSetLevel(".c.a", 0);
-        (void)psTraceSetLevel(".c.b", 3);
-        (void)psTraceSetLevel(".c.c", 5);
+        psTraceSetDestination(outFD);
+        psTraceSetLevel(".", 9);
+        psTraceSetLevel(".a", 8);
+        psTraceSetLevel(".b", 7);
+        psTraceSetLevel(".c", 5);
+        psTraceSetLevel(".a.a", 4);
+        psTraceSetLevel(".a.b", 3);
+        psTraceSetLevel(".b.a", 2);
+        psTraceSetLevel(".b.b", 1);
+        psTraceSetLevel(".c.a", 0);
+        psTraceSetLevel(".c.b", 3);
+        psTraceSetLevel(".c.c", 5);
         psTracePrintLevels();
         ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
@@ -202,15 +174,15 @@
     {
         psMemId id = psMemGetId();
-        (void)psTraceSetLevel(".", 9);
-        (void)psTraceSetLevel("a", 8);
-        (void)psTraceSetLevel("b", 7);
-        (void)psTraceSetLevel("c", 5);
-        (void)psTraceSetLevel("a.a", 4);
-        (void)psTraceSetLevel("a.b", 3);
-        (void)psTraceSetLevel("b.a", 2);
-        (void)psTraceSetLevel("b.b", 1);
-        (void)psTraceSetLevel("c.a", 0);
-        (void)psTraceSetLevel("c.b", 3);
-        (void)psTraceSetLevel("c.c", 5);
+        psTraceSetLevel(".", 9);
+        psTraceSetLevel("a", 8);
+        psTraceSetLevel("b", 7);
+        psTraceSetLevel("c", 5);
+        psTraceSetLevel("a.a", 4);
+        psTraceSetLevel("a.b", 3);
+        psTraceSetLevel("b.a", 2);
+        psTraceSetLevel("b.b", 1);
+        psTraceSetLevel("c.a", 0);
+        psTraceSetLevel("c.b", 3);
+        psTraceSetLevel("c.c", 5);
         psTracePrintLevels();
         ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
@@ -221,34 +193,33 @@
     {
         psMemId id = psMemGetId();
-        (void)psTraceSetDestination(outFD);
-        (void)psTraceSetLevel(".", 9);
-        (void)psTraceSetLevel(".a", 8);
-        (void)psTraceSetLevel(".b", 7);
-        (void)psTraceSetLevel(".c", 5);
-        (void)psTraceSetLevel(".a.a", 4);
-        (void)psTraceSetLevel(".a.b", 3);
-        (void)psTraceSetLevel(".b.a", 2);
-        (void)psTraceSetLevel(".b.b", 1);
-        (void)psTraceSetLevel(".c.a", 0);
-        (void)psTraceSetLevel(".c.b", 3);
-        (void)psTraceSetLevel(".c.c", 5);
-        psTraceReset();
-
-        if ((psTraceGetLevel(".")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".a")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".b")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".c")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".a.a")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".a.b")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".b.a")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".b.b")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".c.a")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".c.b")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".c.c")!=PS_UNKNOWN_TRACE_LEVEL)) {
-            return 1;
-        }
-        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
-    }
-
+        psTraceSetDestination(outFD);
+        psTraceSetLevel(".", 9);
+        psTraceSetLevel(".a", 8);
+        psTraceSetLevel(".b", 7);
+        psTraceSetLevel(".c", 5);
+        psTraceSetLevel(".a.a", 4);
+        psTraceSetLevel(".a.b", 3);
+        psTraceSetLevel(".b.a", 2);
+        psTraceSetLevel(".b.b", 1);
+        psTraceSetLevel(".c.a", 0);
+        psTraceSetLevel(".c.b", 3);
+        psTraceSetLevel(".c.c", 5);
+        psTraceReset();
+
+	// the reset should clear all of the levels above
+	ok (psTraceGetLevel(".")    == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".a")   == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".b")   == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".c")   == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".a.a") == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".a.b") == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".b.a") == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".b.b") == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".c.a") == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".c.b") == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+	ok (psTraceGetLevel(".c.c") == PS_UNKNOWN_TRACE_LEVEL, "valid trace level");
+
+        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
+    }
 
     // Ensure that the leading dot in the component names are optional.
@@ -257,40 +228,29 @@
         psMemId id = psMemGetId();
         psTraceReset();
-        (void)psTraceSetLevel(".", 9);
-        (void)psTraceSetLevel(".a", 8);
-        (void)psTraceSetLevel(".b", 7);
-        (void)psTraceSetLevel(".c", 5);
-        (void)psTraceSetLevel(".a.a", 4);
-        (void)psTraceSetLevel(".a.b", 3);
-        (void)psTraceSetLevel(".b.a", 2);
-        (void)psTraceSetLevel(".b.b", 1);
-        (void)psTraceSetLevel(".c.a", 0);
-        (void)psTraceSetLevel(".c.b", 3);
-        (void)psTraceSetLevel(".c.c", 5);
-        psTracePrintLevels();
-        if ((psTraceGetLevel(".")!=9) ||
-            (psTraceGetLevel("a")!=8) ||
-            (psTraceGetLevel("b")!=7) ||
-            (psTraceGetLevel("c")!=5) ||
-            (psTraceGetLevel("a.a")!=4) ||
-            (psTraceGetLevel("a.b")!=3) ||
-            (psTraceGetLevel("b.a")!=2) ||
-            (psTraceGetLevel("b.b")!=1) ||
-            (psTraceGetLevel("c.a")!=0) ||
-            (psTraceGetLevel("c.b")!=3) ||
-            (psTraceGetLevel("c.c")!=5)) {
-            printf("psTraceGetLevel(.) is %d", psTraceGetLevel("."));
-            printf("psTraceGetLevel(a) is %d", psTraceGetLevel("a"));
-            printf("psTraceGetLevel(b) is %d", psTraceGetLevel("b"));
-            printf("psTraceGetLevel(c) is %d", psTraceGetLevel("c"));
-            printf("psTraceGetLevel(a.a) is %d", psTraceGetLevel("a.a"));
-            printf("psTraceGetLevel(a.b) is %d", psTraceGetLevel("a.b"));
-            printf("psTraceGetLevel(b.a) is %d", psTraceGetLevel("b.a"));
-            printf("psTraceGetLevel(b.b) is %d", psTraceGetLevel("b.b"));
-            printf("psTraceGetLevel(c.a) is %d", psTraceGetLevel("c.a"));
-            printf("psTraceGetLevel(c.b) is %d", psTraceGetLevel("c.b"));
-            printf("psTraceGetLevel(c.c) is %d", psTraceGetLevel("c.c"));
-            return 1;
-        }
+        psTraceSetLevel(".", 9);
+        psTraceSetLevel(".a", 8);
+        psTraceSetLevel(".b", 7);
+        psTraceSetLevel(".c", 5);
+        psTraceSetLevel(".a.a", 4);
+        psTraceSetLevel(".a.b", 3);
+        psTraceSetLevel(".b.a", 2);
+        psTraceSetLevel(".b.b", 1);
+        psTraceSetLevel(".c.a", 0);
+        psTraceSetLevel(".c.b", 3);
+        psTraceSetLevel(".c.c", 5);
+        psTracePrintLevels();
+
+        ok(psTraceGetLevel(".")   == 9, "level is valid without first dot");
+        ok(psTraceGetLevel("a")   == 8, "level is valid without first dot");
+        ok(psTraceGetLevel("b")   == 7, "level is valid without first dot");
+        ok(psTraceGetLevel("c")   == 5, "level is valid without first dot");
+        ok(psTraceGetLevel("a.a") == 4, "level is valid without first dot");
+        ok(psTraceGetLevel("a.b") == 3, "level is valid without first dot");
+        ok(psTraceGetLevel("b.a") == 2, "level is valid without first dot");
+        ok(psTraceGetLevel("b.b") == 1, "level is valid without first dot");
+        ok(psTraceGetLevel("c.a") == 0, "level is valid without first dot");
+        ok(psTraceGetLevel("c.b") == 3, "level is valid without first dot");
+        ok(psTraceGetLevel("c.c") == 5, "level is valid without first dot");
+
         ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
Index: trunk/psLib/test/sys/tst_psConfigure.c
===================================================================
--- trunk/psLib/test/sys/tst_psConfigure.c	(revision 41166)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/** @file  tst_psConfigure.c
- *
- *  @brief Test driver for psconfigure functions
- *
- *  This test driver contains the following test points for psConfigure
- *  functions.
- *    1) Return current psLib version
- *
- *  Return:   Number of test points which failed
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-07-13 02:47:01 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib_strict.h"
-#include "psTest.h"
-
-
-static psS32 psLibVersion00(void);
-
-
-testDescription tests[] = {
-                              {psLibVersion00, 0, "Return current psLib version", 0, false},
-                              {NULL}
-                          };
-
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    return(!runTestSuite( stderr, "psConfigure", tests, argc, argv));
-}
-
-
-static psS32 psLibVersion00(void)
-{
-    char *stringVal = NULL;
-
-    stringVal = psLibVersion();
-    psLogMsg(__func__,PS_LOG_INFO,"Current psLib version is: %s", stringVal);
-    psFree(stringVal);
-
-
-    return 0;
-}
-
Index: trunk/psLib/test/sys/tst_psError.c
===================================================================
--- trunk/psLib/test/sys/tst_psError.c	(revision 41166)
+++ 	(revision )
@@ -1,394 +1,0 @@
-/** @file  tst_psError.c
- *
- *  @brief Test driver for psError function
- *
- *  This test driver contains the following test points for psError
- *     testError00 - psError()                          (Testpoint #486)
- *     testError01 - psErrorMsg(), psErrorStackPrint()  (Testpoint #725)
- *     testError02 - psErrorStackPrintV()               (Testpoint #726)
- *     testError03 - psErrorGet(), psErrorLast()        (Testpoint #727)
- *     testError04 - psErrorClear()                     (Testpoint #728)
- *     testError05 - psErrorCodeString()                (Testpoint #729)
- *
- *  @author  Eric Van Alst, MHPCC
- *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-02-27 23:56:12 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static psS32 testError00(void);
-static psS32 testError01(void);
-static psS32 testError02(void);
-static psS32 testError03(void);
-static psS32 testError04(void);
-static psS32 testError05(void);
-static psS32 testErrorRegister(void);
-
-// Function used in testError02 to verify the psErrorStackPrintV function
-static void myErrorStackPrint(FILE *fd,
-                              const char *fmt,
-                              ...)
-{
-    va_list ap;
-
-    // Test whether psErrorStackPrintV() accept a va_list for output variables
-    va_start(ap, fmt);
-    psErrorStackPrintV(fd, fmt, ap);
-    va_end(ap);
-}
-
-testDescription tests[] = {
-                              {testError00, 486, "psError()", 0, false},
-                              {testError01, 725, "psErrorMsg(),psErrorStackPrint()", 0, false},
-                              {testError02, 726, "psErrorStackPrintV()", 0, false},
-                              {testError03, 727, "psErrorGet(),psErrorLast()", 0, false},
-                              {testError04, 728, "psErrorClear()", 0, false},
-                              {testError05, 729, "psErrorCodeString()", 0, false},
-                              {testErrorRegister, 751, "psErrorRegister()", 0, false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-//    return ( !runTestSuite(stderr, "psError", tests, argc, argv) );
-    testError03();
-}
-
-static psS32 testError05(void)
-{
-    psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE;
-
-    // Verify the return value of psErrorCodeString
-    psLogMsg("tst_psError05", PS_LOG_INFO, psErrorCodeString(code));
-
-    // Verify the return value of psErrorCodeString if code is negative
-    if( psErrorCodeString(-1) != NULL) {
-        psLogMsg("tst_psError05", PS_LOG_INFO, "Failed error string with neg. code");
-        return 40;
-    }
-
-    return 0;
-}
-
-static psS32 testError04(void)
-{
-    psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE;
-    psErr *last = NULL;
-    psErr *lastAfterClear = NULL;
-
-    // With an attemp error stack call psErrorClear
-    psErrorClear();
-
-    // Get the last error message and verify PS_ERR_NONE (empty stack)
-    lastAfterClear = psErrorLast();
-    if(lastAfterClear->code != PS_ERR_NONE) {
-        psLogMsg("tst_psError05", PS_LOG_ERROR, "psErrorLast did not return expected.");
-        return 30;
-    }
-    psFree(lastAfterClear);
-
-    // Generate three error messages to have messages on error stack
-    if (psError(code, true, "Error code = %d", code) !=  code) {
-        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
-        return 31;
-    }
-    if (psError((code+1), false, "Error code = %d", (code+1)) != (code+1)) {
-        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
-        return 32;
-    }
-    if (psError((code+2), false, "Error code = %d", (code+2)) != (code+2)) {
-        psLogMsg("tst_psError04", PS_LOG_ERROR, "Failed return value verify.");
-        return 33;
-    }
-
-    // Get the last error message and verify it has the expected code
-    last = psErrorLast();
-    if(last->code != (code+2)) {
-        psLogMsg("tst_psError04", PS_LOG_ERROR, "psErrorLast did not return expected.");
-        return 34;
-    }
-    psFree(last);
-
-    // Clear the error stack
-    psErrorClear();
-
-    // Get the last error message after clear and verify is has PS_ERR_NONE code
-    lastAfterClear = psErrorLast();
-    if(lastAfterClear->code != PS_ERR_NONE) {
-        psLogMsg("tst_psError05", PS_LOG_ERROR, "psErrorLast did not return expected.");
-        return 35;
-    }
-    psFree(lastAfterClear);
-
-    return 0;
-}
-
-static psS32 testError03(void)
-{
-    psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE;
-    psErr *last = NULL;
-    psErr *getErr = NULL;
-
-    // Attempt to get last error message with an empty stack verify psErr with code PS_ERR_NONE
-    last = psErrorLast();
-    if(last->code != PS_ERR_NONE) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "psErrorLast did return PS_ERR_NONE for empty stack");
-        return 20;
-    }
-    psFree(last);
-
-    // Attempt to get specific error message with empty stack verify psErr with code PS_ERR_NONE
-    getErr= psErrorGet(2);
-    if(getErr->code != PS_ERR_NONE) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "psErrorGet did not return PS_ERR_NONE  for empty stack");
-        return 21;
-    }
-    psFree(getErr);
-
-    // Attempt to get error message with invalid index and an empty stack
-    getErr= psErrorGet(-1);
-    if(getErr->code != PS_ERR_NONE) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "psErrorGet with invalid index/empty stack");
-        return 22;
-    }
-    psFree(getErr);
-
-    // Generate three error messages
-    if (psError(code, true, "Error code = %d", code) !=  code) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify.");
-        return 23;
-    }
-    if (psError((code+1), false, "Error code = %d", (code+1)) != (code+1)) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify.");
-        return 24;
-    }
-    if (psError((code+2), false, "Error code = %d", (code+2)) != (code+2)) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "Failed return value verify.");
-        return 25;
-    }
-
-    last = psErrorLast();
-    getErr= psErrorGet(0);
-
-    // Check that last and get with 0 index are equal
-    if(last != getErr) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "psErrorGet(0) not equal to psErrorLast");
-        return 26;
-    }
-    psFree(last);
-
-    // Verify the last error message was returned
-    if ( getErr->code != (code+2) ) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "psErrorLast() did not retrieve last error");
-        return 27;
-    }
-    psFree(getErr);
-
-    // Verify the middle error message can be retrieved
-    getErr= psErrorGet(1);
-    if ( getErr->code != (code+1)) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "psErrorGet() did not retrieve proper error");
-        return 28;
-    }
-    psFree(getErr);
-
-    // Verify the psErrorGet returns NULL if an invalid index is given
-    getErr= psErrorGet(-1);
-    if ( getErr->code != PS_ERR_NONE ) {
-        psLogMsg("tst_psError03", PS_LOG_ERROR, "psErrorGet() did not return PS_ERR_NONE w/ invalid arg");
-        return 29;
-    }
-    psFree(getErr);
-
-    return 0;
-}
-
-static psS32 testError02(void)
-{
-    psErrorCode code = PS_ERR_BAD_PARAMETER_VALUE;
-
-    // Generate error message and verify return value
-    if (psError(code, true, "Error code = %d", code) != code ) {
-        psLogMsg("tst_psError02", PS_LOG_ERROR, "Failed return value verify.");
-        return 10;
-    }
-    myErrorStackPrint(stderr,"ERROR STACK PRINT Test%dA",2);
-
-    return 0;
-}
-
-static psS32 testError01(void)
-{
-    psErrorCode code=PS_ERR_BAD_PARAMETER_VALUE;
-
-    // Verify the return value of psErrorMsg is the psErrorCode passed
-    if ( psError(code, true, "Error code = %d", code) != code) {
-        psLogMsg("tst_psError01", PS_LOG_ERROR, "Failed return value verify.");
-        return 1;
-    }
-    psErrorStackPrint(stderr,"ERROR STACK PRINT Test1A");
-
-    // test1B empty string in for name argument
-    if ( psError(code+1, true, "Error code = %d", code+1) != code+1) {
-        psLogMsg("tst_psError01", PS_LOG_ERROR, "Failed return with empty string.");
-        return 2;
-    }
-    psErrorStackPrint(stderr,"ERROR STACK PRINT Test1B");
-
-    // test1D undefined code
-    if ( psError(-1, true, "Error code = %d", -1) != -1) {
-        psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with undefined code.");
-        return 4;
-    }
-    psErrorStackPrint(stderr,"ERROR STACK PRINT Test1D");
-
-    // test1E set psErrorMsg argument to false
-    if( psError(code, false, "Error code = %d", code) != code) {
-        psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with false new arg.");
-        return 5;
-    }
-    psErrorStackPrint(stderr,"ERROR STACK PRINT Test1E");
-
-    // test1F psErrorMsg with a error code less then PS_ERR_BASE(256)
-    if( psError(9, true, "Errno code = %d", 9) != 9) {
-        psLogMsg("test_psError01", PS_LOG_ERROR, "Failed return with errno code.");
-        return 6;
-    }
-    psErrorStackPrint(stderr,"ERROR STACK PRINT Test1F");
-
-    return 0;
-}
-
-static psS32 testError00(void)
-{
-
-    psS32  intval=1;
-    psS64 longval = 2;
-    float floatval = 3.01;
-    char  charval = 'E';
-    char *stringval = "E R R O R";
-
-    // Test point #1 Multiple type values placed in the error string
-    psError(PS_ERR_UNKNOWN, true,
-            "ALL TYPES intval = %d longval = %lld floatval = %f charval = %c strval = %s",
-            intval,longval,floatval,charval,stringval);
-
-    // Test point #2 String values in error message
-    psError(PS_ERR_UNKNOWN, true, "NO VALUES");
-
-    // Test point #3 Empty strings in error message
-    psError(PS_ERR_UNKNOWN, true, "");
-
-    return 0;
-}
-
-static psS32 testErrorRegister(void)
-{
-
-    psS32 numErr = 4;
-    psErrorDescription errDesc[] = { {PS_ERR_N_ERR_CLASSES+1,"first"},
-                                     {PS_ERR_N_ERR_CLASSES+2,"second"},
-                                     {PS_ERR_N_ERR_CLASSES+3,"third"},
-                                     {PS_ERR_N_ERR_CLASSES+4,"fourth"} };
-    /*
-        1. invoke psErrorRegister with a n>1 array of psErrorDescriptions. Verify that:
-            a. Each error description given is retrievable with psErrorCodeString.
-    */
-    psErrorRegister(errDesc,numErr);
-
-    for (psS32 i = 0; i < numErr; i++) {
-        const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+1+i);
-        if (desc == NULL) {
-            psLogMsg(__func__,PS_LOG_ERROR,
-                     "psErrorCode didn't find registered error code.");
-            return 1+i*10;
-        }
-        if (strcmp(desc,errDesc[i].description) != 0) {
-            psLogMsg(__func__,PS_LOG_ERROR,
-                     "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.",
-                     desc,errDesc[i].description);
-            return 2+i*10;
-        }
-    }
-
-    /*
-        2. invoke psErrorCodeString with a static/builtin psLib error code. Verify:
-            a. the result is correct.
-    */
-    const char* desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES);
-    if (desc == NULL) {
-        psLogMsg(__func__,PS_LOG_ERROR,
-                 "psErrorCode didn't find static error code.");
-        return 40;
-    }
-    if (strcmp(desc,"error classes end marker") != 0) {
-        psLogMsg(__func__,PS_LOG_ERROR,
-                 "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.",
-                 desc,"error classes end marker");
-        return 41;
-    }
-
-    desc = psErrorCodeString(PS_ERR_NONE);
-    if (desc == NULL) {
-        psLogMsg(__func__,PS_LOG_ERROR,
-                 "psErrorCode didn't find static error code.");
-        return 42;
-    }
-    if (strcmp(desc,"not an error") != 0) {
-        psLogMsg(__func__,PS_LOG_ERROR,
-                 "psErrorCode didn't return the proper description.  Got '%s', expected '%s'.",
-                 desc,"not an error");
-        return 43;
-    }
-
-    /*
-        3. invoke psErrorCodeString with an invalid code. Verify a NULL is returned.
-    */
-    desc = psErrorCodeString(PS_ERR_N_ERR_CLASSES+numErr+1);
-    if (desc != NULL) {
-        psLogMsg(__func__,PS_LOG_ERROR,
-                 "psErrorCode didn't return a NULL with a bogus input code.");
-        return 44;
-    }
-
-    /*
-        4. invoke psErrorRegister with a NULL psErrorDescription. Verify that:
-            a. the execution does not cease.
-            b. an appropriate error is generated.
-    */
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error.");
-    psErrorClear();
-    psErrorRegister(NULL,1);
-    psErr* err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_NULL) {
-        psLogMsg(__func__,PS_LOG_ERROR,
-                 "psErrorCode didn't generate proper error code for NULL input.");
-        return 45;
-    }
-    psFree(err);
-
-    /*
-        5. invoke psErrorRegister with nerror=0. Verify that no error occurs.
-    */
-    psErrorClear();
-    psErrorRegister(errDesc,0);
-    err = psErrorLast();
-    if (err->code != PS_ERR_NONE) {
-        psLogMsg(__func__,PS_LOG_ERROR,
-                 "psErrorCode generated an error for nErrors = 0.");
-        return 46;
-    }
-    psFree(err);
-    return 0;
-}
Index: trunk/psLib/test/sys/tst_psLine.c
===================================================================
--- trunk/psLib/test/sys/tst_psLine.c	(revision 41166)
+++ 	(revision )
@@ -1,142 +1,0 @@
-/** @file  tst_psLine.c
- *
- *  @brief Test driver for psLine functions
- *
- *  @author  dRob, MHPCC
- *
- *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-07-14 02:26:25 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static psS32 testLineAlloc(void);
-static psS32 testLineInit(void);
-static psS32 testLineAdd(void);
-static psS32 testLineChk(void);
-
-testDescription tests[] = {
-                              {testLineAlloc, 0, "Verify Line Alloc/Free", 0, false},
-                              {testLineInit, 1, "Verify Line Init", 0, false},
-                              {testLineAdd, 2, "Verify Line Add", 0, false},
-                              {testLineChk, 3, "Verify Line MemCheck", 0, false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psLine", tests, argc, argv ) );
-}
-
-psS32 testLineAlloc(void)
-{
-    psLine *lineline = NULL;
-    lineline = psLineAlloc(20);
-
-    if (lineline->NLINE != 20) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLine set NLINE parameter incorrectly during Allocation!\n");
-        return 2;
-    }
-    if (lineline->Nline != 0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLine set Nline parameter incorrectly during Allocation!\n");
-        return 2;
-    }
-    strncpy(lineline->line, "Hello World", 20);
-    if (strncmp(lineline->line, "Hello World", 20)) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLine was unable to store a simple string!\n");
-        return 3;
-    }
-
-    psFree(lineline);
-
-    return 0;
-}
-
-psS32 testLineInit(void)
-{
-    psLine *line = NULL;
-    //Return false for NULL input
-    if (psLineInit(line) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLineInit failed.  Expected false for NULL psLine input.\n");
-        return 1;
-    }
-    //Allocate a line and return true on Init
-    line = psLineAlloc(1);
-    if(!psLineInit(line) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLineInit failed.  Expected true for valid psLine input.\n");
-        return 2;
-    }
-    if (line->NLINE != 1 || line->Nline != 0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLineInit failed to return the correct line parameters.\n");
-        return 3;
-    }
-
-    psFree(line);
-
-    return 0;
-}
-
-psS32 testLineAdd(void)
-{
-    psLine *line = NULL;
-    //Return false for NULL input
-    if (psLineAdd(line, "Hello World") ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLineAdd failed.  Expected false for NULL psLine input.\n");
-        return 1;
-    }
-    //Allocate and return true for valid input.
-    line = psLineAlloc(20);
-    if (!psLineAdd(line, "Hello %s", "World") ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLineAdd failed.  Expected true for valid psLine input.\n");
-        return 2;
-    }
-    if (line->NLINE != 20 || line->Nline != 11) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLineAdd failed to return the correct line parameters.\n");
-        return 3;
-    }
-    if (strncmp(line->line, "Hello World", 20)) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psLineAdd failed to store the correct line string.\n");
-        printf("\n  %s\n", line->line);
-        return 4;
-    }
-
-    psFree(line);
-
-    return 0;
-}
-
-psS32 testLineChk(void)
-{
-    psLine *line = NULL;
-    //Return false for Null input line
-    if (psMemCheckLine(line)) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psMemCheckLine failed to return false for NULL line input.\n");
-        return 1;
-    }
-    line = psLineAlloc(1);
-    if (!psMemCheckLine(line)) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psMemCheckLine failed to return true for valid line input.\n");
-        return 2;
-    }
-    psFree(line);
-
-    return 0;
-}
Index: trunk/psLib/test/sys/tst_psMemory.c
===================================================================
--- trunk/psLib/test/sys/tst_psMemory.c	(revision 41166)
+++ 	(revision )
@@ -1,827 +1,0 @@
-/** @file  tst_psMemory.c
-*
-*  @brief Contains the tests for psMemory.[ch]
-*
-*
-*  @author Robert DeSonia, MHPCC
-*
-*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-04-04 19:52:55 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <limits.h>
-#include <stdlib.h>
-
-
-#include "psTest.h"
-#include "pslib.h" // need to allow malloc for callback use
-
-static psS32 TPFreeReferencedMemory( void );
-static psS32 TPOutOfMemory( void );
-static psS32 TPReallocOutOfMemory( void );
-static psPtr TPOutOfMemoryExhaustedCallback( size_t size );
-static psS32 TPCheckBufferPositive( void );
-static psS32 TPrealloc( void );
-static psS32 TPallocCallback( void );
-static psMemId memAllocCallback( const psMemBlock *ptr );
-static psMemId memFreeCallback( const psMemBlock *ptr );
-static psS32 TPcheckLeaks( void );
-static psS32 TPmemCorruption( void );
-static psS32 TPmultipleFree( void );
-static psS32 memCheckTypes( void );
-void memProblemCallback( psMemBlock *ptr, const char *filename, unsigned int lineno );
-
-static psS32 problemCallbackCalled = 0;
-static psS32 allocCallbackCalled = 0;
-static psS32 freeCallbackCalled = 0;
-static psS32 exhaustedCallbackCalled = 0;
-
-testDescription tests[] = {
-                              {TPCheckBufferPositive, 449, "checkBufferPositive", 0, false},
-                              {TPOutOfMemory, 450, "outOfMemory", -6, false},
-                              {TPReallocOutOfMemory, 562, "reallocOutOfMemory", -6, false},
-                              {TPrealloc, 451, "psRealloc", 0, false},
-                              {TPallocCallback, 452, "allocCallback", 0, false},
-                              {TPallocCallback, 453, "allocCallback2", 0, true},
-                              {TPcheckLeaks, 454, "checkLeaks", 0, false},
-                              {TPmemCorruption, 455, "psMemCorruption", 0, false},
-                              {TPFreeReferencedMemory, 456, "freeReferencedMemory", 0, false},
-                              {TPmultipleFree, 699, "multipleFree", -6, false},
-                              {memCheckTypes, 700, "psMemCheckType", 0, false},
-                              {NULL}
-                          };
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetFormat("HLNM");
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psMemory", tests, argc, argv ) );
-}
-
-// Testpoint #449, psAlloc shall allocate memory blocks writeable by caller.
-psS32 TPCheckBufferPositive( void )
-{
-    psS32 * mem;
-    const psS32 size = 100;
-    psS32 failed = 0;
-
-    psLogMsg( __func__, PS_LOG_INFO, "psAlloc shall allocate memory blocks writeable by caller.\n" );
-
-    mem = ( psS32* ) psAlloc( size * sizeof( psS32 ) );
-    if ( mem == NULL ) {
-        psError(PS_ERR_UNKNOWN, true, "psAlloc returned a NULL value in %s!", __func__ );
-        return 1;
-    }
-
-    for ( psS32 index = 0;index < size;index++ ) {
-        mem[ index ] = index;
-    }
-
-    for ( psS32 index = 0;index < size;index++ ) {
-        if ( mem[ index ] != index ) {
-            failed++;
-        }
-    }
-
-    psFree( mem );
-
-    return failed;
-}
-
-psS32 TPFreeReferencedMemory( void )
-{
-    // create memory
-    psS32 * mem;
-    psS32 ref = 0;
-
-    psLogMsg( __func__, PS_LOG_INFO, "memory reference count shall be incrementable/decrementable" );
-
-    mem = ( psS32* ) psAlloc( 100 * sizeof( psS32 ) );
-
-    ref = psMemGetRefCounter( mem );
-    if ( ref != 1 ) {
-        psError(PS_ERR_UNKNOWN, true, "Expected to buffer reference count to be initially 1, but it was %d.", ref );
-        return 1;
-    }
-
-    psMemIncrRefCounter( mem );
-    psMemIncrRefCounter( mem );
-    psMemIncrRefCounter( mem );
-
-    ref = psMemGetRefCounter( mem );
-    if ( ref != 4 ) {
-        psError(PS_ERR_UNKNOWN, true, "Expected to find buffer reference count to be 4, but it was %d.", ref );
-        return 1;
-    }
-
-    psMemDecrRefCounter( mem );
-    psMemDecrRefCounter( mem );
-
-    ref = psMemGetRefCounter( mem );
-    if ( ref != 2 ) {
-        psError(PS_ERR_UNKNOWN, true, "Expected to find buffer reference count to be 2, but it was %d.", ref );
-        return 1;
-    }
-
-    psLogMsg( __func__, PS_LOG_INFO, "psFree shall be just decrement a multiple refererenced pointer." );
-
-    psMemDecrRefCounter( mem );
-
-    ref = psMemGetRefCounter( mem );
-    if ( ref != 1 ) {
-        psError(PS_ERR_UNKNOWN, true, "Expected to find buffer reference count to be 1, but it was %d.", ref );
-        return 1;
-    }
-
-    psFree( mem );
-
-    return 0;
-}
-
-// Bug/Task #562 regression test.  Upon requesting more memory than is available, psRealloc shall call
-// the psMemExhaustedCallback.
-psS32 TPReallocOutOfMemory( void )
-{
-    psS32 * mem[ 100 ];
-    psMemExhaustedCallback cb;
-
-    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
-        mem[ lcv ] = NULL;
-    }
-
-    psLogMsg( __func__, PS_LOG_INFO, "Upon requesting more memory than is available, psRealloc shall call "
-              "the psMemExhaustedCallback.\n" );
-
-    exhaustedCallbackCalled = 0;
-
-    cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback );
-
-    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
-        mem[ lcv ] = ( psS32* ) psAlloc( 10 );
-    }
-
-    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
-        mem[ lcv ] = ( psS32* ) psRealloc( mem[ lcv ], SIZE_MAX/2 - 1000 );
-    }
-
-    psMemExhaustedCallbackSet( cb );
-
-    if ( exhaustedCallbackCalled == 0 ) {
-        psError(PS_ERR_UNKNOWN,true, "Called psRealloc with HUGE memory requirement and survived in %s!", __func__ );
-        return 1;
-    }
-
-    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
-        psFree( mem[ lcv ] );
-    }
-
-    return 0;
-}
-// Testpoint #450,  Upon requesting more memory than is available, psalloc shall call
-// the psMemExhaustedCallback.
-psS32 TPOutOfMemory( void )
-{
-    psS32 * mem[ 100 ];
-    psMemExhaustedCallback cb;
-
-    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
-        mem[ lcv ] = NULL;
-    }
-
-    psLogMsg( __func__, PS_LOG_INFO, "Upon requesting more memory than is available, psalloc shall call "
-              "the psMemExhaustedCallback.\n" );
-
-    exhaustedCallbackCalled = 0;
-
-    cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback );
-
-    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
-        mem[ lcv ] = ( psS32* ) psAlloc( SIZE_MAX/2 - 1000 );
-    }
-
-    psMemExhaustedCallbackSet( cb );
-
-    if ( exhaustedCallbackCalled == 0 ) {
-        psError(PS_ERR_UNKNOWN,true, "Called psAlloc with HUGE memory requirement and survived in %s!", __func__ );
-        return 1;
-    }
-
-    for ( psS32 lcv = 0; lcv < 100; lcv++ ) {
-        psFree( mem[ lcv ] );
-    }
-
-    return 0;
-}
-
-// Testpoint #451,  psRealloc shall increase/decrease memory buffer while preserving contents
-psS32 TPrealloc( void )
-{
-    psS32 * mem1;
-    psS32* mem2;
-    psS32* mem3;
-    const psS32 initialSize = 100;
-
-    psLogMsg( __func__, PS_LOG_INFO, "psRealloc shall increase/decrease memory buffer while "
-              "preserving contents" );
-
-    // allocate buffer with known values.
-    mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
-    mem2 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
-    mem3 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
-    for ( psS32 lcv = 0;lcv < initialSize;lcv++ ) {
-        mem1[ lcv ] = mem2[ lcv ] = mem3[ lcv ] = lcv;
-    }
-
-    psMemCheckCorruption( 1 );
-    psLogMsg( __func__, PS_LOG_INFO, "Expanding memory buffer." );
-
-    // realloc to 2x
-    mem1 = ( psS32* ) psRealloc( mem1, 2 * initialSize * sizeof( psS32 ) );
-    mem2 = ( psS32* ) psRealloc( mem2, 2 * initialSize * sizeof( psS32 ) );
-    mem3 = ( psS32* ) psRealloc( mem3, 2 * initialSize * sizeof( psS32 ) );
-
-    // check values of initial block
-    for ( psS32 i = 0;i < initialSize;i++ ) {
-        if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) {
-            psError(PS_ERR_UNKNOWN,true, "Realloc didn't preserve the contents with expanding buffer in %s.",
-                    __func__ );
-            break;
-        }
-    }
-
-    psMemCheckCorruption( 1 );
-    psLogMsg( __func__, PS_LOG_INFO, "Shrinking memory buffer." );
-
-    // realloc to 1/2 initial value.
-    mem1 = ( psS32* ) psRealloc( mem1, ( initialSize / 2 ) * sizeof( psS32 ) );
-    mem2 = ( psS32* ) psRealloc( mem2, ( initialSize / 2 ) * sizeof( psS32 ) );
-    mem3 = ( psS32* ) psRealloc( mem3, ( initialSize / 2 ) * sizeof( psS32 ) );
-
-    // check values of initial block
-    for ( psS32 i = 0;i < initialSize / 2;i++ ) {
-        if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) {
-            psError(PS_ERR_UNKNOWN,true, "Realloc didn't preserve the contents with shrinking buffer in %s.",
-                    __func__ );
-            break;
-        }
-    }
-
-    psFree( mem1 );
-    psFree( mem2 );
-    psFree( mem3 );
-
-    return 0;
-}
-
-psS32 TPallocCallback( void )
-{
-    psS32 * mem1;
-    psS32* mem2;
-    psS32* mem3;
-    psS32 currentId = psMemGetId();
-    const psS32 initialSize = 100;
-    psS32 mark;
-
-    allocCallbackCalled = 0;
-    freeCallbackCalled = 0;
-    psMemAllocCallbackSet( memAllocCallback );
-    psMemFreeCallbackSet( memFreeCallback );
-
-    psMemAllocCallbackSetID( currentId + 1 );
-    psMemFreeCallbackSetID( currentId + 1 );
-
-    psLogMsg( __func__, PS_LOG_INFO, "call to psAlloc/psRealloc shall generate a callback if specified "
-              "memory ID is allocated." );
-
-    // allocate buffer with known values.
-    mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
-    mem2 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
-    mem3 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
-
-    psFree( mem1 );
-    psFree( mem2 );
-    psFree( mem3 );
-
-    if ( allocCallbackCalled != 2 || freeCallbackCalled != 2 ) {
-        psError(PS_ERR_UNKNOWN,true, "alloc/free callbacks were not called the proper number of times in %s",
-                __func__ );
-        return 1;
-    }
-
-    allocCallbackCalled = 0;
-    freeCallbackCalled = 0;
-
-    mark = psMemGetId();
-
-    mem1 = ( psS32* ) psAlloc( initialSize * sizeof( psS32 ) );
-
-    psMemAllocCallbackSetID( mark );
-
-    mem1 = ( psS32* ) psRealloc( mem1, initialSize * 2 * sizeof( psS32 ) );
-
-    psFree( mem1 );
-
-    if ( allocCallbackCalled != 2 ) {
-        psError(PS_ERR_UNKNOWN,true, "realloc callbacks were not called the proper number of times in %s",
-                __func__ );
-        return 1;
-    }
-
-    return 0;
-
-}
-
-psS32 TPcheckLeaks( void )
-{
-    const psS32 numBuffers = 5;
-    psS32* buffers[ 5 ];
-    psS32 lcv;
-    psS32 currentId = psMemGetId();
-    psMemBlock** blks;
-    psS32 nLeaks = 0;
-    psS32 lineMark = 0;
-
-    psLogMsg( __func__, PS_LOG_INFO, "psMemCheckLeaks shall return the number of blocks above an ID "
-              "that are still allocated" );
-
-    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
-        lineMark = __LINE__ + 1;
-        buffers[ lcv ] = psAlloc( sizeof( psS32 ) );
-    }
-
-    for ( lcv = 1;lcv < numBuffers;lcv++ ) {
-        psFree( buffers[ lcv ] );
-    }
-
-    psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one instance." );
-
-    nLeaks = psMemCheckLeaks( currentId, &blks, stderr, false );
-
-    if ( nLeaks != 1 ) {
-        psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
-        return 1;
-    }
-
-    if ( blks[ 0 ] ->lineno != lineMark ) {
-        psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks found a leak other than the expected one (line %d vs %d) in %s.",
-                lineMark, blks[ 0 ] ->lineno, __func__ );
-        return 1;
-    }
-
-    psFree( buffers[ 0 ] );
-    psFree( blks );
-
-    psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with a different leak location" );
-    psMemCheckLeaks(currentId,NULL,stderr, false);
-
-    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
-        lineMark = __LINE__ + 1;
-        buffers[ lcv ] = psAlloc( sizeof( psS32 ) );
-    }
-
-    for ( lcv = 0;lcv < numBuffers - 1;lcv++ ) {
-        psFree( buffers[ lcv ] );
-    }
-
-    psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one error." );
-
-    nLeaks = psMemCheckLeaks( currentId, &blks, stderr, false );
-
-    if ( nLeaks != 1 ) {
-        psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
-        return 1;
-    }
-
-    if ( blks[ 0 ] ->lineno != lineMark ) {
-        psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ );
-        return 1;
-    }
-
-    psFree( buffers[ 4 ] );
-    psFree( blks );
-
-    psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with multiple leak locations." );
-
-    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
-        lineMark = __LINE__ + 1;
-        buffers[ lcv ] = psAlloc( sizeof( psS32 ) );
-    }
-
-    for ( lcv = 0;lcv < numBuffers;lcv++ ) {
-        if ( lcv % 2 == 0 ) {
-            psFree( buffers[ lcv ] );
-        }
-    }
-
-    psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce two errors." );
-
-    nLeaks = psMemCheckLeaks( currentId, &blks, stderr, false );
-
-    if ( nLeaks != 2 ) {
-        psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );
-        return 1;
-    }
-
-    if ( blks[ 0 ] ->lineno != lineMark ) {
-        psError(PS_ERR_UNKNOWN,true, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ );
-        return 1;
-    }
-
-    psFree( blks );
-    psFree( buffers[ 1 ] );
-    psFree( buffers[ 3 ] );
-
-    return 0;
-}
-
-psS32 TPmemCorruption( void )
-{
-    psS32 * buffer = NULL;
-    psS32 oldValue = 0;
-    psS32 corruptions = 0;
-    psMemProblemCallback cb;
-
-    psLogMsg( __func__, PS_LOG_INFO, "psMemCheckCorruption shall detect memory corruptions" );
-
-    buffer = psAlloc( sizeof( psS32 ) );
-
-    // cause memory corruption via buffer underflow
-    *buffer = 1;
-    buffer--;
-    oldValue = *buffer;
-    *buffer = 2;
-
-    problemCallbackCalled = 0;
-    cb = psMemProblemCallbackSet( memProblemCallback );
-
-    psLogMsg( __func__, PS_LOG_INFO, "psMemCheckCorruption should output an error message and "
-              "memProblemCallback callback should be called." );
-
-    corruptions = psMemCheckCorruption( 0 );
-
-    // restore the memory problem callback
-    psMemProblemCallbackSet( cb );
-
-    // restore the value, 'uncorrupting' the buffer
-    *buffer = oldValue;
-    buffer++;
-
-    psFree( buffer );
-
-    if ( corruptions != 1 ) {
-        psError(PS_ERR_UNKNOWN,true, "Expected one memory corruption but found %d in %s.",
-                corruptions, __func__ );
-        return 1;
-    }
-
-    if ( problemCallbackCalled != 1 ) {
-        psError(PS_ERR_UNKNOWN,true, "The memProblemCallback was not invoked but should have been in %s",
-                __func__ );
-        return 1;
-    }
-
-    return 0;
-
-}
-
-void memProblemCallback( psMemBlock *ptr, const char *file, unsigned int lineno )
-{
-    psLogMsg( __func__, PS_LOG_INFO, "memory callback called for id %lu (%s:%d).",
-              ptr->id, file, lineno );
-    problemCallbackCalled++;
-    return ;
-}
-
-psMemId memAllocCallback( const psMemBlock *ptr )
-{
-    psLogMsg( __func__, PS_LOG_INFO, "block %lu was (re)allocated", ptr->id );
-    allocCallbackCalled++;
-    return 1;
-}
-
-psMemId memFreeCallback( const psMemBlock *ptr )
-{
-    psLogMsg( __func__, PS_LOG_INFO, "block %lu was freed", ptr->id );
-    freeCallbackCalled++;
-    return 1;
-}
-
-psPtr TPOutOfMemoryExhaustedCallback( size_t size )
-{
-    psLogMsg( __func__, PS_LOG_INFO, "Custom MemExhaustedCallback was invoked." );
-    exhaustedCallbackCalled++;
-    return NULL;
-}
-
-psS32 TPmultipleFree( void )
-{
-
-    psPtr buffer = psAlloc( 1024 );
-    psPtr buffer2 = buffer;
-
-    psFree( buffer );
-
-    psLogMsg( __func__, PS_LOG_INFO, "Next should abort due to multiple freeing." );
-    psFree( buffer2 );
-
-    psError(PS_ERR_UNKNOWN,true,
-            "Multiple psFree call survived");
-
-    return 0;
-}
-
-static psS32 memCheckTypes( void )
-{
-    psArray *negative;
-    negative = psArrayAlloc(2);
-    psMetadata *neg;
-    neg = psMetadataAlloc();
-
-    psArray *array;
-    array = psArrayAlloc(100);
-    if ( !psMemCheckType(PS_DATA_ARRAY, array) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckArray failed in memCheckType. \n");
-        psFree(array);
-        return 1;
-    }
-    psLogMsg( __func__, PS_LOG_INFO, "Next should error from invalid datatype." );
-    if ( !psMemCheckType(PS_DATA_ARRAY, neg) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckArray failed in memCheckType. \n");
-    }
-    psFree(array);
-
-    psBitSet *bits;
-    bits = psBitSetAlloc(100);
-    if ( !psMemCheckType(PS_DATA_BITSET, bits) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckBitSet failed in memCheckType. \n");
-        psFree(bits);
-        return 1;
-    }
-    psLogMsg( __func__, PS_LOG_INFO, "Next should error from invalid datatype." );
-    if ( !psMemCheckType(PS_DATA_BITSET, negative) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckBitSet failed in memCheckType. \n");
-    }
-    psFree(bits);
-
-    psCube *cube;
-    cube = psCubeAlloc();
-    if ( !psMemCheckType(PS_DATA_CUBE, cube) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckCube failed in memCheckType. \n");
-        psFree(cube);
-        return 1;
-    }
-    psFree(cube);
-
-    psFits *fits;
-    fits = psFitsOpen("test.fits","w");
-    psImage* img = psImageAlloc(16,16,PS_TYPE_F32);
-    psFitsWriteImage(fits,NULL,img,1,NULL);
-    psFree(img);
-    if ( !psMemCheckType(PS_DATA_FITS, fits) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckFits failed in memCheckType. \n");
-        psFree(fits);
-        return 1;
-    }
-    psFitsClose(fits);
-
-    psHash *hash;
-    hash = psHashAlloc(100);
-    if ( !psMemCheckType(PS_DATA_HASH, hash) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckHash failed in memCheckType. \n");
-        psFree(hash);
-        return 1;
-    }
-    psFree(hash);
-
-    psHistogram *histogram;
-    histogram = psHistogramAlloc(1.1, 2.2, 2);
-    if ( !psMemCheckType(PS_DATA_HISTOGRAM, histogram) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckHistogram failed in memCheckType. \n");
-        psFree(histogram);
-        return 1;
-    }
-    psFree(histogram);
-
-    psImage *image;
-    image = psImageAlloc(5, 5, PS_TYPE_F32);
-    if ( !psMemCheckType(PS_DATA_IMAGE, image) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckImage failed in memCheckType. \n");
-        psFree(image);
-        return 1;
-    }
-    psFree(image);
-
-    psKernel *kernel;
-    kernel = psKernelAlloc(0, 1, 0, 1);
-    if ( !psMemCheckType(PS_DATA_KERNEL, kernel) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckKernel failed in memCheckType. \n");
-        psFree(kernel);
-        return 1;
-    }
-    psFree(kernel);
-
-    psList *list;
-    list = psListAlloc(NULL);
-    if ( !psMemCheckType(PS_DATA_LIST, list) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckList failed in memCheckType. \n");
-        psFree(list);
-        return 1;
-    }
-    psFree(list);
-
-    psLookupTable *lookup;
-    char *file = "tableF32.dat";
-    char *format = "\%f \%lf \%d \%ld";
-    lookup = psLookupTableAlloc(file, format, 10);
-    if ( !psMemCheckType(PS_DATA_LOOKUPTABLE, lookup) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckLookupTable failed in memCheckType. \n");
-        psFree(lookup);
-        return 1;
-    }
-    psFree(lookup);
-
-    psMetadata *metadata;
-    metadata = psMetadataAlloc();
-    if ( !psMemCheckType(PS_DATA_METADATA, metadata) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMetadata failed in memCheckType. \n");
-        psFree(metadata);
-        return 1;
-    }
-    psFree(metadata);
-
-    psMetadataItem *metaItem;
-    metaItem = psMetadataItemAlloc("name", PS_DATA_S32, "COMMENT", 1);
-    if ( !psMemCheckType(PS_DATA_METADATAITEM, metaItem) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMetadataItem failed in memCheckType. \n");
-        psFree(metaItem);
-        return 1;
-    }
-    psFree(metaItem);
-
-    psMinimization *min;
-    min = psMinimizationAlloc(3, 0.1);
-    if ( !psMemCheckType(PS_DATA_MINIMIZATION, min) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMinimization failed in memCheckType. \n");
-        psFree(min);
-        return 1;
-    }
-    psFree(min);
-
-    psPixels *pixels;
-    pixels = psPixelsAlloc(100);
-    if ( !psMemCheckType(PS_DATA_PIXELS, pixels) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPixels failed in memCheckType. \n");
-        psFree(pixels);
-        return 1;
-    }
-    psFree(pixels);
-
-    psPlane *plane;
-    plane = psPlaneAlloc();
-    if ( !psMemCheckType(PS_DATA_PLANE, plane) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlane failed in memCheckType. \n");
-        psFree(plane);
-        return 1;
-    }
-    psFree(plane);
-
-    psPlaneDistort *planeDistort;
-    planeDistort = psPlaneDistortAlloc(1, 1, 1, 1);
-    if ( !psMemCheckType(PS_DATA_PLANEDISTORT, planeDistort) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlaneDistort failed in memCheckType. \n");
-        psFree(planeDistort);
-        return 1;
-    }
-    psFree(planeDistort);
-
-    psPlaneTransform *planeTransform;
-    planeTransform = psPlaneTransformAlloc(1, 1);
-    if ( !psMemCheckType(PS_DATA_PLANETRANSFORM, planeTransform) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlaneTransform failed in memCheckType. \n");
-        psFree(planeTransform);
-        return 1;
-    }
-    psFree(planeTransform);
-
-    psPolynomial1D *poly1;
-    poly1 = psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, 2);
-    if ( !psMemCheckType(PS_DATA_POLYNOMIAL1D, poly1) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial1D failed in memCheckType. \n");
-        psFree(poly1);
-        return 1;
-    }
-    psFree(poly1);
-
-    psPolynomial2D *poly2;
-    poly2 = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 1);
-    if ( !psMemCheckType(PS_DATA_POLYNOMIAL2D, poly2) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial2D failed in memCheckType. \n");
-        psFree(poly2);
-        return 1;
-    }
-    psFree(poly2);
-
-    psPolynomial3D *poly3;
-    poly3 = psPolynomial3DAlloc(PS_POLYNOMIAL_ORD, 2, 1, 1);
-    if ( !psMemCheckType(PS_DATA_POLYNOMIAL3D, poly3) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial3D failed in memCheckType. \n");
-        psFree(poly3);
-        return 1;
-    }
-    psFree(poly3);
-
-    psPolynomial4D *poly4;
-    poly4 = psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, 2, 1, 2, 1);
-    if ( !psMemCheckType(PS_DATA_POLYNOMIAL4D, poly4) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial4D failed in memCheckType. \n");
-        psFree(poly4);
-        return 1;
-    }
-    psFree(poly4);
-
-    psProjection *proj;
-    proj = psProjectionAlloc(1, 1, 2.1, 2.1, PS_PROJ_TAN);
-    if ( !psMemCheckType(PS_DATA_PROJECTION, proj) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckProjection failed in memCheckType. \n");
-        psFree(proj);
-        return 1;
-    }
-    psFree(proj);
-
-    psScalar *scalar;
-    psC64 c64 = 1.1 + 7I;
-    scalar = psScalarAlloc(c64, PS_TYPE_F64);
-    if ( !psMemCheckType(PS_DATA_SCALAR, scalar) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckScalar failed in memCheckType. \n");
-        psFree(scalar);
-        return 1;
-    }
-    psFree(scalar);
-
-    psSphere *sphere;
-    sphere = psSphereAlloc();
-    if ( !psMemCheckType(PS_DATA_SPHERE, sphere) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSphere failed in memCheckType. \n");
-        psFree(sphere);
-        return 1;
-    }
-    psFree(sphere);
-
-    psSphereRot *sphereRot;
-    sphereRot = psSphereRotAlloc(0, 0, 20);
-    if ( !psMemCheckType(PS_DATA_SPHEREROT, sphereRot) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSphereRot failed in memCheckType. \n");
-        psFree(sphereRot);
-        return 1;
-    }
-    psFree(sphereRot);
-
-    psSpline1D *spline;
-    spline = psSpline1DAlloc(2, 1, 0, 2);
-    if ( !psMemCheckType(PS_DATA_SPLINE1D, spline) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSpline1D failed in memCheckType. \n");
-        psFree(spline);
-        return 1;
-    }
-    psFree(spline);
-
-    psStats *stats;
-    stats = psStatsAlloc(PS_STAT_MAX);
-    if ( !psMemCheckType(PS_DATA_STATS, stats) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckStats failed in memCheckType. \n");
-        psFree(stats);
-        return 1;
-    }
-    psFree(stats);
-
-    psTime *time;
-    time = psTimeAlloc(PS_TIME_UT1);
-    if ( !psMemCheckType(PS_DATA_TIME, time) )  {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckTime failed in memCheckType. \n");
-        psFree(time);
-        return 1;
-    }
-    psFree(time);
-
-    psVector *vector;
-    vector = psVectorAlloc(100, PS_TYPE_F32);
-    if ( !psMemCheckType(PS_DATA_VECTOR, vector) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckVector failed in memCheckType. \n");
-        psFree(vector);
-        return 1;
-    }
-    psFree(vector);
-
-
-    psFree(negative);
-    psFree(neg);
-
-    return 0;
-}
Index: trunk/psLib/test/sys/tst_psString.c
===================================================================
--- trunk/psLib/test/sys/tst_psString.c	(revision 41166)
+++ 	(revision )
@@ -1,740 +1,0 @@
-/** @file  tst_psString.c
- *
- * -*- mode: C; c-basic-indent: 4; tab-width: 8; indent-tabs-mode: nil -*-
- * vim: set cindent ts=8 sw=4 expandtab:
- *
- *  @brief Test driver for psString functions
- *
- *  This test driver contains the following test points for psStringCopy
- *  and psStringNCopy, and related string functions.
- *    1) Verify string copy - psStringCopy
- *    2) Verify empty string copy - psStringCopy
- *    3) Verify string copy with length - psStringNCopy
- *    4) Verify empty string copy with length - psStringNCopy
- *    5) Copy string to larger string - psStringNCopy
- *    6) Copy string with negative size - psStringNCopy
- *    7) Verifiy creation of string literal - PS_STRING
- *
- *  Return:   Number of test points which failed
- *
- *  @author  Eric Van Alst, MHPCC
- *
- *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-07-14 02:26:25 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-#define STR_0 "binky had a leeeetle lamb"
-
-static psS32 testStringCopy00(void);
-static psS32 testStringCopy01(void);
-static psS32 testStringCopy02(void);
-static psS32 testStringCopy03(void);
-static psS32 testStringCopy04(void);
-//static psS32 testStringCopy05(void);
-static psS32 testStringCopy06(void);
-
-static psS32 testStrAppend00(void);
-static psS32 testStrAppend01(void);
-static psS32 testStrAppend02(void);
-static psS32 testStrAppend03(void);
-
-static psS32 testStrPrepend00(void);
-static psS32 testStrPrepend01(void);
-static psS32 testStrPrepend02(void);
-static psS32 testStrPrepend03(void);
-
-static psS32 testStrSplit00(void);
-static psS32 testNULLStrings(void);
-static psS32 testStrCheck(void);
-
-testDescription tests[] = {
-                              {testStringCopy00, 0, "Verify string copy", 0, false},
-                              {testStringCopy01, 1, "Verify empty string copy", 0, false},
-                              {testStringCopy02, 2, "Verify string copy with length", 0, false},
-                              {testStringCopy03, 3, "Verify empty string copy with length", 0, false},
-                              {testStringCopy04, 4, "Copy string to larger string", 0, false},
-                              //                              {testStringCopy05, 5, "Copy string with negative size", 0, false},
-                              {testStringCopy06, 6, "Verify creation of string literal", 0, false},
-
-                              {testStrAppend00,  7, "Verify generic string append", 0, false},
-                              {testStrAppend01,  8, "Test append NULL handling", 0, false},
-                              {testStrAppend02,  9, "Verify append string creation", 0, false},
-                              {testStrAppend03, 10, "Test append null-op", 0, false},
-
-                              {testStrPrepend00,11, "Verify generic string prepend", 0, false},
-                              {testStrPrepend01,12, "Test prepend NULL handling", 0, false},
-                              {testStrPrepend02,13, "Verify prepend string creation", 0, false},
-                              {testStrPrepend03,14, "Test prepend null-op", 0, false},
-                              {testStrSplit00,15, "Test String Splitting", 0, false},
-                              {testNULLStrings,666, "Test NULL String Error Handling", 0, false},
-                              {testStrCheck,16, "Test String Allocation and MemCheck", 0, false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psString", tests, argc, argv ) );
-}
-
-/*
-psS32 main( psS32 argc,
-          char * argv[] )
-{
-    psBool  tpResult = false;
-    char  stringval[20] = "E R R O R";
-    char  stringval1[20] = "e r r o r";
-    char  *stringvalnocopy = "F A I L";
-    char  *substringval = "e r r";
-    psS32   substringlen = 6;
-    char  *emptyval = "";
-    psS32   tpFails = 0;
-    char  *strResult;
-    psS32   increaseSize = 5;
-    psS32   negativeSize = -5;
-    psS32   result = 0;
-    psS32   result1 = 0;
-    psS32   memBlockAllocated = 0;
-    psMemBlock ***memBlockPtr = NULL;
- 
-*/
-
-static psS32 testStringCopy00(void)
-{
-    char  stringval[20] = "E R R O R";
-    psS32   result = 0;
-    psS32   result1 = 0;
-    char  *strResult;
-
-    // Test point #1 Verify string copy - psStringCopy
-    strResult = psStringCopy(stringval);
-    // Perform string compare
-    result = strcmp(strResult, stringval);
-    // Modify original string
-    stringval[0]='G';
-    result1 = strcmp(strResult, stringval);
-    stringval[0]='E';
-    if ( ( result != 0 ) || ( result1 == 0) ) {
-        fprintf(stderr, "Failed test point #1 strcmp result = %d expected 0\n",result);
-        fprintf(stderr, "                               src = %s expected %s\n",
-                strResult, stringval);
-        fprintf(stderr, "             changed strcmp result = %d expected 1\n",result1);
-        fprintf(stderr, "             changed           src = %s expected %s\n",strResult,
-                stringval);
-        return 1;
-    }
-
-    // Free memory allocated
-    psFree(strResult);
-
-    return 0;
-}
-
-static psS32 testStringCopy01(void)
-{
-    char  *emptyval = "";
-    psS32   result = 0;
-    char  *strResult;
-
-    // Test point #2 Verify empty string copy - psStringCopy
-    strResult = psStringCopy(emptyval);
-    // Perform string compare
-    result = strcmp(strResult, emptyval);
-    if ( result != 0 ) {
-        fprintf(stderr,"Failed test point #2 strcmp result = %d expected 0\n",result);
-        fprintf(stderr,"                               src = %s expected %s\n",
-                strResult, emptyval);
-        return 1;
-    }
-
-    // Free memory allocated
-    psFree(strResult);
-
-    return 0;
-}
-
-static psS32 testStringCopy02(void)
-{
-    psS32   result = 0;
-    psS32   result1 = 0;
-    char  *strResult;
-    char  stringval1[20] = "e r r o r";
-    psS32   substringlen = 5;
-    char  *substringval = "e r r";
-
-    // Test point #3 Verify string copy with length - psStringNCopy
-    strResult = psStringNCopy(stringval1, substringlen);
-    // Perform string compare and get string length
-    result = strncmp(strResult, substringval, substringlen);
-    // Change original string
-    stringval1[0] = 'g';
-    result1 = strncmp(strResult, substringval, substringlen);
-    if ( ( result != 0 ) || ( result1 != 0 ) ) {
-        fprintf(stderr,"Failed test point #3 strcmp result = %d expected 0\n",result);
-        fprintf(stderr,"                               src = %s expected %s\n",
-                strResult, substringval);
-        fprintf(stderr,"             changed strcmp result = %d expected 0\n",result1);
-        fprintf(stderr,"                               src = %s expected %s\n",
-                strResult, substringval);
-        return 1;
-    }
-    // Free memory allocated
-    psFree(strResult);
-
-    return 0;
-}
-
-static psS32 testStringCopy03(void)
-{
-    psS32   result = 0;
-    psS32   result1 = 0;
-    char  *strResult;
-    char  *stringvalnocopy = "F A I L";
-
-    // Test point #4 Verify empty string copy with length - psStringNCopy
-    strResult = psStringNCopy(stringvalnocopy, 0);
-    // Perform string compare and get sting length
-    result = strcmp(strResult, stringvalnocopy);
-    result1 = strlen(strResult);
-    if ( result == 0 ) {
-        fprintf(stderr,"Failed test point #4 strcmp result = %d didn't expected %d\n",result,0);
-        fprintf(stderr,"                               src = %s didn't expected %s\n",
-                strResult, stringvalnocopy);
-        return 1;
-    }
-    // Free memory
-    psFree(strResult);
-
-    return 0;
-}
-
-static psS32 testStringCopy04(void)
-{
-    psS32   result = 0;
-    psS32   result1 = 0;
-    char  *strResult;
-    char  stringval[20] = "E R R O R";
-    psS32   increaseSize = 5;
-
-    // Test point #5 Copy string to larger string - psStringNCopy
-    strResult = psStringNCopy(stringval, (strlen(stringval) + increaseSize));
-    // Perform string compare and get string length
-    result = strcmp(strResult, stringval);
-    result1 = strlen(strResult);
-    // The strings should still compare
-    if ( ( result != 0 ) ||
-            ( result1 != strlen(stringval) ) ) {
-        fprintf(stderr,"Failed test point #5 strcmp result = %d expected %d\n",result,0);
-        fprintf(stderr,"                               src = %s expected %s\n",
-                strResult, stringval);
-        fprintf(stderr,"                     strlne result = %d expected %d\n",result1,
-                (psS32)strlen(stringval));
-        return 1;
-    }
-    // Free memory
-    psFree(strResult);
-
-    return 0;
-}
-
-// XXX This test needs to be modified to check for maximum size
-//     This will require a mod to psStringNCopy source to check for maximum size
-//
-//static psS32 testStringCopy05(void)
-//{
-//    char  *strResult;
-//    char  stringval[20] = "E R R O R";
-//    psS32   negativeSize = -5;
-//
-//    // Test point #6 Copy string with negative size - psStringNCopy
-//    strResult = psStringNCopy(stringval, negativeSize);
-//    if ( strResult != NULL ) {
-//        fprintf(stderr,"Failed test point #6 return value = %p expected NULL\n",
-//                strResult);
-//        return 1;
-//    }
-//    // Memory should not have been allocated
-//
-//    return 0;
-//}
-
-static psS32 testStringCopy06(void)
-{
-    char  *strResult;
-    char  stringval[20] = "E R R O R";
-    psS32   result = 0;
-
-    // Test point #7 Verify creation of string literal - PS_STRING
-    strResult = PS_STRING(E R R O R);
-    result = strcmp(strResult, stringval);
-    if ( result != 0 ) {
-        fprintf(stderr,"Failed test point #7 strcmp result = %d expected %d",result,0);
-        return 1;
-    }
-    // Memory should not have been allocated
-
-    return 0;
-}
-
-static psS32 testStrAppend00(void)
-{
-    char *str=NULL;
-    int result = 0;
-
-    str = psStringCopy("3.14159");
-
-    psStringAppend(&str, "%d%s", 2653589, "79323846");
-
-    // Test point: Verify string append
-    result = strcmp(str, "3.14159265358979323846");
-    if ( result != 0 ) {
-        fprintf(stderr,"%s","Failed test point\n");
-        return 1;
-    }
-
-    psFree(str);
-
-    return 0;
-}
-
-static psS32 testStrAppend01(void)
-{
-    ssize_t sz;
-    char *str=NULL;
-
-    // test nonsensical invocations ...
-    sz = psStringAppend(NULL, NULL);
-    if ( sz != 0 ) {
-        fprintf(stderr,"%s","Failed test point\n");
-        return 1;
-    }
-    sz = psStringAppend(&str, NULL);
-    if ( sz != 0 ) {
-        fprintf(stderr,"%s","Failed test point\n");
-        return 1;
-    }
-
-    return 0;
-}
-
-static psS32 testStrAppend02(void)
-{
-    char *str=NULL;
-    int result;
-
-    // test string creation
-    psStringAppend(&str, "%s", "fubar");
-    result = strcmp(str, "fubar");
-    if ( result != 0 ) {
-        fprintf(stderr,"%s","Failed test point\n");
-        return 1;
-    }
-
-    psFree(str);
-
-    return 0;
-}
-
-static psS32 testStrAppend03(void)
-{
-    char *str=NULL;
-    int result;
-
-    str = psStringCopy(STR_0);
-
-    // test null-op
-    psStringAppend(&str, "");
-    result = strcmp(str, STR_0);
-    if ( result != 0 ) {
-        fprintf(stderr,"Failed test point str=[%s]\n", str);
-        return 1;
-    }
-
-    psFree(str);
-
-    return 0;
-}
-
-static psS32 testStrPrepend00(void)
-{
-    char *str=NULL;
-    int result = 0;
-
-    str = psStringCopy("79323846");
-
-    psStringPrepend(&str, "%s%d","3.14159", 2653589 );
-
-    // Test point: Verify string append
-    result = strcmp(str, "3.14159265358979323846");
-    if ( result != 0 ) {
-        fprintf(stderr,"%s","Failed test point\n");
-        return 1;
-    }
-
-    psFree(str);
-
-    return 0;
-}
-
-static psS32 testStrPrepend01(void)
-{
-    ssize_t sz;
-    char *str=NULL;
-
-    // test nonsensical invocations ...
-    sz = psStringPrepend(NULL, NULL);
-    if ( sz != 0 ) {
-        fprintf(stderr,"%s","Failed test point\n");
-        return 1;
-    }
-    sz = psStringPrepend(&str, NULL);
-    if ( sz != 0 ) {
-        fprintf(stderr,"%s","Failed test point\n");
-        return 1;
-    }
-
-    return 0;
-}
-
-static psS32 testStrPrepend02(void)
-{
-    char *str=NULL;
-    int result;
-
-    // test string creation
-    psStringPrepend(&str, "%s", "fubar");
-    result = strcmp(str, "fubar");
-    if ( result != 0 ) {
-        fprintf(stderr,"%s","Failed test point\n");
-        return 1;
-    }
-
-    psFree(str);
-
-    return 0;
-}
-
-static psS32 testStrPrepend03(void)
-{
-    char *str=NULL;
-    int result;
-
-    str = psStringCopy(STR_0);
-
-    // test null-op
-    psStringPrepend(&str, "");
-    result = strcmp(str, STR_0);
-    if ( result != 0 ) {
-        fprintf(stderr,"Failed test point str=[%s]\n", str);
-        return 1;
-    }
-
-    psFree(str);
-
-    return 0;
-}
-
-static psS32 testStrSplit00(void)
-{
-    psList *strList = NULL;
-    char str[35];
-    char split[5];
-    strncpy(str, "This is, a, test case, to check.", 35);
-    strncpy(split, ",", 2);
-    psString psStr;
-    psString psSplit;
-    psStr = psStringCopy(str);
-    psSplit = psStringCopy(split);
-
-    //Return NULL for NULL inputs
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    strList = psStringSplit(NULL, NULL, true);
-    //    if (strList != NULL) {
-    if (strList) {
-        psFree(strList);
-        return 1;
-    }
-    psFree(strList);
-    strList = NULL;
-    //Return empty list for NULL string input
-    //psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    strList = psStringSplit(NULL, split, true);
-    //    if (strList != NULL) {
-    if ( psListLength(strList) ) {
-        psFree(strList);
-        return 2;
-    }
-    psFree(strList);
-    strList = NULL;
-    //Return NULL for NULL splitter input
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    strList = psStringSplit(str, NULL, true);
-    //    if (strList != NULL) {
-    if ( strList ) {
-        psFree(strList);
-        return 3;
-    }
-    psFree(strList);
-    strList = NULL;
-    //Return a psList* of psStrings
-    strList = psStringSplit(str, split, true);
-    if (strList->n != 4) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return the correct number of strings.\n");
-        return 4;
-    }
-    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 5;
-    }
-    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 6;
-    }
-    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 7;
-    }
-    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 8;
-    }
-    psFree(strList);
-    //Return correct psList when using (psString, char*)
-    strList = psStringSplit(psStr, split, true);
-    if (strList->n != 4) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return the correct number of strings.\n");
-        return 9;
-    }
-    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 10;
-    }
-    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 11;
-    }
-    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 12;
-    }
-    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 13;
-    }
-    psFree(strList);
-    //Return correct psList when using (char*, psString)
-    strList = psStringSplit(str, psSplit, true);
-    if (strList->n != 4) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return the correct number of strings.\n");
-        return 14;
-    }
-    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 15;
-    }
-    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 16;
-    }
-    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 17;
-    }
-    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 18;
-    }
-    psFree(strList);
-    //Return correct psList when using (psString, psString)
-    strList = psStringSplit(psStr, psSplit, true);
-    if (strList->n != 4) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return the correct number of strings.\n");
-        return 19;
-    }
-    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 20;
-    }
-    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 21;
-    }
-    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 22;
-    }
-    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 23;
-    }
-    psFree(strList);
-    //Return correct psList output for string of zero length case
-    strncpy(str, "This is,, a,, test case,, to check.", 35);
-    strList = psStringSplit(str, split, false);
-    if (strList->n != 4) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return the correct number of strings.\n");
-        return 24;
-    }
-    if ( strncmp((psString)(strList->head->data), "This is", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 25;
-    }
-    if ( strncmp((psString)(strList->head->next->data), " a", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 26;
-    }
-    if ( strncmp((psString)(strList->head->next->next->data), " test case", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 27;
-    }
-    if ( strncmp((psString)(strList->head->next->next->next->data), " to check.", 10) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psStringSplit failed to return expected strings.");
-        return 28;
-    }
-
-    psFree(strList);
-    psFree(psStr);
-    psFree(psSplit);
-    return 0;
-}
-
-static psS32 testNULLStrings(void)
-{
-    psString nullTest = NULL;
-    psString output = NULL;
-    ssize_t outSize = 0;
-    char** nullDest = NULL;
-    char** test;
-    //psStringCopy should return NULL for NULL input string
-    //    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    output = psStringCopy(nullTest);
-    if (output != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psStringCopy failed to return NULL for NULL input string.\n");
-        return 1;
-    }
-    //psStringNCopy should return NULL for NULL input string
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    output = psStringNCopy(nullTest, 100);
-    if (output != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psStringNCopy failed to return NULL for NULL input string.\n");
-        return 2;
-    }
-
-    //psStringAppend should return 0 for NULL input destination
-    outSize = psStringAppend(nullDest, "");
-    if (outSize != 0) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psStringAppend failed to return 0 for NULL input destination.\n");
-        return 3;
-    }
-    //psStringAppend should return 0 for NULL input format
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    outSize = psStringAppend(test, nullTest);
-    if (outSize != 0) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psStringAppend failed to return 0 for NULL input format.\n");
-        return 4;
-    }
-    //psStringPrepend should return 0 for NULL input destination
-    outSize = psStringPrepend(nullDest, " ");
-    if (outSize != 0) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psStringPrepend failed to return 0 for NULL input destination.\n");
-        return 3;
-    }
-    //psStringPrepend should return 0 for NULL input format
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    outSize = psStringPrepend(test, nullTest);
-    if (outSize != 0) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psStringPrepend failed to return 0 for NULL input format.\n");
-        return 4;
-    }
-    //psStringSplit should return empty list for NULL input string
-    psList *nullList = NULL;
-    // psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    nullList = psStringSplit(nullTest, ",", true);
-    //    if (nullList != NULL) {
-    if ( psListLength(nullList) ) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psStringSplit failed to return NULL for NULL input string.\n");
-        return 5;
-    }
-    psFree(nullList);
-    nullList = NULL;
-    //psStringSplit should return NULL for NULL input splitter
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    nullList = psStringSplit("Hello World", nullTest, true);
-    //    if (nullList != NULL) {
-    if ( nullList ) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psStringSplit failed to return NULL for NULL input splitter.\n");
-        return 6;
-    }
-    psFree(nullList);
-
-    return 0;
-}
-
-psS32 testStrCheck(void)
-{
-    psString str = NULL;
-    str = psStringAlloc(10);
-    strcpy(str, "Hello");
-    if (!psMemCheckString(str)) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psString wasn't properly allocated!\n");
-        return 1;
-    }
-    if (!psMemCheckType(PS_DATA_STRING, str)) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psString wasn't properly allocated!\n");
-        return 2;
-    }
-    psFree(str);
-
-    char charStr[10];
-    if (psMemCheckType(PS_DATA_STRING, charStr)) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "Input string is not a psDataType!!!  (Should have returned false)\n");
-        return 3;
-    }
-
-    return 0;
-}
-
Index: trunk/psLib/test/sys/tst_psTrace.c
===================================================================
--- trunk/psLib/test/sys/tst_psTrace.c	(revision 41166)
+++ 	(revision )
@@ -1,381 +1,0 @@
-/*****************************************************************************
-    This code will test whether trace levels can be set successfully.
- 
-    XXX: For the last two testpoints, must verify that the results are
-    correct, and put that verification in the test as well.
- *****************************************************************************/
-#include <stdio.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-#include <fcntl.h>
-#include <unistd.h>
-
-
-static psS32 testTrace00(void);
-static psS32 testTrace01(void);
-static psS32 testTrace02(void);
-static psS32 testTrace03(void);
-static psS32 testTrace04(void);
-static psS32 testTrace05(void);
-static psS32 testTrace05a(void);
-static psS32 testTrace06(void);
-static psS32 testTrace08(void);
-
-testDescription tests[] = {
-                              {testTrace00, 0, "psTraceSetLevel() and psTraceGetLevel()", 0, false},
-                              {testTrace01, 1, "psTraceSetLevel(): set multiple components in one call", 0, false},
-                              {testTrace02, 2, "psTraceSetLevel(): test static/dynamic inheritance", 0, false},
-                              {testTrace03, 3, "psTraceReset()", 0, false},
-                              {testTrace04, 4, "psTrace()", 0, false},
-                              {testTrace05, 5, "psTracePrintLevels()", 0, false},
-                              {testTrace05a, 5, "optional leading dot and psTracePrintLevels()", 0, false},
-                              {testTrace06, 6, "Testing psTraceReset", 0, false},
-                              {testTrace08, 8, "Testing ", 0, false},
-                              {NULL}
-                          };
-
-testDescription tests2[] = {
-                               {testTrace08, 8, "Testing ", 0, false},
-                           };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psTrace", tests, argc, argv ) );
-}
-
-static psS32 testTrace00(void)
-{
-    psS32 i;
-    psS32 lev = 0;
-
-    //    psTraceSetDestination(stderr);
-    psTraceSetDestination(2);
-
-    for (i=0;i<10;i++) {
-        (void)psTraceSetLevel(".", i);
-        lev = psTraceGetLevel(".");
-        if (lev != i) {
-            fprintf(stderr,"ERROR: (.) expected trace level was %d, actual was %d\n",
-                    i, lev);
-            return 1;
-        }
-    }
-    (void)psTraceSetLevel(".", 3);
-
-    for (i=5;i<10;i++) {
-        (void)psTraceSetLevel(".NODE00", i);
-        lev = psTraceGetLevel(".NODE00");
-        if (lev != i) {
-            fprintf(stderr,
-                    "ERROR: (.NODE00) expected trace level was %d, actual was %d\n",
-                    i, lev);
-            return 2;
-        }
-
-        lev = psTraceGetLevel(".");
-        if (lev != 3) {
-            fprintf(stderr,"ERROR: (.) expected trace level was %d, actual was %d\n",
-                    i, 3);
-            return 3;
-        }
-    }
-
-
-    (void)psTraceSetLevel(".NODE00.NODE01", 4);
-    for (i=0;i<10;i++) {
-        (void)psTraceSetLevel(".NODE00.NODE01", i);
-        lev = psTraceGetLevel(".NODE00.NODE01");
-        if (lev != i) {
-            fprintf(stderr,
-                    "ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n",
-                    i, lev);
-            return 4;
-        }
-    }
-
-    return 0;
-}
-
-static psS32 testTrace01(void)
-{
-    //    psTraceSetDestination(stderr);
-    psTraceSetDestination(2);
-    (void)psTraceSetLevel(".A.B.C.D.E", 5);
-
-    psTrace(".A.C.D.C",1,"You should not see this.\n");
-    psTrace(".A.B.C.D.E",2,"You should see this.\n");
-    psTrace(".A.B.C.D.E.F",3,"You should see this too.\n");
-
-    psTracePrintLevels();
-
-    return 0;
-}
-
-static psS32 testTrace02(void)
-{
-    psTraceReset();
-    //    psTraceSetDestination(stderr);
-    psTraceSetDestination(2);
-    psTraceSetLevel(".A.B", 2);
-    psTraceSetLevel(".A.B.C.D.E", 5);
-    psTracePrintLevels();
-    psTraceSetLevel(".A.B", 10);
-    psTracePrintLevels();
-
-    if (10 != psTraceGetLevel(".A.B.C")) {
-        fprintf(stderr,"ERROR: .A.B.C did not dynamically inherit a trace level (%d)\n",
-                psTraceGetLevel(".A.B.C"));
-        return 2;
-    }
-
-    if (10 != psTraceGetLevel(".A.B.C.D")) {
-        fprintf(stderr,"ERROR: .A.B.C.D did not dynamically inherit a trace level (%d)\n", psTraceGetLevel(".A.B.C.D"));
-        return 2;
-    }
-
-    if (5 != psTraceGetLevel(".A.B.C.D.E")) {
-        fprintf(stderr,"ERROR: .A.B.C.D.E did dynamically inherit a trace level (%d)\n", psTraceGetLevel(".A.B.C.D.E"));
-        return 2;
-    }
-
-    return 0;
-}
-
-static psS32 testTrace03(void)
-{
-    psS32 i = 0;
-    psS32 lev = 0;
-
-    //    psTraceSetDestination(stderr);
-    psTraceSetDestination(2);
-
-    for (i=0;i<10;i++) {
-        (void)psTraceSetLevel(".", i);
-        psTraceReset();
-
-        lev = psTraceGetLevel(".");
-        if (lev != PS_UNKNOWN_TRACE_LEVEL) {
-            fprintf(stderr,"ERROR: expected trace level was %d, actual was %d\n",
-                    PS_UNKNOWN_TRACE_LEVEL, lev);
-            return 1;
-        }
-    }
-    (void)psTraceSetLevel(".", 5);
-    (void)psTraceSetLevel(".a", 4);
-    (void)psTraceSetLevel(".a.b", 3);
-    (void)psTraceSetLevel(".a.b.c", 2);
-    if ((5 != psTraceGetLevel(".")) ||
-            (4 != psTraceGetLevel(".a")) ||
-            (3 != psTraceGetLevel(".a.b")) ||
-            (2 != psTraceGetLevel(".a.b.c"))) {
-        fprintf(stderr,"ERROR: trace successFlag = false;levels were not settable?\n");
-        return 2;
-    }
-
-    psTraceReset();
-    if ((PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".")) ||
-            (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a")) ||
-            (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a.b")) ||
-            (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a.b.c"))) {
-        fprintf(stderr,"ERROR: trace levels were not reset properly\n");
-        return 3;
-    }
-
-    return 0;
-}
-
-
-static psS32 testTrace04(void)
-{
-    int FD;
-    psS32 nb = 0;
-    FD = creat("tst_psTrace02_OUT", 0666);
-    //    printf("\nFD = %d\n", FD);
-    //    fp = fopen("tst_psTrace02_OUT", "w");
-    for (nb = 0 ; nb<4;nb++) {
-        if (nb == 0)
-            //            psTraceSetDestination(stdout);
-            psTraceSetDestination(1);
-        if (nb == 1)
-            //            psTraceSetDestination(stderr);
-            psTraceSetDestination(2);
-        if (nb == 2)
-            psTraceSetDestination(0); //NULL
-        if (nb == 3)
-            psTraceSetDestination(FD);
-
-        (void)psTraceSetLevel(".", 4);
-        psTrace(".", 5, "(0) This message should not be displayed (%x)\n",
-                0xbeefface);
-        (void)psTraceSetLevel(".", 7);
-        psTrace(".", 5, "(0) This message should be displayed (%x)\n",
-                0xbeefface);
-
-        (void)psTraceSetLevel(".a", 4);
-        psTrace(".a", 5, "(1) This message should not be displayed (%x)\n",
-                0xbeefface);
-        (void)psTraceSetLevel(".a", 7);
-        psTrace(".a", 5, "(1) This message should be displayed (%x)\n",
-                0xbeefface);
-
-
-        (void)psTraceSetLevel(".a.b", 4);
-        psTrace(".a.b", 5, "(2) This message should not be displayed (%x)\n",
-                0xbeefface);
-        (void)psTraceSetLevel(".a.b", 7);
-        psTrace(".a.b", 5, "(2) This message should be displayed (%x)\n",
-                0xbeefface);
-        (void)psTraceSetLevel(".a.b.c", 12);
-        psTrace(".a.b.c", 11, "(3) This message should be displayed (%x)\n",
-                0xbeefface);
-
-    }
-
-    close(FD);
-
-    return(0);
-}
-
-static psS32 testTrace05(void)
-{
-    //    psTraceSetDestination(stderr);
-    psTraceSetDestination(2);
-
-    (void)psTraceSetLevel(".", 9);
-
-    (void)psTraceSetLevel(".a", 8);
-    (void)psTraceSetLevel(".b", 7);
-    (void)psTraceSetLevel(".c", 5);
-
-    (void)psTraceSetLevel(".a.a", 4);
-    (void)psTraceSetLevel(".a.b", 3);
-
-    (void)psTraceSetLevel(".b.a", 2);
-    (void)psTraceSetLevel(".b.b", 1);
-
-    (void)psTraceSetLevel(".c.a", 0);
-    (void)psTraceSetLevel(".c.b", 3);
-    (void)psTraceSetLevel(".c.c", 5);
-
-    psTracePrintLevels();
-
-    return 0;
-
-}
-
-static psS32 testTrace05a(void)
-{
-    (void)psTraceSetLevel(".", 9);
-
-    (void)psTraceSetLevel("a", 8);
-    (void)psTraceSetLevel("b", 7);
-    (void)psTraceSetLevel("c", 5);
-
-    (void)psTraceSetLevel("a.a", 4);
-    (void)psTraceSetLevel("a.b", 3);
-
-    (void)psTraceSetLevel("b.a", 2);
-    (void)psTraceSetLevel("b.b", 1);
-
-    (void)psTraceSetLevel("c.a", 0);
-    (void)psTraceSetLevel("c.b", 3);
-    (void)psTraceSetLevel("c.c", 5);
-
-    psTracePrintLevels();
-
-    return 0;
-
-}
-
-static psS32 testTrace06(void)
-{
-    //    psTraceSetDestination(stderr);
-    psTraceSetDestination(2);
-
-    (void)psTraceSetLevel(".", 9);
-
-    (void)psTraceSetLevel(".a", 8);
-    (void)psTraceSetLevel(".b", 7);
-    (void)psTraceSetLevel(".c", 5);
-
-    (void)psTraceSetLevel(".a.a", 4);
-    (void)psTraceSetLevel(".a.b", 3);
-
-    (void)psTraceSetLevel(".b.a", 2);
-    (void)psTraceSetLevel(".b.b", 1);
-
-    (void)psTraceSetLevel(".c.a", 0);
-    (void)psTraceSetLevel(".c.b", 3);
-    (void)psTraceSetLevel(".c.c", 5);
-
-    psTraceReset();
-
-    if ((psTraceGetLevel(".")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".a")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".b")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".c")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".a.a")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".a.b")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".b.a")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".b.b")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".c.a")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".c.b")!=PS_UNKNOWN_TRACE_LEVEL) ||
-            (psTraceGetLevel(".c.c")!=PS_UNKNOWN_TRACE_LEVEL)) {
-        return 1;
-    }
-
-    return 0;
-}
-
-// Ensure that the leading dot in the component names are optional.
-static psS32 testTrace08(void)
-{
-    psTraceReset();
-    (void)psTraceSetLevel(".", 9);
-
-    (void)psTraceSetLevel(".a", 8);
-    (void)psTraceSetLevel(".b", 7);
-    (void)psTraceSetLevel(".c", 5);
-
-    (void)psTraceSetLevel(".a.a", 4);
-    (void)psTraceSetLevel(".a.b", 3);
-
-    (void)psTraceSetLevel(".b.a", 2);
-    (void)psTraceSetLevel(".b.b", 1);
-
-    (void)psTraceSetLevel(".c.a", 0);
-    (void)psTraceSetLevel(".c.b", 3);
-    (void)psTraceSetLevel(".c.c", 5);
-
-    psTracePrintLevels();
-
-    if ((psTraceGetLevel(".")!=9) ||
-            (psTraceGetLevel("a")!=8) ||
-            (psTraceGetLevel("b")!=7) ||
-            (psTraceGetLevel("c")!=5) ||
-            (psTraceGetLevel("a.a")!=4) ||
-            (psTraceGetLevel("a.b")!=3) ||
-            (psTraceGetLevel("b.a")!=2) ||
-            (psTraceGetLevel("b.b")!=1) ||
-            (psTraceGetLevel("c.a")!=0) ||
-            (psTraceGetLevel("c.b")!=3) ||
-            (psTraceGetLevel("c.c")!=5)) {
-        printf("psTraceGetLevel(.) is %d\n", psTraceGetLevel("."));
-        printf("psTraceGetLevel(a) is %d\n", psTraceGetLevel("a"));
-        printf("psTraceGetLevel(b) is %d\n", psTraceGetLevel("b"));
-        printf("psTraceGetLevel(c) is %d\n", psTraceGetLevel("c"));
-        printf("psTraceGetLevel(a.a) is %d\n", psTraceGetLevel("a.a"));
-        printf("psTraceGetLevel(a.b) is %d\n", psTraceGetLevel("a.b"));
-        printf("psTraceGetLevel(b.a) is %d\n", psTraceGetLevel("b.a"));
-        printf("psTraceGetLevel(b.b) is %d\n", psTraceGetLevel("b.b"));
-        printf("psTraceGetLevel(c.a) is %d\n", psTraceGetLevel("c.a"));
-        printf("psTraceGetLevel(c.b) is %d\n", psTraceGetLevel("c.b"));
-        printf("psTraceGetLevel(c.c) is %d\n", psTraceGetLevel("c.c"));
-
-        return 1;
-    }
-
-    return 0;
-}
Index: trunk/psLib/test/types/tap_psArguments_all.c
===================================================================
--- trunk/psLib/test/types/tap_psArguments_all.c	(revision 41166)
+++ trunk/psLib/test/types/tap_psArguments_all.c	(revision 41171)
@@ -37,46 +37,12 @@
         int argc = 5;
 
-        // Try to get an argument's position
-        int i = psArgumentGet(argc, argv, "-float");
-        {
-            ok( i == 3,
-                "psArgumentGet:         return correct location of input argument.");
-        }
-
-        // Return 0 for attempting to get from a NULL input argument.
-        {
-            ok( psArgumentGet(argc, NULL, "-float") == 0,
-                "psArgumentGet:         return 0 for a NULL input argument.");
-        }
-
-        // Return 0 for attempting to find a NULL string
-        {
-            ok( psArgumentGet(argc, argv, NULL) == 0,
-                "psArgumentGet:         return 0 for a NULL input string.");
-        }
-
-        // Return 0 for attempting to find an empty string
-        {
-            ok( psArgumentGet(argc, argv, "") == 0,
-                "psArgumentGet:         return 0 for an empty input string.");
-        }
-
-        // Return 0 for attempting to get an argument that doesn't match
-        {
-            ok( psArgumentGet(argc, argv, "-xxx") == 0,
-                "psArgumentGet:         return 0 for an empty input string.");
-        }
-
-        // Return false for attempting to remove argnum = 0
-        {
-            ok( !psArgumentRemove(0, &argc, argv),
-                "psArgumentRemove:      return false for argnum = 0.");
-        }
-
-        // Return false for attempting to remove NULL argc
-        {
-            ok( !psArgumentRemove(0, NULL, argv),
-                "psArgumentRemove:      return false for NULL argc.");
-        }
+	// define a simple fake argument list : this is not modified
+	char *argvBad[5];
+	argvBad[0] = "./program";
+	argvBad[1] = "-string";
+	argvBad[2] = "new";
+	argvBad[3] = "-test";
+	argvBad[4] = "6.66";
+	int argcBad = 5;
 
         // simple argument definitions for comparison
@@ -86,50 +52,25 @@
         psMetadataAdd(args, PS_LIST_TAIL, "-double", PS_DATA_F64, "Test Double", 0.666);
 
+	ok( psArgumentGet(argc, argv, "-float") == 3, "psArgumentGet: return correct location of input argument.");
+	ok( psArgumentGet(argc, NULL, "-float") == 0, "psArgumentGet: return 0 for a NULL input argument.");
+
+	ok( psArgumentGet(argc, argv, NULL) == 0, "psArgumentGet: return 0 for a NULL input string.");
+	ok( psArgumentGet(argc, argv, "")   == 0, "psArgumentGet: return 0 for an empty input string.");
+
+	ok( psArgumentGet(argc, argv, "-xxx") == 0, "psArgumentGet: return 0 for an unmatched input string.");
+
+	ok( !psArgumentRemove(0, &argc, argv), "psArgumentRemove: return false for argnum = 0.");
+	ok( !psArgumentRemove(0, NULL, argv), "psArgumentRemove: return false for NULL argc.");
+
         // psArgumentParse tests
-        // Return false for NULL input arguments
-        {
-            ok( !psArgumentParse(NULL, &argc, argv),
-                "psArgumentParse:       return false for NULL argument metadata input.");
-        }
-
-        // Return false for NULL input argc
-        {
-            ok( !psArgumentParse(args, NULL, argv),
-                "psArgumentParse:       return false for NULL argc input.");
-        }
-
-        // Return false for NULL input argv
-        {
-            ok( !psArgumentParse(args, &argc, NULL),
-                "psArgumentParse:       return false for NULL argv input.");
-        }
-
-        // Return false for argc = 0
-        {
-            int tempc = 0;
-            ok( !psArgumentParse(args, &tempc, argv),
-                "psArgumentParse:       return false for argc = 1 input.");
-        }
-
-        // Return false for string not found in metadata arguments
-        {
-	    // define a simple fake argument list : this is not modified
-	    char *argvBad[5];
-	    argvBad[0] = "./program";
-	    argvBad[1] = "-string";
-	    argvBad[2] = "new";
-	    argvBad[3] = "-test";
-	    argvBad[4] = "6.66";
-	    int argcBad = 5;
-
-            ok( !psArgumentParse(args, &argcBad, argvBad),
-                "psArgumentParse:      return false for argv containing unspecified input.");
-        }
-
-        // Check for Memory leaks
-        {
-            psFree(args);
-            checkMem();
-        }
+	ok( !psArgumentParse(NULL, &argc, argv), "psArgumentParse: return false for NULL argument metadata input.");
+	ok( !psArgumentParse(args, NULL, argv),  "psArgumentParse: return false for NULL argc input.");
+	ok( !psArgumentParse(args, &argc, NULL), "psArgumentParse: return false for NULL argv input.");
+
+	int tempc = 0;
+	ok( !psArgumentParse(args, &tempc, argv), "psArgumentParse: return false for argc = 0 input.");
+	ok( !psArgumentParse(args, &argcBad, argvBad), "psArgumentParse: return false for argv containing unspecified input.");
+
+	psFree(args);
         ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
@@ -195,4 +136,6 @@
 	ok( psArgumentParse(args, &argc, argv), "psArgumentParse:      return true for valid inputs.");
 
+	// XXX does not check the results...
+
         // Check for Memory leaks
 	psFree(args);
@@ -221,7 +164,7 @@
 	    argv[0] = "./program";
 	    argv[1] = "-string";
-	    ok( !psArgumentParse(tempArg, &argc, argv),
-		"psArgumentParse:      return false for inconsistent argc.");
+	    ok( !psArgumentParse(tempArg, &argc, argv), "psArgumentParse: return false for inconsistent argc.");
 	    psFree(tempArg);
+	    ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
 	}
 
@@ -240,6 +183,5 @@
 	    argv[0] = "./program";
 	    argv[1] = "-string";
-	    ok( !psArgumentParse(args, &argc, argv),
-		"psArgumentParse:      return false for incomplete string syntax.");
+	    ok( !psArgumentParse(args, &argc, argv), "psArgumentParse: return false for incomplete string syntax.");
 	}
 
@@ -251,13 +193,9 @@
 	    argv[1] = "-multi";
 	    argv[2] = "2";
-	    ok( psArgumentParse(args, &argc, argv),
-		"psArgumentParse:      return true for MULTI.");
+	    ok( psArgumentParse(args, &argc, argv), "psArgumentParse: return true for MULTI.");
 	}
 
 	// Check for Memory leaks
-	{
-	    psFree(args);
-	    checkMem();
-	}
+	psFree(args);
 	ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
@@ -269,6 +207,5 @@
 	{
 	    int argc = 1;
-	    ok( psArgumentVerbosity(&argc, NULL) == 2,
-		"psArgumentVerbosity:  return 2 for NULL argument input.");
+	    ok( psArgumentVerbosity(&argc, NULL) == 2, "psArgumentVerbosity: return 2 for NULL argument input.");
 	}
 
@@ -277,6 +214,5 @@
 	    char *argv[1];
 	    argv[0] = "./program";
-	    ok( psArgumentVerbosity(NULL, argv) == 2,
-		"psArgumentVerbosity:  return 2 for NULL argument input.");
+	    ok( psArgumentVerbosity(NULL, argv) == 2, "psArgumentVerbosity: return 2 for NULL argument input.");
 	}
 
@@ -287,6 +223,5 @@
 	    argv[0] = "./program";
 	    argv[1] = "-v";
-	    ok( psArgumentVerbosity(&argc, argv) == 3,
-		"psArgumentVerbosity:  return 3 for '-v' argument input.");
+	    ok( psArgumentVerbosity(&argc, argv) == 3, "psArgumentVerbosity:  return 3 for '-v' argument input.");
 	}
 
@@ -297,6 +232,5 @@
 	    argv[0] = "./program";
 	    argv[1] = "-vv";
-	    ok( psArgumentVerbosity(&argc, argv) == 4,
-		"psArgumentVerbosity:  return 4 for '-vv' argument input.");
+	    ok( psArgumentVerbosity(&argc, argv) == 4, "psArgumentVerbosity:  return 4 for '-vv' argument input.");
 	}
 
@@ -307,6 +241,5 @@
 	    argv[0] = "./program";
 	    argv[1] = "-vvv";
-	    ok( psArgumentVerbosity(&argc, argv) == 5,
-		"psArgumentVerbosity:  return 5 for '-vvv' argument input.");
+	    ok( psArgumentVerbosity(&argc, argv) == 5, "psArgumentVerbosity:  return 5 for '-vvv' argument input.");
 	}
 
@@ -359,9 +292,9 @@
 	{
 	    // this function sends output to the screen or /dev/null (i
-	    # if (!DEBUG)
+# if (!DEBUG)
 	    FILE *f = fopen ("/dev/null", "w");
 	    int fd = fileno(f);
 	    psTraceSetDestination (fd);
-	    # endif
+# endif
 
 	    int argc = 2;
@@ -374,121 +307,115 @@
 	ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
     }
+
+    /** EAM 2019.11.09 this section is commented out because these functions do not exist
+    void testLogTraceArguments(void)
+    {
+	note("  >>>Test 3:  psLogArguments & psTraceArguments Fxns");
+ 
+	// Return 2 (default) for NULL arguments input
+	{
+	    int argc = 4;
+	    ok( psLogArguments(&argc, NULL) == 2, "psLogArguments: return 2 for NULL argument input.");
+	}
+
+	// Return 2 (default) for NULL argc input
+	{
+	    char *argv[1];
+	    argv[0] = "./program";
+	    ok( psLogArguments(NULL, argv) == 2, "psLogArguments: return 2 for NULL argc input.");
+	}
+
+	// Return 3 for "-v" option
+	{
+	    int argc = 2;
+	    char *argv[2];
+	    argv[0] = "./program";
+	    argv[1] = "-v";
+	    ok( psLogArguments(&argc, argv) == 3, "psLogArguments: return 3 for '-v' argument input.");
+	}
+
+	// Return 4 for "-vv" option
+	{
+	    int argc = 2;
+	    char *argv[2];
+	    argv[0] = "./program";
+	    argv[1] = "-vv";
+	    ok( psLogArguments(&argc, argv) == 4, "psLogArguments: return 4 for '-vv' argument input.");
+	}
+
+	// Return 5 for "-vvv" option
+	{
+	    int argc = 2;
+	    char *argv[2];
+	    argv[0] = "./program";
+	    argv[1] = "-vvv";
+	    ok( psLogArguments(&argc, argv) == 5, "psLogArguments: return 5 for '-vvv' argument input.");
+	}
+
+	// Return 2 for "-logfmt" option
+	{
+	    int argc = 2;
+	    char *argv[2];
+	    argv[0] = "./program";
+	    argv[1] = "-logfmt";
+	    ok( psLogArguments(&argc, argv) == 2, "psLogArguments: return 2 for '-logfmt' argument input.");
+	}
+
+	// Return 2 for "-logfmt" option with "H"
+	{
+	    int argc = 3;
+	    char *argv[3];
+	    argv[0] = "./program";
+	    argv[1] = "-logfmt";
+	    argv[2] = "H";
+	    ok( psLogArguments(&argc, argv) == 2, "psLogArguments: return 2 for '-logfmt H' argument inputs.");
+	}
+ 
+	// psTraceArguments Tests
+	// Return 0 (default) for NULL arguments input
+	{
+	    int argc = 4;
+	    ok( psTraceArguments(&argc, NULL) == 0, "psTraceArguments: return 0 for NULL argument input.");
+	}
+
+	// Return 0 (default) for NULL argc input
+	{
+	    char *argv[1];
+	    argv[0] = "./program";
+	    ok( psTraceArguments(NULL, argv) == 0, "psTraceArguments: return 0 for NULL argc input.");
+	}
+
+	// Return 0 for "-trace" option
+	{
+	    int argc = 2;
+	    char *argv[2];
+	    argv[0] = "./program";
+	    argv[1] = "-trace";
+	    ok( psTraceArguments(&argc, argv) == 0, "psTraceArguments: return 2 for '-trace' argument input.");
+	}
+
+	// Return 2 for "-trace 1 2" option
+	{
+	    int argc = 4;
+	    char *argv[4];
+	    argv[0] = "./program";
+	    argv[1] = "-trace";
+	    argv[2] = "1";
+	    argv[3] = "2";
+	    ok( psTraceArguments(&argc, argv) == 1, "psTraceArguments: return 2 for '-trace 1 2' argument inputs.");
+	}
+
+	// Return 2 for "-trace-levels" option
+	{
+	    int argc = 2;
+	    char *argv[2];
+	    argv[0] = "./program";
+	    argv[1] = "-trace-levels";
+	    ok( psTraceArguments(&argc, argv) == 0, "psTraceArguments: return 2 for '-trace-levels' argument input.");
+	}
+ 
+	// Check for Memory leaks
+	ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
+    }
+    **/
 }
-
-
-/* XXX: Why is this commented out?
-   void testLogTraceArguments(void)
-   {
-   note("  >>>Test 3:  psLogArguments & psTraceArguments Fxns");
- 
-   // Return 2 (default) for NULL arguments input
-   {
-   int argc = 4;
-   ok( psLogArguments(&argc, NULL) == 2,
-   "psLogArguments:       return 2 for NULL argument input.");
-   }
-   // Return 2 (default) for NULL argc input
-   {
-   char *argv[1];
-   argv[0] = "./program";
-   ok( psLogArguments(NULL, argv) == 2,
-   "psLogArguments:       return 2 for NULL argc input.");
-   }
-   // Return 3 for "-v" option
-   {
-   int argc = 2;
-   char *argv[2];
-   argv[0] = "./program";
-   argv[1] = "-v";
-   ok( psLogArguments(&argc, argv) == 3,
-   "psLogArguments:       return 3 for '-v' argument input.");
-   }
-   // Return 4 for "-vv" option
-   {
-   int argc = 2;
-   char *argv[2];
-   argv[0] = "./program";
-   argv[1] = "-vv";
-   ok( psLogArguments(&argc, argv) == 4,
-   "psLogArguments:       return 4 for '-vv' argument input.");
-   }
-   // Return 5 for "-vvv" option
-   {
-   int argc = 2;
-   char *argv[2];
-   argv[0] = "./program";
-   argv[1] = "-vvv";
-   ok( psLogArguments(&argc, argv) == 5,
-   "psLogArguments:       return 5 for '-vvv' argument input.");
-   }
-   // Return 2 for "-logfmt" option
-   {
-   int argc = 2;
-   char *argv[2];
-   argv[0] = "./program";
-   argv[1] = "-logfmt";
-   ok( psLogArguments(&argc, argv) == 2,
-   "psLogArguments:       return 2 for '-logfmt' argument input.");
-   }
-   // Return 2 for "-logfmt" option with "H"
-   {
-   int argc = 3;
-   char *argv[3];
-   argv[0] = "./program";
-   argv[1] = "-logfmt";
-   argv[2] = "H";
-   ok( psLogArguments(&argc, argv) == 2,
-   "psLogArguments:       return 2 for '-logfmt H' argument inputs.");
-   }
- 
- 
-   // psTraceArguments Tests
-   // Return 0 (default) for NULL arguments input
-   {
-   int argc = 4;
-   ok( psTraceArguments(&argc, NULL) == 0,
-   "psTraceArguments:     return 0 for NULL argument input.");
-   }
-   // Return 0 (default) for NULL argc input
-   {
-   char *argv[1];
-   argv[0] = "./program";
-   ok( psTraceArguments(NULL, argv) == 0,
-   "psTraceArguments:     return 0 for NULL argc input.");
-   }
-   // Return 0 for "-trace" option
-   {
-   int argc = 2;
-   char *argv[2];
-   argv[0] = "./program";
-   argv[1] = "-trace";
-   ok( psTraceArguments(&argc, argv) == 0,
-   "psTraceArguments:     return 2 for '-trace' argument input.");
-   }
-   // Return 2 for "-trace 1 2" option
-   {
-   int argc = 4;
-   char *argv[4];
-   argv[0] = "./program";
-   argv[1] = "-trace";
-   argv[2] = "1";
-   argv[3] = "2";
-   ok( psTraceArguments(&argc, argv) == 1,
-   "psTraceArguments:     return 2 for '-trace 1 2' argument inputs.");
-   }
-   // Return 2 for "-trace-levels" option
-   {
-   int argc = 2;
-   char *argv[2];
-   argv[0] = "./program";
-   argv[1] = "-trace-levels";
-   ok( psTraceArguments(&argc, argv) == 0,
-   "psTraceArguments:     return 2 for '-trace-levels' argument input.");
-   }
- 
-   // Check for Memory leaks
-   {
-   checkMem();
-   }
-   }
-*/
Index: trunk/psLib/test/types/tap_psList_all.c
===================================================================
--- trunk/psLib/test/types/tap_psList_all.c	(revision 41166)
+++ trunk/psLib/test/types/tap_psList_all.c	(revision 41171)
@@ -150,11 +150,11 @@
                 "psListAddAfter:         return true for adding a list element to the head.");
         }
+        psFree(noList);
+
         //Return true for adding to an empty list
-        psFree(noList);
         noList = psListAlloc(NULL);
         psListIterator *iter3 = psListIteratorAlloc(noList, 0, true);
         {
-            ok( psListAddAfter(iter3, md),
-                "psListAddAfter:         return true for adding to an empty list.");
+            ok( psListAddAfter(iter3, md), "psListAddAfter: return true for adding to an empty list.");
         }
 
Index: trunk/psLib/test/types/tap_psMetadataConfigParse.c
===================================================================
--- trunk/psLib/test/types/tap_psMetadataConfigParse.c	(revision 41166)
+++ trunk/psLib/test/types/tap_psMetadataConfigParse.c	(revision 41171)
@@ -58,5 +58,5 @@
         skip_start(item == NULL, 2,
                      "Skipping 1 tests because metadata container is empty!");
-        ok(item->type == PS_TYPE_S32, "return correcot metdataItem type");
+        ok(item->type == PS_DATA_S32, "return correct metdataItem type");
         is_int(item->data.S32, 666, "return correct metadataItem data");
         is_str(item->name, "new", "return correct metadataItem name");
@@ -105,5 +105,5 @@
         skip_start(item == NULL, 2,
                 "Skipping 1 tests because metadata container is empty!");
-        ok(item->type == PS_TYPE_S8, "metdataItem type");
+        ok(item->type == PS_DATA_S8, "metdataItem type");
         is_int(item->data.S8, 3, "metdataItem value");
         is_str(item->name, "item8", "return correct metadataItem name");
Index: trunk/psLib/test/types/tap_psMetadata_copying.c
===================================================================
--- trunk/psLib/test/types/tap_psMetadata_copying.c	(revision 41166)
+++ trunk/psLib/test/types/tap_psMetadata_copying.c	(revision 41171)
@@ -421,15 +421,15 @@
         //Return false for NULL in input
         {
-            ok( !psMetadataItemSupplement(out, NULL, key),
+	  ok( !psMetadataItemSupplement(NULL, out, NULL, key),
                 "psMetadataItemSupplement:  return false for NULL in metadata.");
         }
         //Return false for NULL out input
         {
-            ok( !psMetadataItemSupplement(NULL, in, key),
+            ok( !psMetadataItemSupplement(NULL, NULL, in, key),
                 "psMetadataItemSupplement:  return false for NULL out metadata.");
         }
         //Return false for NULL key input
         {
-            ok( !psMetadataItemSupplement(out, in, NULL),
+            ok( !psMetadataItemSupplement(NULL, out, in, NULL),
                 "psMetadataItemSupplement:  return false for NULL key string.");
         }
@@ -439,5 +439,5 @@
         //Return true for valid inputs
         {
-            bool transfered = psMetadataItemSupplement(out, in, key);
+            bool transfered = psMetadataItemSupplement(NULL, out, in, key);
             psMetadataItem *item = NULL;
             if (transfered)
@@ -460,5 +460,5 @@
         {
             strncpy(key, "not MY key", 15);
-            ok( !psMetadataItemSupplement(out, in, key),
+            ok( !psMetadataItemSupplement(NULL, out, in, key),
                 "psMetadataItemSupplement:  return false for invalid key.");
         }
@@ -468,5 +468,5 @@
         invalid->hash = NULL;
         {
-            ok( !psMetadataItemSupplement(invalid, in, "key"),
+            ok( !psMetadataItemSupplement(NULL, invalid, in, "key"),
                 "psMetadataItemSupplement:  return false for invalid metadata.");
         }
Index: trunk/psLib/test/types/tap_psMetadata_manip.c
===================================================================
--- trunk/psLib/test/types/tap_psMetadata_manip.c	(revision 41166)
+++ trunk/psLib/test/types/tap_psMetadata_manip.c	(revision 41171)
@@ -231,6 +231,6 @@
             psMetadataAddPtr(metadata, PS_LIST_TAIL, "ptr", PS_DATA_SPHERE | PS_META_DUPLICATE_OK, "", s);
             psFree(s);
-            psMetadataItem *metadataItem = NULL;
-            metadataItem = psMetadataLookup(metadata, "ptr");
+            // psMetadataItem *metadataItem = NULL;
+            // metadataItem = psMetadataLookup(metadata, "ptr");
             bool status = false;
             psSphere *sph = NULL;
Index: trunk/psLib/test/types/tst_psArguments.c
===================================================================
--- trunk/psLib/test/types/tst_psArguments.c	(revision 41166)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/** @file  tst_psArguments.c
-*
-*  @brief Test driver for psArguments functions
-*
-*  @author  David Robbins, MHPCC
-*
-*  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2006-09-13 02:20:15 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*
-*/
-
-#include "pslib.h"
-
-static psS32 testArgument(void);
-/*
-testDescription tests[] = {
-                              {testArgument, 666, "Test psArgument fxns", 0, false},
-                              {NULL}
-                          };
-*/
-int main(int argc, char* argv[])
-{
-    psLogSetLevel( PS_LOG_INFO );
-    testArgument();
-    //    if( !runTestSuite(stderr,"psArguments",tests,argc,argv)) {
-    //        return 1;
-    //    }
-    return 0;
-}
-
-psS32 testArgument(void)
-{
-    char *argv[6];
-    argv[0] = "./program";
-    argv[1] = "-string";
-    argv[2] = "new";
-    argv[3] = "-float";
-    argv[4] = "6.66";
-    argv[5] = "-vvv";
-    int argc = 6;
-
-    int i = psArgumentGet(argc, argv, "-float");
-    if ( i != 0 ) {
-        if ( !psArgumentRemove(i, &argc, argv) ) {
-            printf("\n Failed to remove float from argument list\n");
-        }
-    } else {
-        printf("\nFailed to find string in argument list\n");
-        return 1;
-    }
-    psArgumentRemove(i, &argc, argv);
-    printf("\n Argument %d has been removed", i);
-    int log = psArgumentVerbosity(&argc, argv);
-    printf("\nLog level = %d \n", log);
-
-    psMetadata *args = psMetadataAlloc();
-    psMetadataAdd(args, PS_LIST_TAIL, "-string", PS_DATA_STRING, "Test String", "SomeString");
-    psMetadataAdd(args, PS_LIST_TAIL, "-float", PS_DATA_F32, "Test Float", 0.0);
-    psMetadata *ints = psMetadataAlloc();
-    psMetadataAdd(ints, PS_LIST_TAIL, "int1", PS_DATA_S32, "Int1", 1);
-    psMetadataAdd(ints, PS_LIST_TAIL, "int2", PS_DATA_S32, "Int2", 2);
-    psMetadataAdd(args, PS_LIST_TAIL, "-int", PS_DATA_METADATA, "Integers", ints);
-    psFree(ints);                       // Drop reference
-
-    printf("\nThis Should print the Argument Help list.\n\n");
-    psArgumentHelp(args);
-
-    if ( !psArgumentParse(args, &argc, argv) || argc != 1 ) {
-        psArgumentHelp(args);
-        psFree(args);
-        return 2;
-    }
-
-    psMetadataPrint(NULL, args, 4);
-
-    psFree(args);
-    return 0;
-}
-
Index: trunk/psLib/test/types/tst_psArray.c
===================================================================
--- trunk/psLib/test/types/tst_psArray.c	(revision 41166)
+++ 	(revision )
@@ -1,533 +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)  Reallocate void pointer array bigger
- *     D)  Reallocate void pointer array smaller
- *     E)  Reallocate with null pointer
- *     F)  Remove item from array
- *     G)  Remove invalid item from array
- *     H)  Remove item from null array
- *     I)  Remove null item from array
- *     J)  Free void pointer array
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-03-06 22:34:25 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include <math.h>
-
-#include "pslib_strict.h"
-#include "psTest.h"
-
-typedef struct
-{
-    psS32 x;
-    float y;
-}
-testStruct;
-
-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 );
-static psS32 testArrayGetSet( void );
-static psS32 testArrayLength( void );
-
-testDescription tests[] = {
-                              {testArray, 665, "psArray", 0, false},
-                              {testArray01, 666, "psArray01", 0, false},
-                              {testArrayAdd, 667, "psArrayAdd", 0, false},
-                              {testArrayGetSet, 668, "psArrayGetSet", 0, false},
-                              {testArrayLength, 669, "psArrayLength", 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
-    testStruct *mySt[10];
-    psArray *psArr1 = NULL;
-
-    // Test A - Create void pointer array
-    printPositiveTestHeader(stderr,"psArray", "Create void pointer array");
-    psArray *psArr = psArrayAlloc(5);
-    if (psArr->nalloc != 5) {
-        psError(PS_ERR_UNKNOWN, true,"psArray didn't have proper number of elements.");
-        return 1;
-    }
-    printFooter(stderr, "psArray", "Create void pointer array", true);
-
-
-    // Test B - Add data to void pointer array
-    printPositiveTestHeader(stderr, "psArray", "Add data to void pointer array");
-    for(psS32 i = 0; i < 5; i++) {
-        testStruct *ts = psAlloc(sizeof(testStruct));
-        ts->x = 10*i;
-        ts->y = 10.1*i;
-        mySt[i] = ts;
-        //        psArr->data[i] = ts;
-        if (!psArraySet(psArr, psArr->n, (psPtr)ts) ) {
-            return 6;
-        }
-        psMemIncrRefCounter(ts);
-        psFree(ts);
-    }
-
-    for(psS32 i = 0; i < 5; i++) {
-        testStruct *ts = (testStruct*)psArr->data[i];
-        fprintf(stderr,"ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
-        if (fabsf(ts->x - 10*i) > 0.01f || fabsf(ts->y - 10.1*i) > 0.01f) {
-            psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array.");
-            return 2;
-        }
-    }
-    fprintf(stderr,"array size = %ld\n", psArr->nalloc);
-    if (psArr->nalloc != 5) {
-        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
-        return 3;
-    }
-    fprintf(stderr,"array population = %ld\n", psArr->n);
-    if (psArr->n != 5) {
-        psError(PS_ERR_UNKNOWN, true,"Array population wrong");
-        return 4;
-    }
-    printFooter(stderr, "psArray", "Add data to void pointer array", true);
-
-
-    // Test C - Reallocate void pointer array bigger
-    printPositiveTestHeader(stderr,"psArray", "Reallocate void pointer array bigger");
-    psArr = psArrayRealloc(psArr,10);
-    fprintf(stderr,"Adding more elements to void pointer array...\n");
-    for(psS32 i = 5; i < 10; i++) {
-        testStruct *ts = psAlloc(sizeof(testStruct));
-        ts->x = 10*i;
-        ts->y = 10.1*i;
-        mySt[i] = ts;
-        psArr->data[i] = ts;
-        psArr->n++;
-        psMemIncrRefCounter(ts);
-    }
-    for(psS32 i = 0; i < 10; i++) {
-        testStruct *ts = (testStruct*)psArr->data[i];
-        fprintf(stderr,"ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
-        if (fabsf(ts->x - 10*i) > 0.01f || fabsf(ts->y - 10.1*i) > 0.01f) {
-            psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array.");
-            return 5;
-        }
-    }
-    fprintf(stderr,"array size = %ld\n", psArr->nalloc);
-    if (psArr->nalloc != 10) {
-        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
-        return 6;
-    }
-    fprintf(stderr,"array population = %ld\n", psArr->n);
-    if (psArr->n != 10) {
-        psError(PS_ERR_UNKNOWN, true,"Array Population wrong");
-        return 7;
-    }
-    printFooter(stderr, "psArray", "Reallocate void pointer array bigger", true);
-
-    // Test D - Reallocate void pointer array smaller
-    printPositiveTestHeader(stderr,"psArray","Reallocate void pointer array smaller");
-    psArr = psArrayRealloc(psArr,3);
-    for(psS32 i = 0; i < 3; i++) {
-        testStruct *ts = (testStruct*)psArr->data[i];
-        fprintf(stderr,"ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y);
-        if (fabsf(ts->x - 10*i) > 0.01f || fabsf(ts->y - 10.1*i) > 0.01f) {
-            psError(PS_ERR_UNKNOWN, true,"Couldn't properly get elements from array.");
-            return 8;
-        }
-    }
-    fprintf(stderr,"array size = %ld\n", psArr->nalloc);
-    if (psArr->nalloc != 3) {
-        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
-        return 9;
-    }
-    fprintf(stderr,"array population = %ld\n", psArr->n);
-    if (psArr->n != 3) {
-        psError(PS_ERR_UNKNOWN, true,"Array Population wrong");
-        return 10;
-    }
-    printFooter(stderr, "psArray", "Reallocate integer void pointer smaller", true);
-
-    // Test E - Reallocate with a null
-    printNegativeTestHeader(stderr,"psArray","Reallocate with a null array",
-                            "Error message generator", 0 );
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
-    psArr1 = psArrayRealloc(NULL,5);
-    if ( psArr1 != NULL ) {
-        fprintf(stderr,"ERROR: Return is not NULL\n");
-    }
-    printFooter(stderr,"psArray","Reallocate with a null array",true);
-
-
-    // Test F - Remove item from array
-    printPositiveTestHeader(stderr, "psArray", "Remove valid item");
-    if( !psArrayRemove(psArr,mySt[0]) ) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to remove valid item");
-        return 100;
-    }
-    fprintf(stderr,"Array size after removal = %ld\n",psArr->n);
-    if ( psArr->n != 2 ) {
-        psError(PS_ERR_UNKNOWN, true, "Items in array not decremented after removal");
-        return 101;
-    }
-    for(psS32 i = 0; i < psArr->n; i++) {
-        testStruct *ts = (testStruct*)psArr->data[i];
-        fprintf(stderr,"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, "Elements not as expected after remove.");
-            return 102;
-        }
-    }
-    printFooter(stderr,"psArray","Remove valid item", true);
-
-    // Test G - Remove invalid item from array
-    printPositiveTestHeader(stderr, "psArray", "Remove invalid item from array");
-    if( psArrayRemove(psArr,mySt[9]) ) {
-        psError(PS_ERR_UNKNOWN,true,"Removed invalid item from array");
-        return 103;
-    }
-    printFooter(stderr,"psArray","Remove invalid item from array",true);
-
-    // Test H - Remove item from null array
-    printPositiveTestHeader(stderr, "psArray", "Remove item from null array");
-    if ( psArrayRemove(NULL,mySt[1]) ) {
-        psError(PS_ERR_UNKNOWN,true,"Removed valid item from null array");
-        return 104;
-    }
-    printFooter(stderr,"psArray","Remove item from null array",true);
-
-    // Test I - Remove null item from array
-    printPositiveTestHeader(stderr, "psArray", "Remove null item from array");
-    if( psArrayRemove(psArr,NULL) ) {
-        psError(PS_ERR_UNKNOWN,true,"Remove null item from array",true);
-        return 105;
-    }
-    printFooter(stderr,"psArray","Remove null item from array",true);
-
-    // Test J - Free void pointer array
-    printPositiveTestHeader(stderr, "psArray", "Free void pointer array");
-    psFree(psArr);
-    for(psS32 i = 0; i < 10; i++) {
-        psFree(mySt[i]);
-    }
-
-    printFooter(stderr, "psArray" ,"Free void pointer array", true);
-
-    return 0;
-}
-
-psS32 testArray01(void)
-{
-    // Create array of pointers
-    testStruct *mySt[10];
-
-    // Test A - Create void pointer array
-    printPositiveTestHeader(stderr,"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(stderr, "psArray", "Create void pointer array", true);
-
-    // Test B - Add data to void pointer array
-    printPositiveTestHeader(stderr, "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;
-        if (!psArraySet(psArr, psArr->n, (psPtr)ts) ) {
-            return 6;
-        }
-        psMemIncrRefCounter(ts);
-        psFree(ts);
-    }
-
-    for(psS32 i = 0; i < 10; i++) {
-        testStruct *ts = (testStruct*)psArr->data[i];
-        fprintf(stderr,"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;
-        }
-    }
-    fprintf(stderr,"array size = %ld\n", psArr->nalloc);
-    if (psArr->nalloc != 10) {
-        psError(PS_ERR_UNKNOWN, true,"Array Size wrong");
-        return 3;
-    }
-    fprintf(stderr,"array population = %ld\n", psArr->n);
-    if (psArr->n != 10) {
-        psError(PS_ERR_UNKNOWN, true,"Array population wrong");
-        return 4;
-    }
-    printFooter(stderr, "psArray", "Add data to void pointer array", true);
-
-    // Test C - Sort data in array
-    printPositiveTestHeader(stderr,"psArray","Sort data in array");
-    psArr = psArraySort(psArr,testStructCompare);
-    for(psS32 i = 0; i < 10; i++) {
-        testStruct *ts = (testStruct*)psArr->data[i];
-        fprintf(stderr,"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(stderr,"psArray","Sort data in array",true);
-
-    // Test D - Attempt to sort null array
-    printPositiveTestHeader(stderr,"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(stderr,"psArray","Attempt to sort array",true);
-
-    // Test E - Free void pointer array
-    printPositiveTestHeader(stderr, "psArray", "Free void pointer array");
-    psFree(psArr);
-    for(psS32 i = 0; i < 10; i++) {
-        psFree(mySt[i]);
-    }
-    if( psMemCheckLeaks(0, NULL, stderr, false) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Memory leaks detected.");
-        return 110;
-    }
-    psS32 nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        fprintf(stderr,"ERROR: Found %d bad memory blocks\n", nBad);
-        return 111;
-    }
-    printFooter(stderr, "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 (psMemGetRefCounter(data) != 2) {
-            // in response of Bug #302
-            psError(PS_ERR_UNKNOWN, true,
-                    "psArrayAdd did not increment the data reference count.");
-            return subtest;
-        }
-
-        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;
-        }
-
-        psFree(data);
-    }
-
-    // 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;
-    }
-
-    psFree(data);
-
-    // make the array full again (operation tested already)
-    while (arr->n < arr->nalloc) {
-        data = psAlloc(sizeof(float));
-        arr = psArrayAdd(arr, 0, data);
-        psFree(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);
-    psFree(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
-}
-
-psS32 testArrayGetSet( void )
-{
-    psArray *test;
-    int *p1 = psAlloc(sizeof(int));
-    int *p2 = psAlloc(sizeof(int));
-    int *p3 = psAlloc(sizeof(int));
-    test = psArrayAlloc(5);
-    test->n = 0;
-    *p1 = 10;
-    *p2 = 4;
-    *p3 = 666;
-
-    if ( !psArraySet(test, 0, p1) )
-        fprintf(stderr, "ArraySet failed to set S32 at position 0\n");
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if ( psArraySet(test, 10, p1) )
-        fprintf(stderr, "ArraySet Improperly set S32 at out of range position\n");
-    if ( !psArraySet(test, 1, p2) )
-        fprintf(stderr, "ArraySet Failed to set S32 at position 1\n");
-    if ( psArrayGet(test, 0) != p1 )
-        fprintf(stderr, "ArrayGet Failed to return the correct S32 from position 0\n");
-    if ( psArrayGet(test, -1) != p2)
-        fprintf(stderr, "ArrayGet Failed to return the correct S32 from tail using -1\n");
-    //    psFree(p1); // free ref from psArrayGet
-    //    psFree(p2); // free ref from psArrayGet
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if ( psArraySet(test, -6, p3) )
-        fprintf(stderr, "ArraySet failed to fail using an out of range negative number\n");
-
-    psFree(test);
-    psFree(p1);
-    psFree(p2);
-    psFree(p3);
-
-    return 0;
-}
-
-psS32 testArrayLength( void )
-{
-    psArray *array = psArrayAlloc(5);
-
-    if (psArrayLength(array) != 0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psArrayLength failed to return the correct length of array.\n");
-        return 1;
-    }
-    array->n = 5;
-    if (psArrayLength(array) != 5) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psArrayLength failed to return the correct length of array.\n");
-        return 2;
-    }
-    array->n++;
-    if (psArrayLength(array) != 6) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psArrayLength failed to return the correct length of array.\n");
-        return 3;
-    }
-    psFree(array);
-
-    psArray *emptyArray = NULL;
-    psVector *vector = psVectorAlloc(5, PS_TYPE_F32);
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psArrayLength(emptyArray) != -1) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psArrayLength failed to return -1 for a NULL input array.\n");
-        return 4;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psArrayLength((psArray*)vector) != -1) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psArrayLength failed to return -1 for an invalid input array.\n");
-        return 5;
-    }
-    psFree(vector);
-
-    return 0;
-}
-
Index: trunk/psLib/test/types/tst_psBitSet.c
===================================================================
--- trunk/psLib/test/types/tst_psBitSet.c	(revision 41166)
+++ 	(revision )
@@ -1,681 +1,0 @@
-/** @file  tst_psBitSet_01.c
- *
- *  @brief Test driver for psBitSet functions
- *
- *  This test driver contains the following tests for psBitSet test point 1:
- *     A)  Create psBitSet
- *     B)  Set bits
- *     C)  Test bits
- *     D)  Attempt to test negative bit
- *     E)  Attempt to test bit to large
- *     F)  Attempt to test bit in null BitSet
- *     G)  Attempt to set negative bit
- *     H)  Attempt to set bit to large
- *     I)  Attempt to set bit in null BitSet
- *     J)  Free psBitSet
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2007-02-07 23:52:54 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static psS32 testBitSet01a(void);
-static psS32 testBitSet01b(void);
-static psS32 testBitSet01c(void);
-static psS32 testBitSet02(void);
-static psS32 testBitSet03(void);
-static psS32 testBitSet04(void);
-static psS32 testBitSet05(void);
-static psS32 testBitSet06(void);
-
-testDescription tests[] = {
-                              {testBitSet01a, 1, "psBitSetAlloc", 0, false},
-                              {testBitSet01b, 2, "psBitSetSet/psBitSetClear", 0, false},
-                              {testBitSet01c, 3, "psBitSetTest", 0, false},
-                              {testBitSet06, 4, "psBitSetOp", 0, false},
-                              {testBitSet02, 5, "psBitSetOp AND Operator", 0, false},
-                              {testBitSet03, 6, "psBitSetOp OR Operator", 0, false},
-                              {testBitSet04, 7, "psBitSetOp XOR Operator", 0, false},
-                              {testBitSet05, 8, "psBitSetNot", 0, false},
-
-                              {NULL}
-                          };
-
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psBitSet", tests, argc, argv ) );
-}
-
-psS32 testBitSet01a(void)
-{
-    psErr* err;
-
-    // Test A - Create psBitSet
-    fprintf(stderr,"Creating psBitSet with 24 bits...\n");
-    psBitSet* bs = psBitSetAlloc(24);
-    if (bs == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Failed to create a psBitSet");
-        return 1;
-    }
-    if (bs->n != 3) {
-        psError(PS_ERR_UNKNOWN,true,"Number of bytes for psBitSet incorrect (%ld vs 3)",
-                bs->n);
-        return 2;
-    }
-    if (bs->bits[0] != 0 || bs->bits[1] != 0 || bs->bits[2] != 0) {
-        psError(PS_ERR_UNKNOWN,true,"psBitSetAlloc didn't clean ou the bits by default (%x%x%x).",
-                bs->bits[2],bs->bits[1],bs->bits[0]);
-        return 3;
-    }
-    psFree(bs);
-
-    // Test A - Create psBitSet
-    fprintf(stderr,"Creating psBitSet with 25 bits...\n");
-    bs = psBitSetAlloc(25);
-    if (bs == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Failed to create a psBitSet with 25 bits");
-        return 4;
-    }
-    if (bs->n != 4) {
-        psError(PS_ERR_UNKNOWN,true,"Number of bytes for psBitSet incorrect (%ld vs 4)",bs->n);
-        return 5;
-    }
-    psFree(bs);
-
-    psErrorClear();
-    psLogMsg(__func__,PS_LOG_INFO,"Following is an error.");
-    bs = psBitSetAlloc(-4);
-    if (bs != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psBitSetAlloc returned something in case of a negative size");
-        return 6;
-    }
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_VALUE) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psError(PS_ERR_UNKNOWN,true,"psBitSetAlloc didn't generate expected error with size = -4");
-        return 7;
-    }
-    psFree(err);
-
-    return 0;
-}
-
-psS32 testBitSet01b(void)
-{
-    char *binOut = NULL;
-    psBitSet *tempBs = NULL;
-    psErr* err = NULL;
-
-    psBitSet* bs = psBitSetAlloc(24);
-
-    if (psBitSetTest(bs,0) ||
-            psBitSetTest(bs,2) ||
-            psBitSetTest(bs,23) ) {
-
-        psAbort("psBitSetAlloc failed to clear all bits at allocation.");
-    }
-
-    // Test B - Set bits
-    tempBs = bs;
-    fprintf(stderr,"Setting first bit...\n");
-    bs = psBitSetSet(bs, 0);
-    fprintf(stderr,"Setting third bit...\n");
-    bs = psBitSetSet(bs, 2);
-    fprintf(stderr,"Setting last bit...\n");
-    bs = psBitSetSet(bs, 23);
-    if(bs != tempBs) {
-        psAbort(                "Return pointer not equal to output argument pointer.");
-    }
-    if(bs->bits[0] != 0x05) {
-        psAbort(                "Unexpected value for first byte (%d vs 5).",
-                bs->bits[0]);
-    }
-
-
-    binOut = psBitSetToString(bs);
-    fprintf(stderr,"%s\n\n", binOut);
-    psFree(binOut);
-
-    // Test C - Test bits
-    if (! psBitSetTest(bs,0) ||
-            ! psBitSetTest(bs,2) ||
-            ! psBitSetTest(bs,23) ) {
-
-        psAbort("Failed to set a bit.");
-    }
-
-    fprintf(stderr,"Clearing first bit...\n");
-    bs = psBitSetClear(bs, 0);
-    fprintf(stderr,"Clearing third bit...\n");
-    bs = psBitSetClear(bs, 2);
-    fprintf(stderr,"Clearing last bit...\n");
-    bs = psBitSetClear(bs, 23);
-
-    binOut = psBitSetToString(bs);
-    fprintf(stderr,"%s\n\n", binOut);
-    psFree(binOut);
-
-
-    if (psBitSetTest(bs,0) ||
-            psBitSetTest(bs,2) ||
-            psBitSetTest(bs,23) ) {
-
-        psAbort("Failed to clear a bit.");
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error");
-    if(psBitSetClear(NULL,2) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psBitSetClear did not return NULL with NULL bitset");
-        return 20;
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error");
-    if(psBitSetClear(bs,-3) != bs) {
-        psError(PS_ERR_UNKNOWN,true,"psBitSetClear did not return original bitset");
-        return 21;
-    }
-
-    psLogMsg("testBitSet01b",PS_LOG_INFO,"Following should be an error");
-    psErrorClear();
-    psBitSetSet(bs, -4);
-
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_VALUE) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetSet(bs, -4) didn't generate expected error.\n");
-    }
-    psFree(err);
-
-    psLogMsg("testBitSet01b",PS_LOG_INFO,"Following should be an error");
-    psErrorClear();
-    psBitSetSet(bs, 200);
-
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_VALUE) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetSet(bs, 200) didn't generate expected error.\n");
-    }
-    psFree(err);
-
-    psLogMsg("testBitSet01b",PS_LOG_INFO,"Following should be an error");
-    psErrorClear();
-    psBitSetSet(NULL, 0);
-
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_NULL) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetSet(NULL,0) didn't generate expected error.\n");
-    }
-    psFree(err);
-
-    psFree(bs);
-
-    return 0;
-}
-
-static psS32 testBitSet01c(void)
-{
-    psBitSet* bs = psBitSetAlloc(24);
-    psErr* err = NULL;
-
-    fprintf(stderr,"Setting first bit...\n");
-    bs = psBitSetSet(bs, 0);
-    fprintf(stderr,"Setting third bit...\n");
-    bs = psBitSetSet(bs, 2);
-    fprintf(stderr,"Setting last bit...\n");
-    bs = psBitSetSet(bs, 23);
-
-    if (! psBitSetTest(bs,0) ||
-            ! psBitSetTest(bs,2) ||
-            ! psBitSetTest(bs,23) ) {
-
-        psAbort("Set bits returned false.");
-    }
-
-    psLogMsg("testBitSet01c",PS_LOG_INFO,"Following should be an error");
-    psErrorClear();
-    if(psBitSetTest(bs, -4)) {
-        psAbort("psBitSetTest returned true with negative bit position.\n");
-    }
-
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_VALUE) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetTest(bs, -4) didn't generate proper error.\n");
-    }
-    psFree(err);
-
-    psLogMsg("testBitSet01c",PS_LOG_INFO,"Following should be an error");
-    psErrorClear();
-    if(psBitSetTest(bs, 200)) {
-        psAbort("psBitSetTest returned true with too-large bit position.\n");
-    }
-
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_VALUE) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetTest(bs, 200) didn't generate proper error.\n");
-    }
-    psFree(err);
-
-    psLogMsg("testBitSet01c",PS_LOG_INFO,"Following should be an error");
-    psErrorClear();
-    if (psBitSetTest(NULL, 0)) {
-        psAbort("psBitSetTest returned true with NULL psBitSet.\n");
-    }
-
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_NULL) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetTest(NULL, 0) didn't generate proper error.\n");
-    }
-    psFree(err);
-
-    psFree(bs);
-
-    return 0;
-}
-
-psS32 testBitSet02()
-{
-    char *binOut1 = NULL;
-    char *binOut2 = NULL;
-    char *binOut3 = NULL;
-
-    psBitSet* bs1 = psBitSetAlloc(24);
-    psBitSet* bs2 = psBitSetAlloc(24);
-    psBitSet* and = psBitSetAlloc(24);
-    for(psS32 i=0; i<24; i++) {
-        if ((i & 2) == 0) {
-            bs1 = psBitSetSet(bs1, i);
-        }
-        if ((i & 1) == 0) {
-            bs2 = psBitSetSet(bs2, i);
-        }
-        if (((i & 1) == 0) && ((i & 2) == 0) ) {
-            and = psBitSetSet(and, i);
-        }
-    }
-    binOut1 = psBitSetToString(bs1);
-    binOut2 = psBitSetToString(bs2);
-    binOut3 = psBitSetToString(and);
-    fprintf(stderr,"psBitSetOp input is %s, %s.  Truth is %s.\n",
-            binOut1,binOut2,binOut3);
-    psFree(binOut1);
-    psFree(binOut2);
-    psFree(binOut3);
-
-    // Test B - Perform binary AND with psBitSets
-    psLogMsg(__func__,PS_LOG_INFO,"Perform binary AND with psBitSets");
-    psBitSet* outbs = psBitSetAlloc(24);
-    outbs = psBitSetOp(outbs, bs1, "AND", bs2);
-    if (outbs == NULL) {
-        psAbort("psBitSetOp returned a NULL result for AND operation");
-    }
-
-    for(psS32 i=0; i<24; i++) {
-        psBool truth = psBitSetTest(and,i);
-        psBool res = psBitSetTest(outbs,i);
-        if ( res != truth) {
-            binOut1 = psBitSetToString(bs1);
-            binOut2 = psBitSetToString(bs2);
-            binOut3 = psBitSetToString(outbs);
-            psAbort("psBitSetOp with AND operator failed.\nInput was %s, %s.  Output was %s",
-                    binOut1,binOut2,binOut3);
-        }
-    }
-    psFree(outbs);
-
-    // Test C - Perform binary AND and auto allocate output
-    psLogMsg(__func__,PS_LOG_INFO,"Perform binary AND and auto allocate output");
-    outbs = psBitSetOp(NULL, bs1, "AND", bs2);
-    if (outbs == NULL) {
-        psAbort("psBitSetOp failed to create a new psBitSet for the result");
-    }
-    for(psS32 i=0; i<24; i++) {
-        psBool truth = psBitSetTest(and,i);
-        psBool res = psBitSetTest(outbs,i);
-        if ( res != truth) {
-            binOut1 = psBitSetToString(bs1);
-            binOut2 = psBitSetToString(bs2);
-            binOut3 = psBitSetToString(outbs);
-            psAbort("psBitSetOp with AND operator failed.\nInput was %s, %s.  Output was %s",
-                    binOut1,binOut2,binOut3);
-        }
-    }
-    psFree(outbs);
-
-    psFree(bs1);
-    psFree(bs2);
-    psFree(and);
-
-    return 0;
-}
-
-static psS32 testBitSet03(void)
-{
-    char *binOut1 = NULL;
-    char *binOut2 = NULL;
-    char *binOut3 = NULL;
-
-    psBitSet* bs1 = psBitSetAlloc(24);
-    psBitSet* bs2 = psBitSetAlloc(24);
-    psBitSet* or = psBitSetAlloc(24);
-    for(psS32 i=0; i<24; i++) {
-        if ((i/2) % 2) {
-            bs1 = psBitSetSet(bs1, i);
-        }
-        if ((i) % 2) {
-            bs2 = psBitSetSet(bs2, i);
-        }
-        if ( ((i/2) % 2) || ((i) % 2) ) {
-            or = psBitSetSet(or, i);
-        }
-    }
-
-    binOut1 = psBitSetToString(bs1);
-    binOut2 = psBitSetToString(bs2);
-    binOut3 = psBitSetToString(or);
-    fprintf(stderr,"psBitSetOp input is %s, %s.  Truth is %s.\n",
-            binOut1,binOut2,binOut3);
-    psFree(binOut1);
-    psFree(binOut2);
-    psFree(binOut3);
-
-    // Test B - Perform binary AND with psBitSets
-    psLogMsg(__func__,PS_LOG_INFO,"Perform binary OR with psBitSets");
-    psBitSet* outbs = psBitSetAlloc(24);
-    outbs = psBitSetOp(outbs, bs1, "OR", bs2);
-    if (outbs == NULL) {
-        psAbort("psBitSetOp returned a NULL result for OR operation");
-    }
-
-    for(psS32 i=0; i<24; i++) {
-        psBool truth = psBitSetTest(or,i);
-        psBool res = psBitSetTest(outbs,i);
-        if ( res != truth) {
-            binOut1 = psBitSetToString(bs1);
-            binOut2 = psBitSetToString(bs2);
-            binOut3 = psBitSetToString(outbs);
-            psAbort("psBitSetOp with OR operator failed.\nInput was %s, %s.  Output was %s",
-                    binOut1,binOut2,binOut3);
-        }
-    }
-    psFree(outbs);
-
-    // Test C - Perform binary AND and auto allocate output
-    psLogMsg(__func__,PS_LOG_INFO,"Perform binary OR and auto allocate output");
-    outbs = psBitSetOp(NULL, bs1, "OR", bs2);
-    if (outbs == NULL) {
-        psAbort("psBitSetOp failed to create a new psBitSet for the result");
-    }
-    for(psS32 i=0; i<24; i++) {
-        psBool truth = psBitSetTest(or,i);
-        psBool res = psBitSetTest(outbs,i);
-        if ( res != truth) {
-            binOut1 = psBitSetToString(bs1);
-            binOut2 = psBitSetToString(bs2);
-            binOut3 = psBitSetToString(outbs);
-            psAbort("psBitSetOp with OR operator failed.\nInput was %s, %s.  Output was %s",
-                    binOut1,binOut2,binOut3);
-        }
-    }
-    psFree(outbs);
-    outbs = NULL;
-
-    psFree(bs1);
-    psFree(bs2);
-    psFree(or);
-
-    return 0;
-}
-
-static psS32 testBitSet04(void)
-{
-    char *binOut1 = NULL;
-    char *binOut2 = NULL;
-    char *binOut3 = NULL;
-
-    psBitSet* bs1 = psBitSetAlloc(24);
-    psBitSet* bs2 = psBitSetAlloc(24);
-    psBitSet* xor = psBitSetAlloc(24);
-    for(psS32 i=0; i<24; i++) {
-        if ((i/2) % 2) {
-            bs1 = psBitSetSet(bs1, i);
-        }
-        if ((i) % 2) {
-            bs2 = psBitSetSet(bs2, i);
-        }
-        if ( ((i/2) % 2) != ((i) % 2) ) {
-            xor = psBitSetSet(xor, i);
-        }
-    }
-
-    binOut1 = psBitSetToString(bs1);
-    binOut2 = psBitSetToString(bs2);
-    binOut3 = psBitSetToString(xor);
-    fprintf(stderr,"psBitSetOp input is %s, %s.  Truth is %s.\n",
-            binOut1,binOut2,binOut3);
-    psFree(binOut1);
-    psFree(binOut2);
-    psFree(binOut3);
-
-    // Test B - Perform binary AND with psBitSets
-    psLogMsg(__func__,PS_LOG_INFO,"Perform binary XOR with psBitSets");
-    psBitSet* outbs = psBitSetAlloc(24);
-    outbs = psBitSetOp(outbs, bs1, "XOR", bs2);
-    if (outbs == NULL) {
-        psAbort("psBitSetOp returned a NULL result for XOR operation");
-    }
-
-    for(psS32 i=0; i<24; i++) {
-        psBool truth = psBitSetTest(xor,i);
-        psBool res = psBitSetTest(outbs,i);
-        if ( res != truth) {
-            binOut1 = psBitSetToString(bs1);
-            binOut2 = psBitSetToString(bs2);
-            binOut3 = psBitSetToString(outbs);
-            psAbort("psBitSetOp with XOR operator failed.\nInput was %s, %s.  Output was %s",
-                    binOut1,binOut2,binOut3);
-        }
-    }
-    psFree(outbs);
-
-    // Test C - Perform binary AND and auto allocate output
-    psLogMsg(__func__,PS_LOG_INFO,"Perform binary XOR and auto allocate output");
-    outbs = psBitSetOp(NULL, bs1, "XOR", bs2);
-    if (outbs == NULL) {
-        psAbort("psBitSetOp failed to create a new psBitSet for the result");
-    }
-    for(psS32 i=0; i<24; i++) {
-        psBool truth = psBitSetTest(xor,i);
-        psBool res = psBitSetTest(outbs,i);
-        if ( res != truth) {
-            binOut1 = psBitSetToString(bs1);
-            binOut2 = psBitSetToString(bs2);
-            binOut3 = psBitSetToString(outbs);
-            psAbort("psBitSetOp with XOR operator failed.\nInput was %s, %s.  Output was %s",
-                    binOut1,binOut2,binOut3);
-        }
-    }
-    psFree(outbs);
-    outbs = NULL;
-
-    psFree(bs1);
-    psFree(bs2);
-    psFree(xor);
-
-    return 0;
-}
-
-static psS32 testBitSet05(void)
-{
-    char *binOut1 = NULL;
-    char *binOut2 = NULL;
-
-    psBitSet* bs1 = psBitSetAlloc(24);
-    psBitSet* not = psBitSetAlloc(24);
-    for(psS32 i=0; i<24; i++) {
-        if (i % 2) {
-            bs1 = psBitSetSet(bs1, i);
-        }
-        if (i % 2 == 0) {
-            not = psBitSetSet(not, i);
-        }
-    }
-
-    binOut1 = psBitSetToString(bs1);
-    binOut2 = psBitSetToString(not);
-    fprintf(stderr,"psBitSetOp input is %s.  Truth is %s.\n",
-            binOut1,binOut2);
-    psFree(binOut1);
-    psFree(binOut2);
-
-    // Test B - Perform binary AND with psBitSets
-    psLogMsg(__func__,PS_LOG_INFO,"Perform binary NOT with psBitSets");
-    psBitSet* outbs = psBitSetAlloc(24);
-    outbs = psBitSetNot(outbs, bs1);
-    if (outbs == NULL) {
-        psAbort("psBitSetOp returned a NULL result for NOT operation");
-    }
-
-    for(psS32 i=0; i<24; i++) {
-        psBool truth = psBitSetTest(not,i);
-        psBool res = psBitSetTest(outbs,i);
-        if ( res != truth) {
-            binOut1 = psBitSetToString(bs1);
-            binOut2 = psBitSetToString(outbs);
-            psAbort("psBitSetOp with NOT operator failed.\nInput was %s.  Output was %s",
-                    binOut1,binOut2);
-        }
-    }
-    psFree(outbs);
-
-    // Test C - Perform binary AND and auto allocate output
-    psLogMsg(__func__,PS_LOG_INFO,"Perform binary NOT and auto allocate output");
-    outbs = psBitSetNot(NULL, bs1);
-    if (outbs == NULL) {
-        psAbort("psBitSetOp failed to create a new psBitSet for the result");
-    }
-    for(psS32 i=0; i<24; i++) {
-        psBool truth = psBitSetTest(not,i);
-        psBool res = psBitSetTest(outbs,i);
-        if ( res != truth) {
-            binOut1 = psBitSetToString(bs1);
-            binOut2 = psBitSetToString(outbs);
-            psAbort("psBitSetOp with NOT operator failed.\nInput was %s.  Output was %s",
-                    binOut1,binOut2);
-        }
-    }
-    psFree(outbs);
-    outbs = NULL;
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
-    if(psBitSetNot(NULL,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psBitSetNot did not return NULL with NULL input");
-        return 30;
-    }
-
-    psFree(bs1);
-    psFree(not);
-
-    return 0;
-}
-
-static psS32 testBitSet06(void)
-{
-    psErr* err;
-
-    psBitSet* bs1 = psBitSetAlloc(24);
-    psBitSet* bs2 = psBitSetAlloc(40);
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error");
-    psBitSet* outbs = psBitSetOp(NULL, bs1, "XOR", bs2);
-    if (outbs != NULL) {
-        psAbort("psBitSetOp did not return a NULL result when input sizes differ");
-    }
-
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_SIZE) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetOp didn't generate expected error with operands' sizes differed.");
-    }
-    psFree(err);
-    psFree(bs1);
-    psFree(bs2);
-
-    bs1 = psBitSetAlloc(24);
-    bs2 = psBitSetAlloc(24);
-
-    outbs = psBitSetAlloc(40);
-    psBitSet* outbs2 = psBitSetOp(outbs, bs1, "XOR", bs2);
-    if (outbs2 == NULL) {
-        psAbort("psBitSetOp failed when input size and output size differed (a recoverable error).");
-    }
-    if (outbs2 != outbs) {
-        psAbort("psBitSetOp didn't reuse the given output struct.");
-    }
-    if (outbs2->n != bs1->n) {
-        psAbort("psBitSetOp did properly adjust the output psBitSet size.");
-    }
-
-    psErrorClear();
-    psLogMsg(__func__,PS_LOG_INFO,"Following is an error.");
-    outbs = psBitSetOp(outbs, bs1, "FOO", bs2);
-    if (outbs != NULL) {
-        psAbort("psBitSetOp returned something in case of a bogus operation.");
-    }
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_VALUE) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetOp didn't generate expected error with bogus operator.");
-    }
-    psFree(err);
-
-
-    // try again, though give a valid output bitset -- should free the out upon error to avoid leak.
-    outbs = psBitSetAlloc(24);
-    psErrorClear();
-    psLogMsg(__func__,PS_LOG_INFO,"Following is an error.");
-    outbs = psBitSetOp(outbs, bs1, "FOO", bs2);
-
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_VALUE) {
-        psErrorStackPrint(stderr,"Error Stack:");
-        psAbort("psBitSetOp didn't generate expected error with bogus operator.");
-    }
-    psFree(err);
-
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
-    if(psBitSetOp(outbs,NULL,"AND",bs2) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psBitSetOp did not return NULL with NULL input 1 bit set");
-        return 40;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
-    if(psBitSetOp(outbs,bs1,NULL,bs2) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psBitSetOp did not return NULL with NULL operator");
-        return 41;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error");
-    if(psBitSetOp(outbs,bs1,"AND",NULL) != NULL)  {
-        psError(PS_ERR_UNKNOWN,true,"psBitSetOp did not return NULL with NULL input 2 bit set");
-        return 42;
-    }
-
-    psFree(bs1);
-    psFree(bs2);
-    psFree(outbs);
-
-    return 0;
-}
Index: trunk/psLib/test/types/tst_psHash00.c
===================================================================
--- trunk/psLib/test/types/tst_psHash00.c	(revision 41166)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*****************************************************************************
-    This code will test whether a hash table can be allocated successfully,
-    then deallocated successfully.
- *****************************************************************************/
-#include <stdio.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-#include "psHash.h"
-#define NUM_HASH_TABLE_BUCKETS 10
-psS32 main()
-{
-    psHash *myHashTable = NULL;
-    psS32 testStatus      = true;
-    psS32 i               = 0;
-    psS32 currentId = psMemGetId();
-    psS32 memLeaks        = 0;
-    printPositiveTestHeader(stdout,
-                            "psHash functions",
-                            "psHashAlloc()");
-
-    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
-
-    if (myHashTable == NULL) {
-        fprintf(stderr, "%s: could not allocate a hash table.", __func__);
-        testStatus = false;
-    }
-
-    if (myHashTable->n != NUM_HASH_TABLE_BUCKETS) {
-        fprintf(stderr, "%s: myHashTable->nbucket not set properly.\n",
-                __func__);
-        testStatus = false;
-
-    }
-
-    if (myHashTable->buckets == NULL) {
-        fprintf(stderr, "%s: myHashTable->buckets is NULL.\n",
-                __func__);
-        testStatus = false;
-
-    }
-
-    for (i=0;i<NUM_HASH_TABLE_BUCKETS;i++) {
-        if (myHashTable->buckets[i] != NULL) {
-            fprintf(stderr, "%s: hash table bucket[%d] not equal to NULL.\n",
-                    __func__, i);
-            testStatus = false;
-        }
-    }
-
-    printFooter(stdout,
-                "psHash functions",
-                "psHashAlloc()",
-                testStatus);
-
-    psFree(myHashTable);
-
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if (0 != memLeaks) {
-        psAbort("Memory Leaks! (%d leaks)", memLeaks);
-    }
-    psMemCheckCorruption(1);
-
-    return (!testStatus);
-}
Index: trunk/psLib/test/types/tst_psHash01.c
===================================================================
--- trunk/psLib/test/types/tst_psHash01.c	(revision 41166)
+++ 	(revision )
@@ -1,155 +1,0 @@
-/*****************************************************************************
-    This code will test whether a hash table can be de-allocated successfully.
- *****************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-#include "psHash.h"
-#define NUM_HASH_TABLE_BUCKETS 100
-psS32 imGlobal = 0;
-
-typedef struct
-{
-    char *name;
-}
-ID;
-
-static void IdFree(ID *id);
-
-static ID *IdAlloc(const char *name)
-{
-    ID *id = psAlloc(sizeof(ID));
-    psMemSetDeallocator(id,(psFreeFunc)IdFree);
-    id->name = psStringCopy(name);
-
-    return id;
-}
-
-static void IdFree(ID *id)
-{
-    imGlobal++;
-    psFree(id->name);
-}
-
-psS32 main()
-{
-    psHash *myHashTable = NULL;
-    psS32 testStatus      = true;
-    psS32 currentId = psMemGetId();
-    ID* id = NULL;
-    ID* replaceId = NULL;
-    psS32 memLeaks        = 0;
-    psBool  retVal = false;
-
-    // Allocate memory for Hash Table
-    printPositiveTestHeader(stdout,"psHash functions","psHashAlloc");
-    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
-    if(myHashTable == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to allocate psHash table");
-        return 10;
-    }
-    printFooter(stdout,"psHash functions","psHashAlloc",true);
-
-    // Add items to Hash table
-    id = IdAlloc("IDA");
-    printPositiveTestHeader(stdout,"psHash functions","psHashAdd");
-    retVal = psHashAdd(myHashTable, "ENTRY00", id);
-    psFree(id);
-    if( !retVal) {
-        psError(PS_ERR_UNKNOWN, true, "psHashAdd unable to add ENTRY00");
-        return 1;
-    }
-
-    id = IdAlloc("IDB");
-    retVal = psHashAdd(myHashTable, "ENTRY01", id);
-    psFree(id);
-    if (!retVal) {
-        psError(PS_ERR_UNKNOWN, true, "psHashAdd unable to add ENTRY01");
-        return 2;
-    }
-
-    id = IdAlloc("IDC");
-    retVal = psHashAdd(myHashTable, "ENTRY02", id);
-    psFree(id);
-    if(!retVal) {
-        psError(PS_ERR_UNKNOWN,true,"psHashAdd unable to add ENTRY02");
-        return 3;
-    }
-
-    id = IdAlloc("IDD");
-    retVal =psHashAdd(myHashTable, "ENTRY03", id);
-    psFree(id);
-    if(!retVal) {
-        psError(PS_ERR_UNKNOWN,true,"psHashAdd unable to add ENTRY03");
-        return 4;
-    }
-    printFooter(stdout,"psHash functions","psHashAdd",true);
-
-    // Replace item with same key
-    printPositiveTestHeader(stdout,"psHash replace item","psHashAdd");
-    id = IdAlloc("IDE");
-    retVal = psHashAdd(myHashTable,"ENTRY02",id);
-    if(!retVal) {
-        psError(PS_ERR_UNKNOWN,true,"psHashAdd unable to replace ENTRY02");
-        return 5;
-    }
-    replaceId = psHashLookup(myHashTable,"ENTRY02");
-    if(strcmp(replaceId->name,"IDE") != 0) {
-        psError(PS_ERR_UNKNOWN,true,"psHashAdd did not replace ENTRY02 with correct item");
-        return 6;
-    }
-    printFooter(stdout,"psHash replace item","psHashAdd",true);
-
-    // Add with NULL hash table specified
-    printNegativeTestHeader(stdout,"psHashAdd","NULL hash table","Hash table can not be NULL.",0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashAdd with null table");
-    retVal = psHashAdd(NULL,"ENTRY04",id);
-    if(retVal) {
-        psError(PS_ERR_UNKNOWN,true,"psHashAdd added entry to NULL hash table.");
-        return 20;
-    }
-    printFooter(stdout,"psHashAdd","NULL hash table",true);
-
-    // Add with key to valid hash table NULL
-    printNegativeTestHeader(stdout,"psHashAdd","NULL key","Hash key can not be NULL.",0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashAdd with null key");
-    retVal = psHashAdd(myHashTable,NULL,id);
-    if(retVal) {
-        psError(PS_ERR_UNKNOWN,true,"psHashAdd added entry to hash table with NULL key.");
-        return 21;
-    }
-    printFooter(stdout,"psHashAdd","NULL hash key",true);
-
-    // Add NULL hash data to valid table and key
-    printNegativeTestHeader(stdout,"psHashAdd","NULL hash data","Hash data can not be NULL.",0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashAdd with null data");
-    retVal = psHashAdd(myHashTable,"ENTRY04",NULL);
-    if(retVal) {
-        psError(PS_ERR_UNKNOWN,true,"psHashAdd added entry to hash table with NULL data.");
-        return 22;
-    }
-    printFooter(stdout,"psHashAdd","NULL hash data",true);
-
-    // Free hash table
-    printPositiveTestHeader(stdout,"psHash functions","psHashFree");
-    psFree(id);
-
-    psFree(myHashTable);
-
-    if (imGlobal != 5) {
-        fprintf(stderr, "%s: only (%d/4) entries were freed",
-                __func__, imGlobal);
-        testStatus = false;
-    }
-
-    printFooter(stdout,"psHash functions","psHashFree()",testStatus);
-
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if (memLeaks != 0) {
-        psAbort("Memory Leaks! (%d leaks)", memLeaks);
-    }
-    psMemCheckCorruption(1);
-
-    return (!testStatus);
-}
Index: trunk/psLib/test/types/tst_psHash02.c
===================================================================
--- trunk/psLib/test/types/tst_psHash02.c	(revision 41166)
+++ 	(revision )
@@ -1,113 +1,0 @@
-/*****************************************************************************
-    This code will test whether hash tables entries can be inserted correctly,
-    and retrieved correctly.
- 
-    NOTE: Add code to test whether duplicates are handled correctly (use a
-    small hash table and lots of keys).
- *****************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-#include "psHash.h"
-#define NUM_HASH_TABLE_BUCKETS 100
-psS32 imGlobal = 0;
-
-typedef struct
-{
-    char *name;
-}
-ID;
-static void IdFree(ID *id);
-
-static ID *IdAlloc(const char *name)
-{
-    ID *id = psAlloc(sizeof(ID));
-    psMemSetDeallocator(id,(psFreeFunc)IdFree);
-    id->name = psStringCopy(name);
-
-    return id;
-}
-
-static void IdFree(ID *id)
-{
-    imGlobal++;
-    psFree(id->name);
-}
-
-psS32 main()
-{
-    psHash *myHashTable = NULL;
-    psS32 testStatus      = true;
-    psS32 i               = 0;
-    ID *id = NULL;
-    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL
-                     };
-    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL
-                     };
-    psS32 currentId = psMemGetId();
-    psS32 memLeaks        = 0;
-
-    printPositiveTestHeader(stdout,"psHash functions","psHashLookup");
-
-    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
-    i = 0;
-    while (myKeys[i] != NULL) {
-        id = IdAlloc(myData[i]);
-        psHashAdd(myHashTable, myKeys[i], id);
-        psFree(id);
-        i++;
-    }
-
-    i = 0;
-    while (myKeys[i] != NULL) {
-        id = psHashLookup(myHashTable, myKeys[i]);
-        if (0 != strcmp(myData[i], id->name)) {
-            fprintf(stderr, "%s: Hash table entry for key %s was %s (should be %s).\n",
-                    __func__, myKeys[i], id->name, myData[i]);
-            return 1;
-        }
-        i++;
-    }
-    printFooter(stdout,"psHash functions","psHashLookup",true);
-
-    // Use an invalid key in the hash table: verify no item is returned
-    printNegativeTestHeader(stdout,"psHashLookup","Invalid key","Key is not found in the table",0);
-    id = psHashLookup(myHashTable, "BogusKey");
-    if (id != NULL) {
-        fprintf(stderr, "%s: Hash table entry for key %s was not NULL.\n",
-                __func__, "BogusKey");
-        return 2;
-    }
-    printFooter(stdout,"psHashLookup","Invalid key",true);
-
-    // Lookup with null table
-    printNegativeTestHeader(stdout,"psHashLookup","NULL table","Can not lookup with NULL table",0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashLookup with null table");
-    id = psHashLookup(NULL,"ENTRY01");
-    if (id != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psHashLookup retrieved an entry from NULL hash table.");
-        return 3;
-    }
-    printFooter(stdout,"psHashLookup","NULL table",true);
-
-    // Lookup with null key
-    printNegativeTestHeader(stdout,"psHashLookup","NULL key","Can not lookup with NULL key.",0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashLookup with null key");
-    id = psHashLookup(myHashTable,NULL);
-    if (id != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psHashLookup retrieved an entry with NULL key.");
-        return 4;
-    }
-    printFooter(stdout,"psHashLookup","NULL key",true);
-
-    psFree(myHashTable);
-
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if (0 != memLeaks) {
-        psAbort("Memory Leaks! (%d leaks)", memLeaks);
-    }
-    psMemCheckCorruption(1);
-
-    return (!testStatus);
-}
Index: trunk/psLib/test/types/tst_psHash03.c
===================================================================
--- trunk/psLib/test/types/tst_psHash03.c	(revision 41166)
+++ 	(revision )
@@ -1,142 +1,0 @@
-/*****************************************************************************
-    This code will test whether hash tables entries can be removed correctly.
- 
-    NOTE: Add code to test whether duplicates are handled correctly.
- *****************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-#include "psHash.h"
-#include "psMemory.h"
-#define NUM_HASH_TABLE_BUCKETS 100
-psS32 imGlobal = 0;
-psS32 currentId = 0;
-
-typedef struct
-{
-    char *name;
-}
-ID;
-static void IdFree(ID *id);
-
-static ID *IdAlloc(const char *name)
-{
-    ID *id = NULL;
-
-    id = psAlloc(sizeof(ID));
-    psMemSetDeallocator(id,(psFreeFunc)IdFree);
-
-    id->name = psStringCopy(name);
-
-    return id;
-}
-
-static void IdFree(ID *id)
-{
-    imGlobal++;
-    psFree(id->name);
-}
-
-psS32 main()
-{
-    psHash *myHashTable = NULL;
-    psS32 testStatus      = true;
-    psS32 i               = 0;
-    psS32 TotalKeys       = 0;
-    psBool retVal         = false;
-    ID *id = NULL;
-    ID *ids[4];
-    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL
-                     };
-    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL
-                     };
-    psS32 memLeaks        = 0;
-
-    currentId = psMemGetId();
-
-    printPositiveTestHeader(stdout,"psHash functions","psHashRemove");
-
-    // Add items to hash table
-    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
-    i = 0;
-    while (myKeys[i] != NULL) {
-        ids[i] = IdAlloc(myData[i]);
-        psHashAdd(myHashTable, myKeys[i], ids[i]);
-        i++;
-    }
-    TotalKeys = i - 1;
-
-    // Verify items which were just add to hash table
-    i = TotalKeys;
-    while (i >= 0) {
-
-        id = psHashLookup(myHashTable, myKeys[i]);
-        if (0 != strcmp(myData[i], id->name)) {
-            fprintf(stderr, "%s: Hash table entry for key %s was %s (should be %s).\n",
-                    __func__, myKeys[i], id->name, myData[i]);
-            return 1;
-        }
-        i--;
-    }
-
-    // Remove each item from the table and verify item is no longer in the list
-    i = 0;
-    while (myKeys[i] != NULL) {
-        // The psHashRemove() procedure removes the entry from the hash
-        // table and deletes the data.
-        retVal = psHashRemove(myHashTable, myKeys[i]);
-        if (!retVal) {
-            fprintf(stderr,"%s: Hash table entry not removed.\n",__func__);
-            return 2;
-        }
-        id = psHashLookup(myHashTable, myKeys[i]);
-        if (id != NULL) {
-            fprintf(stderr, "%s: Hash table entry for key %s not removed.\n",
-                    __func__, "IDA");
-            return 3;
-        }
-        i++;
-    }
-    printFooter(stdout,"psHash functions","psHashRemove()",true);
-
-    // Use an invalid key in the hash table: verify false is returned
-    printNegativeTestHeader(stdout,"psHashRemove","Invalid key","Key is not found in table",0);
-    if (psHashRemove(myHashTable,"BogusKey") ) {
-        psError(PS_ERR_UNKNOWN,true,"psHashRemove removed an entry with a bogus key.");
-        return 4;
-    }
-    printFooter(stdout,"psHashRemove","Invalid key",true);
-
-    // Remove with null table
-    printNegativeTestHeader(stdout,"psHashRemove","NULL table","Can not remove with NULL table",0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashRemove with null table");
-    retVal = psHashRemove(NULL,"ENTRY02");
-    if (retVal) {
-        psError(PS_ERR_UNKNOWN,true,"psHashRemove removed an entry from NULL hash table.");
-        return 5;
-    }
-    printFooter(stdout,"psHashRemove","NULL table",true);
-
-    // Remove with null key
-    printNegativeTestHeader(stdout,"psHashRemove","NULL key","Can not remove with NULL key",0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message: psHashRemove with null key");
-    if (psHashRemove(myHashTable,NULL) ) {
-        psError(PS_ERR_UNKNOWN,true,"psHashRemove removed an entry from NULL key");
-        return 6;
-    }
-    printFooter(stdout,"psHashRemove","NULL key",true);
-
-    psFree(myHashTable);
-    for(i=0; i<(TotalKeys+1); i++) {
-        psFree(ids[i]);
-    }
-    memLeaks = psMemCheckLeaks(currentId,NULL,stdout,false);
-    if (memLeaks != 0) {
-        psAbort("Memory Leaks! (%d leaks)", memLeaks);
-    }
-    psMemCheckCorruption(true);
-
-    return (!testStatus);
-}
-
Index: trunk/psLib/test/types/tst_psHash04.c
===================================================================
--- trunk/psLib/test/types/tst_psHash04.c	(revision 41166)
+++ 	(revision )
@@ -1,84 +1,0 @@
-/*****************************************************************************
-    This code will test whether the call psHashKeyList() function works.
- *****************************************************************************/
-#include <stdio.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-#include "psHash.h"
-#define NUM_HASH_TABLE_BUCKETS 100
-psS32 imGlobal = 0;
-
-typedef struct
-{
-    char *name;
-}
-ID;
-static void IdFree(ID *id);
-
-static ID *IdAlloc(const char *name)
-{
-    ID *id = psAlloc(sizeof(ID));
-    psMemSetDeallocator(id,(psFreeFunc)IdFree);
-
-    id->name = psStringCopy(name);
-
-    return id;
-}
-
-static void IdFree(ID *id)
-{
-    imGlobal++;
-    psFree(id->name);
-}
-
-psS32 main()
-{
-    psHash *myHashTable = NULL;
-    psS32 testStatus      = true;
-    psS32 i               = 0;
-    char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL
-                     };
-    char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL
-                     };
-    psS32 currentId = psMemGetId();
-    psS32 memLeaks        = 0;
-    psList *myLinkList = NULL;
-    psListElem *tmp = NULL;
-    ID* id = NULL;
-
-    printPositiveTestHeader(stdout,"psHash functions","psHashKeyList()");
-    myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
-    i = 0;
-    while (myKeys[i] != NULL) {
-        id = IdAlloc(myData[i]);
-        psHashAdd(myHashTable, myKeys[i], id);
-        psFree(id);
-        i++;
-    }
-    myLinkList = psHashKeyList(myHashTable);
-    tmp = myLinkList->head;
-    while (tmp != NULL) {
-        printf("Linked List Entries: %s\n", (char *) tmp->data);
-        tmp = tmp->next;
-    }
-    printFooter(stdout,"psHash functions","psHashKeyList()",testStatus);
-    psFree(myLinkList);
-
-    printNegativeTestHeader(stdout,"psHashKeyList","NULL table","Can not lookup with NULL table",0);
-    myLinkList = psHashKeyList(NULL);
-    if(myLinkList != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psHashKeyList retrieved a key list from a NULL table.");
-        return 1;
-    }
-    printFooter(stdout,"psHashKeyList","NULL table",true);
-
-    psFree(myHashTable);
-
-    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
-    if (memLeaks != 0) {
-        psAbort("Memory Leaks! (%d leaks)", memLeaks);
-    }
-    psMemCheckCorruption(1);
-
-    return(!testStatus);
-}
Index: trunk/psLib/test/types/tst_psHash05.c
===================================================================
--- trunk/psLib/test/types/tst_psHash05.c	(revision 41166)
+++ 	(revision )
@@ -1,172 +1,0 @@
-/** @file  tst_psHash05.c
-*
-*  @brief Contains the tests for psHash.[ch]
-*
-*
-*  @author Robert DeSonia, MHPCC
-*
-*  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-07-13 02:47:01 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-static psS32 hashToArray( void );
-
-testDescription tests[] = {
-                              {hashToArray, 789, "psHashToArray", 0, false},
-                              {NULL}
-                          };
-
-static void printIntArray(char* name, psArray* arr)
-{
-    if (arr == NULL) {
-        printf("%s = NULL\n",name);
-        return;
-    }
-
-    printf("%s = {",name);
-    for (int i = 0; i < arr->n; i++) {
-        if (arr->data[i] == NULL) {
-            printf("NULL");
-        } else {
-            printf("%d",*(int*)arr->data[i]);
-        }
-        if (i != arr->n-1) {
-            printf(",");
-        }
-    }
-    printf("}");
-}
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psHash", tests, argc, argv ) );
-}
-
-psS32 hashToArray( void )
-{
-    int testNum = 0;
-    psArray* array;
-    #define BUCKETS 10
-
-    psHash* hash = psHashAlloc(BUCKETS);
-    char key[2] = "A";
-    bool found[BUCKETS];
-
-    for (int i = 0; i < BUCKETS; i++) {
-
-        array = psHashToArray(hash);
-
-        // return non-null?
-        testNum++;
-        if (array == NULL) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to create an array from a psHash of %d elements.",
-                    i);
-            return testNum;
-        }
-
-        // the size correct
-        testNum++;
-        if (array->n != i) {
-            printIntArray("array",array);
-            psError(PS_ERR_UNKNOWN, false,
-                    "psHashToArray created a psArray of %d elements from a psHash of %d elements.",
-                    array->n, i);
-            return testNum;
-        }
-
-        // the values correct?
-
-        // zero out the found boolean vector
-        for (int j = 0; j < i; j++) {
-            found[j] = false;
-        }
-
-        // check if all the items in array are valid
-        for (int k = 0; k < array->n; k++) {
-            int* item = array->data[k];
-
-            testNum++;
-            if (item == NULL) {
-                printIntArray("array",array);
-                psError(PS_ERR_UNKNOWN, true,
-                        "The array position %d was NULL.",
-                        k);
-                return testNum;
-            }
-
-            testNum++;
-            if (*item < 0 || *item >= BUCKETS) {
-                printIntArray("array",array);
-                psError(PS_ERR_UNKNOWN, true,
-                        "The array position %d was invalid (%d).",
-                        k,*item);
-                return testNum;
-            }
-
-            testNum++;
-            if (found[*item]) {
-                printIntArray("array",array);
-                psError(PS_ERR_UNKNOWN, true,
-                        "The array position %d was a duplicate (%d).",
-                        k,*item);
-                return testNum;
-            }
-
-            testNum++;
-            if (psMemGetRefCounter(item) != 2) {
-                printIntArray("array",array);
-                psError(PS_ERR_UNKNOWN, true,
-                        "The array position %d was not properly reference counted (%d).",
-                        k,psMemGetRefCounter(item));
-                return testNum;
-            }
-
-            found[*item] = true;
-        }
-
-        // check that all the items in psHash was found
-        for (int j = 0; j < i; j++) {
-            testNum++;
-            if (! found[j]) {
-                printIntArray("array",array);
-                psError(PS_ERR_UNKNOWN, true,
-                        "Item %d not found in array.",
-                        j);
-                return testNum;
-            }
-        }
-
-        psFree(array);
-
-        // add one element
-        int* value = psAlloc(sizeof(int));
-        *value = i;
-        psHashAdd(hash, key, value);
-        *key += 1; // increment the key value
-
-        psFree(value);
-    }
-
-    psFree(hash);
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error.");
-    array = psHashToArray(NULL);
-    testNum++;
-    if (array != NULL) {
-        printIntArray("array",array);
-        psError(PS_ERR_UNKNOWN, false,
-                "psHashToArray returned non-null psArray given a null psHash.");
-        return testNum;
-    }
-
-    return 0;
-}
-
Index: trunk/psLib/test/types/tst_psList.c
===================================================================
--- trunk/psLib/test/types/tst_psList.c	(revision 41166)
+++ 	(revision )
@@ -1,1320 +1,0 @@
-/** @file  tst_psList.c
- *
- *  @brief Contains the tests for psList.[ch]
- *
- *
- *  @author Robert DeSonia, MHPCC
- *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-26 01:47:22 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- */
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-void printListInt(psList* list);
-
-
-static psS32 testListAlloc(void);
-static psS32 testListAdd(void);
-static psS32 testListGet(void);
-static psS32 testListRemove(void);
-static psS32 testListConvert(void);
-static psS32 testListIterator(void);
-static psS32 testListFree(void);
-static psS32 testListSort(void);
-static psS32 testListAddAfter(void);
-static psS32 testListAddBefore(void);
-static psS32 testListLength(void);
-
-testDescription tests[] = {
-                              {testListAlloc,487,"psListAlloc",0,false},
-                              {testListAdd,488,"psListAdd",0,false},
-                              {testListGet,489,"psListGet",0,false},
-                              {testListRemove,490,"psListRemove",0,false},
-                              {testListConvert,491,"psListConvert",0,false},
-                              {testListIterator,494,"psListIterator",0,false},
-                              {testListFree,627,"psListFree",0,false},
-                              {testListSort,624,"psListSort",0,false},
-                              {testListAddAfter,811,"psListAddAfter",0,false},
-                              {testListAddBefore,811,"psListAddBefore",0,false},
-                              {testListLength,666,"testListLength",0,false},
-                              {NULL}
-                          };
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    if (! runTestSuite(stderr,"psList",tests,argc,argv) ) {
-        psError(PS_ERR_UNKNOWN,true,"One or more tests failed");
-        return 1;
-    }
-    return 0;
-}
-
-psS32 testListAlloc(void)
-{
-    psList* list;
-    psS32 ref;
-    float* data;
-
-    psLogMsg(__func__,PS_LOG_INFO,"psListAlloc shall create a psList with either 0 or 1 element.");
-
-    data = psAlloc(sizeof(float));
-
-    // if psListAlloc is invoked with a NULL parameter, it shall return an
-    // empty psList struct with head=tail=NULL and n=0. Otherwise, it shall
-    // return a psList of one element (head=tail=data, n=1).
-    // Test requirement SDR-167
-    list = psListAlloc(NULL);
-    if (list == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psListAlloc failed to return a list.");
-        return 1;
-    }
-    if (list->head != NULL || list->tail != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"head and/or tail was not NULL for empty list.");
-        return 2;
-    }
-    if (list->n != 0) {
-        psError(PS_ERR_UNKNOWN, true,"size of list wasn't zero for empty list.");
-        return 3;
-    }
-
-    psFree(list);
-
-    // Test requirement SDR-165
-    list = psListAlloc(data);
-    if (list == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psListAlloc failed to return a list.");
-        return 4;
-    }
-
-    if (list->head == NULL || list->tail == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"head and/or tail was NULL for one-element new list.");
-        return 5;
-    }
-
-    if (list->head->data != data || list->tail->data != data) {
-        psError(PS_ERR_UNKNOWN, true,"head and/or tail didn't point to data's node for one-element new list.");
-        return 6;
-    }
-
-    if (list->n != 1) {
-        psError(PS_ERR_UNKNOWN, true,"size of list wasn't correctly set for new, one-element list.");
-        return 7;
-    }
-
-    ref = psMemGetRefCounter(data);
-    if (ref != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psList didn't increment reference count of data (%d.",ref);
-        return 8;
-    }
-
-    psFree(list);
-
-    psFree(data);
-
-    return 0;
-}
-
-psS32 testListAddAfter(void)
-{
-    psList* list = NULL;
-    psS32*  data = NULL;
-    psS32*  data1 = NULL;
-    psS32*  data2 = NULL;
-    psListIterator *currentIterator = NULL;
-
-    data = psAlloc(sizeof(psS32));
-    *data = 1;
-    data1 = psAlloc(sizeof(psS32));
-    *data1 = 2;
-    data2 = psAlloc(sizeof(psS32));
-    *data2 = 3;
-
-    list = psListAlloc(data);
-    currentIterator = psListIteratorAlloc(list,PS_LIST_HEAD,true);
-
-    // Add data after HEAD and verify data
-    // Test requirement SDR-755
-    if(!psListAddAfter(currentIterator,data1)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddAfter failed to add item");
-        return 1;
-    }
-    if(*(psS32*)list->head->next->data != 2) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddAfter did not add the item properly");
-        return 2;
-    }
-    // Test requirement SDR-175
-    if (psMemGetRefCounter(data1) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAddAfter didn't increment the data reference count.");
-        return 20;
-    }
-    psFree(currentIterator);
-
-    currentIterator = psListIteratorAlloc(list,PS_LIST_TAIL,true);
-
-    // Add data after TAIL and verify data
-    if(!psListAddAfter(currentIterator,data2)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddAfter failed to add item");
-        return 3;
-    }
-    if(*(psS32*)list->tail->data != 3) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddAfter did not add the item properly");
-        return 4;
-    }
-    // Test requirement SDR-175
-    if (psMemGetRefCounter(data2) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAddAfter didn't increment the data reference count.");
-        return 40;
-    }
-
-    // Verify error message generated with data pointer is NULL
-    psLogMsg(__func__,PS_LOG_INFO,"NULL data pointer should generate error message");
-    if(psListAddAfter(currentIterator,NULL)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddAfter should have generated error.");
-        return 5;
-    }
-
-    // Verify error message generated with iterator NULL
-    psLogMsg(__func__,PS_LOG_INFO,"NULL iterator should generate error message");
-    if(psListAddAfter(NULL,data2)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddAfter should have generated error.");
-        return 6;
-    }
-
-    // Verify error message is generate with non-mutable iterator
-    psLogMsg(__func__,PS_LOG_INFO,"Non-mutable list should generate error message");
-    currentIterator->mutable = false;
-    if(psListAddAfter(currentIterator,data2)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddAfter should have generated error for non-mutable list add");
-        return 7;
-    }
-    currentIterator->mutable = true;
-
-    psFree(data);
-    psFree(data1);
-    psFree(data2);
-    psFree(list);
-
-    return 0;
-}
-
-psS32 testListAddBefore(void)
-{
-    psList* list = NULL;
-    psS32*  data1 = NULL;
-    psS32*  data2 = NULL;
-    psListIterator *currentIterator = NULL;
-
-    data1 = psAlloc(sizeof(psS32));
-    *data1 = 2;
-    data2 = psAlloc(sizeof(psS32));
-    *data2 = 3;
-
-    list = psListAlloc(NULL);
-    currentIterator = psListIteratorAlloc(list,PS_LIST_HEAD,true);
-
-    // Add data before HEAD and verify data
-    // Test requirement SDR-756
-    if(!psListAddBefore(currentIterator,data1)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddBefore failed to add item");
-        return 1;
-    }
-    if(*(psS32*)list->head->data != 2) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddBefore did not add the item properly");
-        return 2;
-    }
-    // Test requirement SDR-175
-    if (psMemGetRefCounter(data1) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAddBefore didn't increment the data reference count.");
-        return 20;
-    }
-    psFree(currentIterator);
-
-    currentIterator = psListIteratorAlloc(list,PS_LIST_TAIL,true);
-
-    // Add data after TAIL and verify data
-    if(!psListAddBefore(currentIterator,data2)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddBefore failed to add item");
-        return 3;
-    }
-    if(*(psS32*)list->tail->prev->data != 3) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddBefore did not add the item properly");
-        return 4;
-    }
-    // Test requirement SDR-175
-    if (psMemGetRefCounter(data2) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAddBefore didn't increment the data reference count.");
-        return 40;
-    }
-
-    // Verify error message generated with data pointer is NULL
-    psLogMsg(__func__,PS_LOG_INFO,"NULL data pointer should generate error message");
-    if(psListAddBefore(currentIterator,NULL)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddBefore should have generated error.");
-        return 5;
-    }
-
-    // Verify error message generated with iterator NULL
-    psLogMsg(__func__,PS_LOG_INFO,"NULL iterator should generate error message");
-    if(psListAddBefore(NULL,data2)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddBefore should have generated error.");
-        return 6;
-    }
-
-    // Verify error message is generate with non-mutable iterator
-    psLogMsg(__func__,PS_LOG_INFO,"Non-mutable list should generate error message");
-    currentIterator->mutable = false;
-    if(psListAddBefore(currentIterator,data2)) {
-        psError(PS_ERR_UNKNOWN,true,"psListAddBefore should have generated error for non-mutable list add");
-        return 7;
-    }
-    currentIterator->mutable = true;
-
-    psFree(data1);
-    psFree(data2);
-    psFree(list);
-
-    return 0;
-}
-
-psS32 testListAdd(void)
-{
-    psList* list = NULL;
-    psS32* data = NULL;
-
-    psLogMsg(__func__,PS_LOG_INFO,"psListAdd shall add an element to list");
-
-    /*
-        psListAdd(list,data,where) should be tested in the instance where:
-
-        1. list is NULL (error)
-        2. data is NULL (error, list should not grow)
-        3. where is PS_LIST_HEAD or PS_LIST_TAIL
-        4. where is not PS_LIST_* but <0
-        5. where is >0
-    */
-
-    data = psAlloc(sizeof(psS32));
-    *data = 1;
-
-    //  1. list is NULL (error)
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for using NULL list.");
-    if (psListAdd(NULL,PS_LIST_HEAD,data)) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd was given a NULL list, but returned a true/success.");
-        return 1;
-    }
-
-    list = psListAlloc(data);
-    psFree(data);
-    if (list->n != 1) {
-        psError(PS_ERR_UNKNOWN, true,"psListAlloc didn't create a list properly.");
-        return 2;
-    }
-
-    //  2. data is NULL (error, list should not grow)
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error msg to add NULL data");
-    if (psListAdd(list, PS_LIST_HEAD,NULL)) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd successfully added a NULL data item?");
-        return 40;
-    }
-    if ( list->n != 1) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd with a NULL data element changed the list size or returned success.");
-        return 3;
-    }
-
-    //  3. where is PS_LIST_HEAD or PS_LIST_TAIL
-    data = psAlloc(sizeof(psS32));
-    *data = 2;
-    if ( ! psListAdd(list,PS_LIST_HEAD,data) ) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add a data item to head.");
-        return 21;
-    }
-    // Test requirement SDR-175
-    if (psMemGetRefCounter(data) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count.");
-        return 20;
-    }
-    psFree(data);
-
-    // verify that the size incremented
-    if (list->n != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by one");
-        return 4;
-    }
-
-    // verify that the head is the inserted data item
-    if (*(psS32*)list->head->data != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd with PS_LIST_HEAD didn't insert at the head.");
-        return 5;
-    }
-
-    data = psAlloc(sizeof(psS32));
-    *data = 3;
-    if ( ! psListAdd(list,PS_LIST_TAIL,data) ) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add a data item to tail.");
-        return 21;
-    }
-    // Test requirement SDR-175
-    if (psMemGetRefCounter(data) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count.");
-        return 22;
-    }
-    psFree(data);
-    // verify that the size incremented
-    if (list->n != 3) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the size by 1");
-        return 6;
-    }
-
-    // verify that the head is still the same
-    if (*(psS32*)list->head->data != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd with PS_LIST_TAIL modified the head.");
-        return 7;
-    }
-
-    // verify that the tail is the data item inserted
-    if (*(psS32*)list->tail->data != 3) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd with PS_LIST_TAIL didn't insert at the tail.");
-        return 8;
-    }
-
-    // 4. where is not PS_LIST_* but <0
-
-    data = psAlloc(sizeof(psS32));
-    *data = 4;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should error with invalid insert location");
-
-    if ( psListAdd(list,-10,data) ) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd successfully added data to a -10 position?");
-        return 30;
-    }
-    // Test requirement SDR-175
-    if (psMemGetRefCounter(data) != 1) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd incremented the data reference count.");
-        return 24;
-    }
-    psFree(data);
-    // verify that the size wasn't incremented
-    if (list->n != 3) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to head when where was invalid.");
-        return 9;
-    }
-
-    // 5. where is >0
-    data = psAlloc(sizeof(psS32));
-    *data = 5;
-
-    if ( ! psListAdd(list,1,data) ) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to 1 position.");
-        return 30;
-    }
-    // Test requirement SDR-175
-    if (psMemGetRefCounter(data) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count.");
-        return 25;
-    }
-    psFree(data);
-    // verify that the size incremented
-    if (list->n != 4 || *(psS32*)list->head->next->data != 5) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #1.");
-        return 10;
-    }
-
-    data = psAlloc(sizeof(psS32));
-    *data = 6;
-    if ( ! psListAdd(list,3,data) ) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to 4 position.");
-        return 31;
-    }
-    // Test requirment SDR-175
-    if (psMemGetRefCounter(data) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count.");
-        return 26;
-    }
-    psFree(data);
-    // verify that the size incremented
-    if (list->n != 5  || *(psS32 *)list->head->next->next->next->data != 6) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #4.");
-        return 50;
-    }
-
-    data = psAlloc(sizeof(psS32));
-    *data = 7;
-    // Test requirment SDR-169
-    if ( ! psListAdd(list,-2,data) ) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to 2 position.");
-        return 32;
-    }
-
-    // Test requirment SDR-175
-    if (psMemGetRefCounter(data) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count.");
-        return 28;
-    }
-    psFree(data);
-    // verify that the size incremented
-    if (list->n != 6  || *(psS32 *)list->tail->prev->prev->data != 7) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't insert to position #2.");
-        return 11;
-    }
-
-    // Test requirement SDR-757
-    data = psAlloc(sizeof(psS32));
-    *data = 8;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be a warning.");
-
-    if ( ! psListAdd(list,9,data) ) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd failed to add data to a 9 position?");
-        return 30;
-    }
-    // Test requirment SDR-175
-    if (psMemGetRefCounter(data) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListAdd didn't increment the data reference count.");
-        return 29;
-    }
-    if(list->n != 7 || *(psS32 *)list->tail->data != 8) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN,true,"psListAdd didn't place added item at tail.");
-        return 12;
-    }
-
-    psFree(data);
-
-    psFree(list);
-
-    return 0;
-}
-
-void printListInt(psList* list)
-{
-    psS32* data = NULL;
-    psBool first = true;
-
-    psListIterator* iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
-
-    while ( (data=(psS32*)psListGetAndIncrement(iter)) != NULL ) {
-        if (!first) {
-            printf(", %d",*(psS32*)data);
-        } else {
-            printf("%d",*(psS32*)data);
-            first = false;
-        }
-    }
-
-    printf(".\n");
-}
-
-
-psS32 testListGet(void)
-{
-    psList* list = NULL;
-    psS32* data;
-
-    /*
-     psListGet(list,which) shall be tested with the following instances
-
-        1. list is NULL.
-        2. which>0 and which<list.n.
-        3. which>list.n.
-        4. which=PS_LIST_HEAD
-        5. which=PS_LIST_NEXT
-        6. which=PS_LIST_TAIL
-        7. which=PS_LIST_PREV
-        8. which<0 and not any PS_LIST_* values
-    */
-
-    //  1. list is NULL.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error");
-    if (psListGet(list,PS_LIST_HEAD) != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psListGet didn't return NULL given a NULL list.");
-        return 1;
-    };
-
-    // create a list
-    data = psAlloc(sizeof(psS32));
-    *data = 0;
-    list = psListAlloc(data);
-    psFree(data);
-
-    data = psAlloc(sizeof(psS32));
-    *data = 1;
-    psListAdd(list,PS_LIST_TAIL,data);
-    psFree(data);
-
-    data = psAlloc(sizeof(psS32));
-    *data = 2;
-    psListAdd(list,PS_LIST_TAIL,data);
-    psFree(data);
-
-    data = psAlloc(sizeof(psS32));
-    *data = 3;
-    psListAdd(list,PS_LIST_TAIL,data);
-    psFree(data);
-
-    //  2. which>0 and which<list.n.
-    data = (psS32*)psListGet(list,3);
-    if (data == NULL || *data != 3) {
-        psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=3");
-        return 2;
-    }
-    data = (psS32*)psListGet(list,1);
-    if (data == NULL || *data != 1) {
-        psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=1");
-        return 3;
-    }
-
-    //  3. which>=list.n.
-    data = (psS32*)psListGet(list,5);
-    if (data != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=5");
-        return 4;
-    }
-    data = (psS32*)psListGet(list,4);
-    if (data != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=4");
-        return 5;
-    }
-
-    //  4. which=PS_LIST_HEAD
-    data = (psS32*)psListGet(list,PS_LIST_HEAD);
-    if (data == NULL || *data != 0) {
-        psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=PS_LIST_HEAD");
-        return 6;
-    }
-
-    //  6. which=PS_LIST_TAIL
-    data = (psS32*)psListGet(list,PS_LIST_TAIL);
-    if (data == NULL || *data != 3) {
-        psError(PS_ERR_UNKNOWN, true,"psListGet failed with which=PS_LIST_TAIL");
-        return 8;
-    }
-
-    data = (psS32*)psListGet(list,-2);
-    if (data == NULL || *data !=2) {
-        psError(PS_ERR_UNKNOWN,true,"psListGet failed with location=-2");
-        return 9;
-    }
-
-    psFree(list);
-
-    return 0;
-}
-
-psS32 testListRemove(void)
-{
-    psList* list = NULL;
-    psS32* data;
-    int items = 15;
-
-    /*
-        psListRemove(list,data,which) should be tested under the following conditions:
-
-        1. list is NULL
-        2. which is PS_LIST_HEAD (remove first element of list)
-        3. which is PS_LIST_TAIL (remove last element of list)
-        4. which is PS_LIST_NEXT (element right of cursor [which should be head,tail, and neither])
-        5. which is PS_LIST_PREV (element left of cursor [which should be head,tail, and neither])
-        6. which is PS_LIST_UNKNOWN and data=NULL (error)
-        7. which is PS_LIST_UNKNOWN and data=[head,tail,other list items]
-        8. which is PS_LIST_UNKNOWN and data!=NULL and data!=any element in list
-
-        In all conditions that are not an error, list.n shall be decremented and only the specified element
-        shall be removed. After each step, list.n should be checked to verify that it is the true
-        number of elements in list.
-    */
-
-    //  1. list is NULL.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should be an error");
-    if (psListRemove(list,PS_LIST_HEAD)) {
-        psError(PS_ERR_UNKNOWN, true,"psListRemove didn't return false given a NULL list.");
-        return 1;
-    };
-
-    // create a list
-    list = psListAlloc(NULL);
-
-    for (psS32 lcv=0;lcv<items;lcv++) {
-        data = psAlloc(sizeof(psS32));
-        *data = lcv;
-        psListAdd(list,PS_LIST_TAIL,data);
-        psMemDecrRefCounter(data);
-    }
-
-
-    // 2. which is PS_LIST_HEAD (remove first element of list)
-    psS32* data1 = (psS32 *)psListGet(list,PS_LIST_HEAD);
-    psMemIncrRefCounter(data1);
-    // Test requirement SDR-172, SDR-173
-    if ( (! psListRemove(list,PS_LIST_HEAD)) ||
-            (psListGet(list,PS_LIST_HEAD) == data) ) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_HEAD");
-        return 1;
-    }
-
-    if (list->n != --items) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
-        return 1;
-    }
-    // Test requirement SDR-176
-    if (psMemGetRefCounter(data1) != 1) {
-        psError(PS_ERR_UNKNOWN, true,"psListRemove didn't decrement the data reference count.");
-        return 20;
-    }
-    psMemDecrRefCounter(data1);
-
-    // 3. which is PS_LIST_TAIL (remove last element of list)
-    data = psListGet(list,PS_LIST_TAIL);
-    // Test requirement SDR-173
-    if ( (! psListRemove(list,PS_LIST_TAIL)) ||
-            (psListGet(list,PS_LIST_TAIL) == data) ) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_TAIL");
-        return 1;
-    }
-
-    if (list->n != --items) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
-        return 1;
-    }
-
-    data = psListGet(list,-2);
-    // Test requirement SDR-173
-    if ( (! psListRemove(list,-2)) ||
-            (psListGet(list,-2) == data) ) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Failed to remove from location -2");
-        return 11;
-    }
-
-    if (list->n != --items) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
-        return 1;
-    }
-
-    // 6. psListRemoveData where data=NULL (error)
-    psLogMsg(__func__,PS_LOG_INFO,"Next message should be an error");
-    if (psListRemoveData(list,NULL)) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"removed something for PS_LIST_UNKNOWN with data=NULL");
-        return 1;
-    }
-
-    // 7. which is PS_LIST_UNKNOWN and data=[head,tail,other list items]
-    data = psListGet(list,PS_LIST_HEAD);
-    // Test requirement SDR-762
-    if ( (! psListRemoveData(list,data)) ||
-            (psListGet(list,PS_LIST_HEAD) == data) ) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_UNKNOWN @ PS_LIST_HEAD");
-        return 1;
-    }
-
-    if (list->n != --items) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
-        return 1;
-    }
-
-    psS32* data2 = psListGet(list,PS_LIST_TAIL);
-    psMemIncrRefCounter(data2);
-    if ( (!psListRemoveData(list,data2)) ||
-            (psListGet(list,PS_LIST_TAIL) == data2) ) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Failed to remove PS_LIST_UNKNOWN @ PS_LIST_TAIL");
-        return 1;
-    }
-
-    if (list->n != --items) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
-        return 1;
-    }
-    // Test requirement SDR-176
-    if (psMemGetRefCounter(data2) != 1) {
-        psError(PS_ERR_UNKNOWN, true,"psListRemoveData didn't decrement the data reference count.");
-        return 20;
-    }
-    psMemDecrRefCounter(data2);
-
-    data = psListGet(list,1);
-    if ( (! psListRemoveData(list,data))||
-            (psListGet(list,1) == data) ) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Failed to remove data @ which=1");
-        return 1;
-    }
-
-    if (list->n != --items) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Didn't decrement size properly to %d.",items);
-        return 1;
-    }
-
-    // 8. data!=NULL and data!=any element in list
-    psLogMsg(__func__,PS_LOG_INFO,"Next message should be an error");
-    // Test requirement SDR-764
-    if ( psListRemoveData(list,data) ) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"removed something for PS_LIST_UNKNOWN with previously removed item");
-        return 1;
-    }
-
-    if (list->n != items) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"size not %d, as expected.",items);
-        return 1;
-    }
-
-    // clear out the list
-    while (items > 1) {
-        psListRemove(list,PS_LIST_HEAD);
-        items--;
-    }
-
-    data = psListGet(list,PS_LIST_HEAD);
-    if ( (! psListRemove(list,PS_LIST_HEAD)) ||
-            (psListGet(list,PS_LIST_HEAD) == data) ) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Failed to remove last element");
-        return 1;
-    }
-
-    if (list->n != 0) {
-        printListInt(list);
-        psError(PS_ERR_UNKNOWN, true,"Didn't remove all the elements.");
-        return 1;
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"NULL list in psListRemoveData should generate error message.");
-    if(psListRemoveData(NULL,data)) {
-        psError(PS_ERR_UNKNOWN,true,"psListRemoveData should have generated an error with NULL list");
-        return 2;
-    }
-
-    psFree(list);
-
-    return 0;
-
-}
-
-psS32 testListConvert(void)
-{
-
-    psList* list = NULL;
-    psArray* arr = NULL;
-    psS32* data;
-
-    /*
-        array=psListToArray(list) shall take each element of the list, increment
-        their reference, and insert them into the returned fresh psPtr array.
-        The list shall not be changed, except for the element reference increment.
-    */
-
-    // test dlist -> array
-
-    // create a list
-    list = psListAlloc(NULL);
-    for (psS32 lcv=0;lcv<15;lcv++) {
-        data = psAlloc(sizeof(psS32));
-        *data = lcv;
-        psListAdd(list,PS_LIST_TAIL,data);
-        psMemDecrRefCounter(data);
-    }
-
-    arr = psListToArray(list);
-
-    if (arr->n != 15 || list->n != 15) {
-        psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size");
-        return 1;
-    }
-    for (psS32 i=0;i<arr->n;i++) {
-        if (i != *(psS32*)arr->data[i]) {
-            psError(PS_ERR_UNKNOWN, true,"Element %d of array is incorrect (%d).",
-                    i,*(psS32*)arr->data[i]);
-            return 1;
-        }
-        if (i != *(psS32*)psListGet(list,i)) {
-            psError(PS_ERR_UNKNOWN, true,"Element %d of list is incorrect (%d).",
-                    i,*(psS32*)arr->data[i]);
-            return 1;
-        }
-        if (psMemGetRefCounter(arr->data[i]) != 2) {
-            psError(PS_ERR_UNKNOWN, true,"Element %d had wrong reference count (%ld).",
-                    i,psMemGetRefCounter(arr->data[i]));
-            return 1;
-        }
-    }
-
-    psFree(arr);
-    psFree(list);
-
-    // test array -> dlist
-
-    // create an array
-    arr = psArrayAlloc(15);
-    arr->n = arr->nalloc;
-    for (psS32 lcv=0;lcv<15;lcv++) {
-        data = psAlloc(sizeof(psS32));
-        *data = lcv;
-        arr->data[lcv] = data;
-    }
-
-    list = psArrayToList(arr);
-
-    if (arr->n != 15 || list->n != 15) {
-        psError(PS_ERR_UNKNOWN, true,"The created array didn't have the proper size");
-        return 1;
-    }
-    for (psS32 i=0;i<arr->n;i++) {
-        if (i != *(psS32*)arr->data[i]) {
-            psError(PS_ERR_UNKNOWN, true,"Element %d of array is incorrect (%d).",
-                    i,*(psS32*)arr->data[i]);
-            return 1;
-        }
-        if (i != *(psS32*)psListGet(list,i)) {
-            psError(PS_ERR_UNKNOWN, true,"Element %d of list is incorrect (%d).",
-                    i,*(psS32*)arr->data[i]);
-            return 1;
-        }
-        if (psMemGetRefCounter(arr->data[i]) != 2) {
-            psError(PS_ERR_UNKNOWN, true,"Element %d had wrong reference count (%ld).",
-                    i,psMemGetRefCounter(arr->data[i]));
-            return 1;
-        }
-    }
-
-    psFree(arr);
-    psFree(list);
-
-    // now, make sure if input array/list is NULL, output is NULL
-
-    arr = psListToArray(NULL);
-    if (arr != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psListToArray didn't return NULL when given NULL");
-        return 1;
-    }
-
-    list = psArrayToList(NULL);
-    if (list != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psArrayToList didn't return NULL when given NULL");
-        return 1;
-    }
-
-    // now, see what happens with a zero-size array/list
-    arr = psArrayAlloc(1);
-    arr->n = 0;
-    list = psArrayToList(arr);
-    if (list == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psArrayToList didn't create an empty list from an "
-                "empty array.");
-        return 1;
-    }
-    psFree(arr);
-    psFree(list);
-
-    list = psListAlloc(NULL);
-    arr = psListToArray(list);
-    if (arr == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psArrayToList didn't create an empty array from an "
-                "empty list.");
-        return 1;
-    }
-    psFree(arr);
-    psFree(list);
-
-    return 0;
-}
-
-psS32 testListIterator(void)
-{
-    psList* list = NULL;
-    psS32* data;
-
-    psLogMsg(__func__,PS_LOG_INFO," psListSetIterator/psListGetNext/psListGetPrev"
-             " shall move the list cursor to the specified location");
-
-    /*
-            psDlistSetIterator(list,where) shall:
-
-            1. output error message and do nothing if list=NULL
-            2. set list.cursor to list.head if where=PS_LIST_HEAD
-            3. set list.cursor to list.tail if where=PS_LIST_TAIL
-            4. set list.cursor to list.cursor->next if where=PS_LIST_NEXT
-            5. set list.cursor to list.cursor->prev if where=PS_LIST_PREV
-            6. leave list.cursor untouched if where=PS_LIST_UNKNOWN or PS_LIST_CURRENT
-
-            psDlistGetNext(list) shall be functionally equivalent to
-            psDlistSetIterator(list,PS_LIST_NEXT) but returns list.cursor.
-
-            psDlistGetPrev(list) shall be functionally equivalent to
-            psDlistSetIterator(list,PS_LIST_PREV) but returns list.cursor.
-    */
-
-    // create a list
-    list = psListAlloc(NULL);
-    for (psS32 lcv=0;lcv<15;lcv++) {
-        data = psAlloc(sizeof(psS32));
-        *data = lcv;
-        psListAdd(list,PS_LIST_TAIL,data);
-        psFree(data);
-    }
-
-    psListIterator* iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
-    if (iter == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"Failed to make an iterator.");
-        return 22;
-    }
-
-    // 1. output error message and do nothing if iterator=NULL
-    psListIteratorSet(NULL,PS_LIST_HEAD);
-    if (psListIteratorSet(NULL,PS_LIST_HEAD)) {
-        psError(PS_ERR_UNKNOWN, true,"Success while setting position of a NULL iterator?");
-        return 23;
-    }
-
-    // Attempt to get next with NULL iterator
-    if ( psListGetAndIncrement(NULL) != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL when NULL iterator specified");
-        return 24;
-    }
-
-    // Attempt to get previous with NULL iterator
-    if( psListGetAndDecrement(NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL when NULL iterator specified");
-        return 25;
-    }
-
-    // 3. set list.cursor to list.tail if where=PS_LIST_TAIL
-
-    if (!psListIteratorSet(iter,PS_LIST_TAIL) ||
-            *(psS32*)iter->cursor->data != 14 ||
-            iter->index != 14) {
-        psError(PS_ERR_UNKNOWN, true,"Didn't successfully move cursor to tail.");
-        return 1;
-    }
-
-    // 2. set list.cursor to list.head if where=PS_LIST_HEAD
-    if (!psListIteratorSet(iter,PS_LIST_HEAD) ||
-            *(psS32*)iter->cursor->data != 0 ||
-            iter->index != 0) {
-        psError(PS_ERR_UNKNOWN, true,"Didn't successfully move cursor to head.");
-        return 2;
-    }
-
-    // test psListGetPrevious/Next
-    if (*(psS32*)psListGetAndIncrement(iter) != 0) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetNext didn't move cursor to next.");
-        return 8;
-    }
-    if (*(psS32*)psListGetAndIncrement(iter) != 1) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetNext didn't move cursor to next.");
-        return 9;
-    }
-    if (*(psS32*)psListGetAndIncrement(iter) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetNext didn't move cursor to next.");
-        return 10;
-    }
-
-    if (*(psS32*)psListGetAndDecrement(iter) != 3) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetPrevious didn't move cursor to previous.");
-        return 11;
-    }
-    if (*(psS32*)psListGetAndDecrement(iter) != 2) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetPrevious didn't move cursor to previous.");
-        return 12;
-    }
-    if (*(psS32*)psListGetAndDecrement(iter) != 1) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetPrevious didn't move cursor to previous..");
-        return 13;
-    }
-    if (*(psS32*)psListGetAndDecrement(iter) != 0) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetPrevious didn't move cursor to previous..");
-        return 14;
-    }
-    if (psListGetAndDecrement(iter) != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetPrevious moved cursor beyond head.");
-        return 15;
-    }
-    if (psListGetAndIncrement(iter) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psListGetNext should return NULL when above head");
-        return 22;
-    }
-    if (*(psS32*)psListGetAndIncrement(iter) != 0 ) {
-        psError(PS_ERR_UNKNOWN,true,"psListGetNext didn't move cursor to next.");
-        return 23;
-    }
-
-    psListIteratorSet(iter,PS_LIST_TAIL); // works according to an above test
-    if (*(psS32*)psListGetAndIncrement(iter) != 14) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetNext moved cursor beyond tail.");
-        return 16;
-    }
-    if ((psListGetAndIncrement(iter) != NULL) || (!iter->offEnd)) {
-        psError(PS_ERR_UNKNOWN, true,"psListGetNext moved cursor beyond tail.");
-        return 17;
-    }
-    if(psListGetAndDecrement(iter) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psListGetPrevious did not return NULL when offEnd is true");
-        return 18;
-    }
-    if(iter->offEnd) {
-        psError(PS_ERR_UNKNOWN,true,"psListGetPrevious did not move back onto the list.");
-        return 19;
-    }
-    if(*(psS32*)psListGetAndDecrement(iter) != 14) {
-        psError(PS_ERR_UNKNOWN,true,"psListGetPrevious did not return correct value of tail.");
-        return 20;
-    }
-
-    psFree(list);
-
-    return 0;
-}
-
-psS32 testListFree(void)
-{
-    float* data[15];
-    psList* list;
-
-    /*
-    Call psDlistAlloc to create a doubly linked list.
-
-    Create several data items and add them to the list.
-
-    Verify the data item's reference counter are incremented after adding to the list.
-    (not really needed, as psListAdd is tested elsewhere)
-    */
-
-    list = psListAlloc(NULL);
-    for (psS32 lcv=0;lcv<15;lcv++) {
-        data[lcv] = psAlloc(sizeof(psS32));
-        *data[lcv] = lcv;
-        psListAdd(list,PS_LIST_TAIL,data[lcv]);
-        if (psMemGetRefCounter(data[lcv]) != 2) {
-            psError(PS_ERR_UNKNOWN, true,"Reference counter for data was not incremented");
-            return 1;
-        }
-    }
-
-    /*
-    Verify items are within the list.
-    (not needed, as psListAdd is tested elsewhere, but check anyway.)
-    */
-    if (list->n != 15) {
-        psError(PS_ERR_UNKNOWN, true,"List wasn't populated as expected?");
-        return 2;
-    }
-
-    /*
-    Call psDlistFree with NULL specified as the elemFree function.
-    */
-
-    psFree(list);
-
-    /*
-    Verify the list is deallocated but not the data items.
-    (accomplished by checking for memory leaks)
-
-    Verify the data item's reference counters are decremented by one compared to when added to the list.
-    (technically, this could be accomplished by checking memory leaks too, but I checked anyway)
-    */
-
-    for (psS32 i=0;i<15;i++) {
-        if (psMemGetRefCounter(data[i]) != 1) {
-            psError(PS_ERR_UNKNOWN, true,"pslistFree didn't decrement the data item's reference counter");
-            return 3;
-        }
-        psFree(data[i]);
-    }
-
-    return 0;
-}
-
-psS32 testListSort(void)
-{
-    psList* list;
-    psListIterator* iter;
-    float* fValue;
-    psU32* uValue;
-
-    list = psListAlloc(NULL);
-
-    for (psS32 lcv=0;lcv<15;lcv++) {
-        float* data = psAlloc(sizeof(psS32));
-        if (lcv < 7) {
-            *data = 13-lcv*2;
-        } else {
-            *data = lcv*2-12;
-        }
-        psListAdd(list,PS_LIST_TAIL,data);
-        psFree(data);
-
-    }
-
-    printf("original list = [");
-    iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
-    while( (fValue=psListGetAndIncrement(iter)) != NULL ) {
-        printf(" %.1f",*fValue);
-    }
-    printf(" ]\n");
-
-    list = psListSort(list,psCompareF32Ptr);
-
-    printf("sorted list = [");
-    psListIteratorSet(iter,PS_LIST_HEAD);
-    while( (fValue=psListGetAndIncrement(iter)) != NULL ) {
-        printf(" %.1f",*fValue);
-    }
-    printf(" ]\n");
-
-    psListIteratorSet(iter,PS_LIST_HEAD);
-    float* prevFValue = psListGetAndIncrement(iter);
-    while( (fValue=psListGetAndIncrement(iter)) != NULL ) {
-        if (*prevFValue > *fValue) {
-            psError(PS_ERR_UNKNOWN, true,"Hey, the list wasn't sorted!?");
-            return 1;
-        }
-    }
-
-    list = psListSort(list,psCompareDescendingF32Ptr);
-
-    printf("descending sort list = [");
-    psListIteratorSet(iter,PS_LIST_HEAD);
-    while( (fValue=psListGetAndIncrement(iter)) != NULL ) {
-        printf(" %.1f",*fValue);
-    }
-    printf(" ]\n");
-
-    psListIteratorSet(iter,PS_LIST_HEAD);
-    prevFValue = psListGetAndIncrement(iter);
-    while( (fValue=psListGetAndIncrement(iter)) != NULL ) {
-        if (*prevFValue < *fValue) {
-            psError(PS_ERR_UNKNOWN, true,"Hey, the list wasn't sorted!?");
-            return 2;
-        }
-    }
-
-    psFree(list);
-
-    /********** OK, now do the same thing with ints. *************/
-
-    list = psListAlloc(NULL);
-
-    for (psS32 lcv=0;lcv<15;lcv++) {
-        psU32* data = psAlloc(sizeof(psS32));
-        if (lcv < 7) {
-            *data = 13-lcv*2;
-        } else {
-            *data = lcv*2-12;
-        }
-        psListAdd(list,PS_LIST_TAIL,data);
-        psFree(data);
-
-    }
-
-    printf("original list = [");
-    iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
-    while( (uValue=psListGetAndIncrement(iter)) != NULL ) {
-        printf(" %d",*uValue);
-    }
-    printf(" ]\n");
-
-    list = psListSort(list,psCompareU32Ptr);
-
-    printf("sorted list = [");
-    psListIteratorSet(iter,PS_LIST_HEAD);
-    while( (uValue=psListGetAndIncrement(iter)) != NULL ) {
-        printf(" %d",*uValue);
-    }
-    printf(" ]\n");
-
-    psListIteratorSet(iter,PS_LIST_HEAD);
-    psU32* prevUValue = psListGetAndIncrement(iter);
-    while( (uValue=psListGetAndIncrement(iter)) != NULL ) {
-        if (*prevUValue > *uValue) {
-            psError(PS_ERR_UNKNOWN, true,"Hey, the list wasn't sorted!?");
-            return 3;
-        }
-    }
-
-    list = psListSort(list,psCompareDescendingU32Ptr);
-
-    printf("descending sort list = [");
-    psListIteratorSet(iter,PS_LIST_HEAD);
-    while( (uValue=psListGetAndIncrement(iter)) != NULL ) {
-        printf(" %d",*uValue);
-    }
-    printf(" ]\n");
-
-    psListIteratorSet(iter,PS_LIST_HEAD);
-    prevUValue = psListGetAndIncrement(iter);
-    while( (uValue=psListGetAndIncrement(iter)) != NULL ) {
-        if (*prevUValue < *uValue) {
-            psError(PS_ERR_UNKNOWN, true,"Hey, the list wasn't sorted!?");
-            return 4;
-        }
-    }
-
-    psFree(list);
-
-    return 0;
-}
-
-psS32 testListLength( void )
-{
-    psArray *temp = psArrayAlloc(5);
-    psList *list = psListAlloc(temp);
-
-    if (psListLength(list) != 1) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psListLength failed to return the correct length of list.\n");
-        return 1;
-    }
-    list->n = 5;
-    if (psListLength(list) != 5) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psListLength failed to return the correct length of list.\n");
-        return 2;
-    }
-    list->n++;
-    if (psListLength(list) != 6) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psListLength failed to return the correct length of list.\n");
-        return 3;
-    }
-    psFree(temp);
-    psFree(list);
-
-    psList *emptyList = NULL;
-    psVector *vector = psVectorAlloc(5, PS_TYPE_F32);
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psListLength(emptyList) != -1) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psListLength failed to return -1 for a NULL input list.\n");
-        return 4;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psListLength((psList*)vector) != -1) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psListLength failed to return -1 for an invalid input list.\n");
-        return 5;
-    }
-    psFree(vector);
-
-    return 0;
-}
-
Index: trunk/psLib/test/types/tst_psLookupTable_01.c
===================================================================
--- trunk/psLib/test/types/tst_psLookupTable_01.c	(revision 41166)
+++ 	(revision )
@@ -1,855 +1,0 @@
-/** @file  tst_psLookupTable_01.c
-*
-*  @brief Test driver for psLookupTable functions
-*
-*  This test driver contains the following tests for psLookupTable functions:
-*     testLookupAlloc - test allocation and freeing of psLookupTable
-*     testLookupRead - test different files and types within files
-*                      being read correctly and some failure cases
-*     testLookupTableInterpolate - test the interpolation function
-*     testLookupTableInterpolateAll - test interpolation of all row values
-*
-*  @author  Ross Harman, MHPCC
-*
-*  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2006-06-13 23:55:34 $
-*
-*  Copyright 2004-5 Maui High Performance Computing Center, University of Hawaii
-*
-*/
-
-#include "pslib_strict.h"
-#include "psTest.h"
-#include <string.h>
-
-static psS32 testLookupTableAlloc(void);
-static psS32 testVectorsReadFromFile(void);
-static psS32 testLookupTableImport(void);
-static psS32 testLookupTableRead(void);
-static psS32 testLookupTableInterpolate(void);
-static psS32 testLookupTableInterpolateAll(void);
-
-const psF64 errorTol_psF64 = 1.0e-4;
-const psF64 tableU8_validFrom = 0;
-const psF64 tableU8_validTo = 3;
-const psS32 tableU8_size = 4;
-const char tableU8_format[] = "\%d \%d \%d \%ld \%d \%d \%d \%ld \%f \%lf";
-const char tableU8_filename[] = VERIFIED_DIR "/tableU8.dat";
-const psS32 tableU8_indexCol = 0;
-const psS32 tableU8_index[] =
-    {
-        0,   1,    2,   3
-    };
-const psU16 tableU8_val1[]  =
-    {
-        2,   4,    6,   8
-    };
-const psU32 tableU8_val2[]  =
-    {
-        4,   8,   12,  16
-    };
-const psU64 tableU8_val3[]  =
-    {
-        8,  16,   24,  32
-    };
-const psS8  tableU8_val4[]  =
-    {
-        0,  -1,   -2,  -3
-    };
-const psS16 tableU8_val5[]  =
-    {
-        -2,  -4,   -6,  -8
-    };
-const psS32 tableU8_val6[]  =
-    {
-        -4,  -8,  -12, -16
-    };
-const psS64 tableU8_val7[]  =
-    {
-        -8, -16,  -24, -32
-    };
-const psF32 tableU8_val8[]  =
-    {
-        -0.5, 0.0,  0.5,0.75
-    };
-const psF64 tableU8_val9[]  =
-    {
-        -1.5,-1.0,-0.25,1.75
-    };
-
-const psF64 tableF32_validFrom = -10.05;
-const psF64 tableF32_validTo = 3500.67;
-const psS32 tableF32_size = 4;
-const psS32 tableF32_cols = 9;
-const char tableF32_filename[] = VERIFIED_DIR "/tableF32.dat";
-const char tableF32_format[] = "\%f \%d \%d \%ld \%d \%d \%d \%ld \%d \%lf";
-const char tableF32_indexCol = 0;
-const psElemType tableF32_colType[] =
-    {
-        PS_TYPE_F32, PS_TYPE_S32, PS_TYPE_S32, PS_TYPE_S64,
-        PS_TYPE_S32, PS_TYPE_S32, PS_TYPE_S32, PS_TYPE_S64,
-        PS_TYPE_F64
-    };
-const psF32 tableF32_index[] =
-    {
-        -10.05,1.009,23.45,3500.67
-    };
-const psS32 tableF32_col1[] =
-    {
-        2, 4, 6, 8
-    };
-const psS32 tableF32_col2[] =
-    {
-        4, 8, 12, 16
-    };
-const psS64 tableF32_col3[] =
-    {
-        8, 16, 24, 32
-    };
-const psS32 tableF32_col4[] =
-    {
-        0, -1, -2, -3
-    };
-const psS32 tableF32_col5[] =
-    {
-        -2, -4, -6, -8
-    };
-const psS32 tableF32_col6[] =
-    {
-        -4, -8, -12, -16
-    };
-const psS64 tableF32_col7[] =
-    {
-        -8, -16, -24, -32
-    };
-const psF64 tableF32_col8[] =
-    {
-        -1.5, -1.0, -0.25, 1.75
-    };
-
-
-const psF64 table10_validFrom = 1;
-const psF64 table10_validTo   = 10;
-const psS32 table10_size      = 10;
-const char table10_format[] = "\%d \%d \%d \%ld \%d \%d \%d \%ld \%f \%lf";
-const char table10_filename[] = VERIFIED_DIR "/table10.dat";
-const psS32 table10_indexCol = 0;
-const psS32  table10_index[]   =
-    {
-        1,   2,    3,   4,    5,    6,    7,    8,   9,    10
-    };
-const psS32 table10_val1[]    =
-    {
-        4,   6,    8,  10,   12,   14,   16,   18,   20,   22
-    };
-const psS32 table10_val2[]    =
-    {
-        8,  12,   16,  20,   24,   28,   32,   36,   40,   44
-    };
-const psS64 table10_val3[]    =
-    {
-        16,  24,   32,  64,  128,  256,  512, 1024, 2048, 4096
-    };
-const psS32  table10_val4[]    =
-    {
-        -1,  -2,   -3,  -4,   -5,   -6,   -7,   -8,   -9,  -10
-    };
-const psS32 table10_val5[]    =
-    {
-        -4,  -6,   -8, -10,  -12,  -14,  -16,  -18,  -20,  -22
-    };
-const psS32 table10_val6[]    =
-    {
-        -8, -12,  -16, -20,  -24,  -28,  -32,  -36,  -40,  -44
-    };
-const psS64 table10_val7[]    =
-    {
-        -16, -24,  -32, -64, -128, -256, -512,-1024,-2048,-4096
-    };
-const psF32 table10_val8[]    =
-    {
-        -2.25,-1.5,-0.75, 0.0, 0.75, 1.50, 2.25, 3.00, 3.75, 4.50
-    };
-const psF64 table10_val9[]    =
-    {
-        -2.67,0.66, 3.99,7.32,10.65,13.98,17.31,20.64,23.97,27.30
-    };
-const psF64 interpolVal1[]    =
-    {
-        5.25, 12.5, 25, 160, -5.25, -12.5, -25, -160, 0.9375, 11.4825
-    };
-const psF64 interpolVal2[]    =
-    {
-        5, 12, 24, 128, -5, -12, -24, -128, 0.75, 10.65
-    };
-const psF64 interpolVal3[]    =
-    {
-        4, 8, 16, -1, -4, -8, -16, -2.25, -2.67
-    };
-
-testDescription tests[] = {
-                              {testLookupTableAlloc,817,"psLookupTableAlloc",0,false},
-                              {testVectorsReadFromFile,999,"psVectorsReadFromFile",0,false},
-                              {testLookupTableImport,666,"psLookupTableImport",0,false},
-                              {testLookupTableRead,998,"psLookupTableRead",0,false},
-                              {testLookupTableInterpolate,997,"psLookupTableInterpolate",0,false},
-                              {testLookupTableInterpolateAll,996,"psLookupTableInterpolateAll",0,false},
-                              {NULL}
-                          };
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    if ( ! runTestSuite(stderr,"psLookupTable",tests,argc,argv)) {
-        return 1;
-    }
-    return 0;
-}
-
-psS32 testLookupTableAlloc(void)
-{
-    psLookupTable*  table1 = NULL;
-
-    // Allocate lookup table with valid parameters
-    table1 = psLookupTableAlloc("tableF32.dat","\%f \%lf \%d \%ld",10);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Null lookup table generated from valid parameters");
-        return 1;
-    }
-    if(strcmp(table1->filename,"tableF32.dat") != 0) {
-        psError(PS_ERR_UNKNOWN,true,"File name not properly stored in psLookupTable structure.");
-        return 2;
-    }
-    if(strcmp(table1->format,"\%f \%lf \%d \%ld") != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Format string not properly storeed in psLookupTable structure.");
-        return 3;
-    }
-    if(table1->indexCol != 10) {
-        psError(PS_ERR_UNKNOWN,true,"Member indexCol not set properly");
-        return 3;
-    }
-    psFree(table1);
-
-    // Allocate lookup table with invalid filename
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid file name");
-    table1 = psLookupTableAlloc(NULL,"\%d",3);
-    if(table1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Null file name accepted by psLookupTableAlloc");
-        return 4;
-    }
-
-    // Allocate lookup table with invalid format
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid format string");
-    table1 = psLookupTableAlloc("tableF32.dat",NULL,3);
-    if(table1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Null format string accepted by psLookupTableAlloc");
-        return 5;
-    }
-
-    return 0;
-}
-
-psS32 testVectorsReadFromFile(void)
-{
-    psArray*   out        = NULL;
-    psVector*  tempVector = NULL;
-
-    // Read file and place into an array of vectors
-    out = psVectorsReadFromFile(VERIFIED_DIR "/tableF32.dat","\%f \%d \%d \%ld \%d \%d \%d \%ld \%*d \%lf");
-    if(out == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to read file into array of vectors");
-        return 1;
-    }
-    // Verify the number of vectors in array is as expected
-    if(out->n != tableF32_cols) {
-        psError(PS_ERR_UNKNOWN,true,"Expected number of columns = %d not equal to actual = %d",
-                tableF32_cols, out->n);
-        return 2;
-    }
-    // Verify the number of entries in vectors is as expected
-    for(int i = 0; i < out->n; i++ ) {
-        tempVector = out->data[i];
-        if(tempVector->n != tableF32_size) {
-            psError(PS_ERR_UNKNOWN,true,"Col #%d Expected number of entries = %d  not equal to actual = %d",
-                    i,tableF32_size,tempVector->n);
-            return 3;
-        }
-    }
-    // Verify the vector types are as expected
-    for(int i = 0; i < out->n; i++) {
-        tempVector = out->data[i];
-        if(tempVector->type.type != tableF32_colType[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #%d Expected type = %d not equal to actual = %d",
-                    i,tableF32_colType[i],tempVector->type.type);
-            return 4;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[0];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.F32[i] != tableF32_index[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #0 Vector element[%d] expected = %f not equal to actual = %f",
-                    i, tableF32_index[i],tempVector->data.F32[i]);
-            return 5 + i;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[1];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col1[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #1 Vector element[%d] expected = %d not equal to actual = %d",
-                    i, tableF32_col1[i],tempVector->data.S32[i]);
-            return 10 + i;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[2];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col2[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #2 Vector element[%d] expected = %d not equal to actual = %d",
-                    i, tableF32_col2[i],tempVector->data.S32[i]);
-            return 15 + i;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[3];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S64[i] != tableF32_col3[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #3 Vector element[%d] expected = %ld not equal to actual = %ld",
-                    i, tableF32_col3[i],tempVector->data.S64[i]);
-            return 20 + i;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[4];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col4[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #4 Vector element[%d] expected = %d not equal to actual = %d",
-                    i, tableF32_col4[i],tempVector->data.S32[i]);
-            return 25 + i;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[5];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col5[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #5 Vector element[%d] expected = %d not equal to actual = %d",
-                    i, tableF32_col5[i],tempVector->data.S32[i]);
-            return 30 + i;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[6];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col6[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #6 Vector element[%d] expected = %d not equal to actual = %d",
-                    i, tableF32_col6[i],tempVector->data.S32[i]);
-            return 35 + i;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[7];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S64[i] != tableF32_col7[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #7 Vector element[%d] expected = %ld not equal to actual = %ld",
-                    i, tableF32_col7[i],tempVector->data.S64[i]);
-            return 40 + i;
-        }
-    }
-    // Verify the values in the vectors are as expected
-    tempVector = out->data[8];
-    for(int i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.F64[i] != tableF32_col8[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Col #8 Vector element[%d] expected = %lf not equal to actual = %lf",
-                    i, tableF32_col8[i],tempVector->data.F64[i]);
-            return 45 + i;
-        }
-    }
-    psFree(out);
-
-    // Attempt to read vectors from valid file with invalid format
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL format");
-    out = psVectorsReadFromFile(VERIFIED_DIR "/tableF32.dat",NULL);
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with NULL format string");
-        return 50;
-    }
-
-    // Attempt to read vectors from invalid file with valid format
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL filename");
-    out = psVectorsReadFromFile(NULL,"%f %f");
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with NULL file name");
-        return 51;
-    }
-
-    // Attempt to read vectors from valid file with invalid format specifiers
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid format specifier");
-    out = psVectorsReadFromFile(VERIFIED_DIR "/tableF32.data","\%f \%c \%d");
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid format specifier");
-        return 52;
-    }
-
-    // Attempt to read vectors from non-existant file
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for non-existant file");
-    out = psVectorsReadFromFile("nonexistant.dat","\%f \%d \%d");
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with non-existant file");
-        return 53;
-    }
-
-    // Attempt to read vectors from file with errors in the numbers
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for error is file");
-    out = psVectorsReadFromFile(VERIFIED_DIR "/tableF32_err.dat","\%f \%d \%d \%ld \%d \%d \%d \%ld \%d \%lf");
-    if(out != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with file with errors");
-        return 54;
-    }
-
-    return 0;
-}
-
-psS32 testLookupTableImport(void)
-{
-    psLookupTable*  outTable = NULL;
-    psLookupTable*  inTable  = NULL;
-    psArray*        vectors  = NULL;
-
-    // Attempt to import table with NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL table argument");
-    outTable = psLookupTableImport(NULL,vectors,1);
-    if(outTable != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with NULL input table");
-        return 1;
-    }
-
-    // Allocate valid table, format string and index column
-    inTable = psLookupTableAlloc(table10_filename,table10_format,table10_indexCol);
-
-    // Attempt to import table with NULL vector argument
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL vectors");
-    outTable = psLookupTableImport(inTable,vectors,table10_indexCol);
-    if(outTable != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with NULL input vectors");
-        return 2;
-    }
-
-    // Allocate valid array
-    vectors = psArrayAlloc(10);
-
-    // Attempt to import table with invalid index column
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid index column");
-    outTable = psLookupTableImport(inTable,vectors,-1);
-    if(outTable != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid index column specified");
-        return 3;
-    }
-    psFree(vectors);
-
-    // Attempt to import file with file with unsorted index vector
-    // Read vectors from file
-    vectors = psVectorsReadFromFile(table10_filename,table10_format);
-    outTable = psLookupTableImport(inTable,vectors,table10_indexCol);
-    if(outTable != inTable) {
-        psError(PS_ERR_UNKNOWN,true,"Did not set proper return value");
-        return 4;
-    }
-    // Verify the index column vector
-    psVector* indexVector = outTable->index;
-    for(int i = 0; i < indexVector->n; i++) {
-        if(indexVector->data.S32[i] != table10_index[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Index value[%d] = %d is not as expected %d",
-                    i,indexVector->data.S32[i],table10_index[i]);
-            return i*4;
-        }
-    }
-    // Verify the value array vectors
-    psVector* valueVector = outTable->values->data[1];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.S32[i] != table10_val1[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %d is not as expected %d",
-                    i,valueVector->data.S32[i],table10_val1[i]);
-            return i*5;
-        }
-    }
-    valueVector = outTable->values->data[2];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.S32[i] != table10_val2[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %d is not as expected %d",
-                    i,valueVector->data.S32[i],table10_val2[i]);
-            return i*6;
-        }
-    }
-    valueVector = outTable->values->data[3];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.S64[i] != table10_val3[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %ld is not as expected %ld",
-                    i,valueVector->data.S64[i],table10_val3[i]);
-            return i*7;
-        }
-    }
-    valueVector = outTable->values->data[4];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.S32[i] != table10_val4[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %d is not as expected %d",
-                    i,valueVector->data.S32[i],table10_val4[i]);
-            return i*8;
-        }
-    }
-    valueVector = outTable->values->data[5];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.S32[i] != table10_val5[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %d is not as expected %d",
-                    i,valueVector->data.S32[i],table10_val5[i]);
-            return i*9;
-        }
-    }
-    valueVector = outTable->values->data[6];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.S32[i] != table10_val6[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %d is not as expected %d",
-                    i,valueVector->data.S32[i],table10_val6[i]);
-            return i*10;
-        }
-    }
-    valueVector = outTable->values->data[7];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.S64[i] != table10_val7[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %ld is not as expected %ld",
-                    i,valueVector->data.S64[i],table10_val7[i]);
-            return i*11;
-        }
-    }
-    valueVector = outTable->values->data[8];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.F32[i] != table10_val8[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %f is not as expected %f",
-                    i,valueVector->data.F32[i],table10_val8[i]);
-            return i*12;
-        }
-    }
-    valueVector = outTable->values->data[9];
-    for(int i = 0; i < valueVector->n; i++) {
-        if(valueVector->data.F64[i] != table10_val9[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value [%d] = %lf is not as expected %lf",
-                    i,valueVector->data.F64[i],table10_val9[i]);
-            return i*13;
-        }
-    }
-    // Verify the table members are set properly
-    if(outTable->indexCol != table10_indexCol) {
-        psError(PS_ERR_UNKNOWN,true,"Member indexCol = %d not as expected %d",
-                outTable->indexCol,table10_indexCol);
-        return 100;
-    }
-    if(outTable->validFrom != table10_validFrom) {
-        psError(PS_ERR_UNKNOWN,true,"Member validFrom = %d not as expected %d",
-                outTable->validFrom, table10_validFrom);
-        return 101;
-    }
-    if(outTable->validTo != table10_validTo) {
-        psError(PS_ERR_UNKNOWN,true,"Member validTo = %d not as expected %d",
-                outTable->validTo, table10_validTo);
-        return 102;
-    }
-    if(strcmp(outTable->filename,table10_filename) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Member filename = %d not as expected %s",
-                outTable->filename,table10_filename);
-        return 103;
-    }
-    if(strcmp(outTable->format,table10_format) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Member format = %d not as expected %s",
-                outTable->format,table10_format);
-        return 104;
-    }
-    psFree(vectors);
-    psFree(inTable);
-
-    // Attempt to import file with file with sorted index vector
-    // Read vectors from file
-    // Allocate valid table, format string and index column
-    inTable = psLookupTableAlloc(tableU8_filename,tableU8_format,tableU8_indexCol);
-    vectors = psVectorsReadFromFile(tableU8_filename,tableU8_format);
-    outTable = psLookupTableImport(inTable,vectors,tableU8_indexCol);
-    if(outTable != inTable) {
-        psError(PS_ERR_UNKNOWN,true,"Did not set proper return value");
-        return 4;
-    }
-    // Verify the index column vector
-    indexVector = outTable->index;
-    for(int i = 0; i < indexVector->n; i++) {
-        if(indexVector->data.S32[i] != tableU8_index[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Index value[%d] = %d is not as expected %d",
-                    i,indexVector->data.S32[i],tableU8_index[i]);
-        }
-    }
-    // Verify the table members are set properly
-    if(outTable->indexCol != tableU8_indexCol) {
-        psError(PS_ERR_UNKNOWN,true,"Member indexCol = %d not as expected %d",
-                outTable->indexCol,tableU8_indexCol);
-        return 100;
-    }
-    if(outTable->validFrom != tableU8_validFrom) {
-        psError(PS_ERR_UNKNOWN,true,"Member validFrom = %d not as expected %d",
-                outTable->validFrom, tableU8_validFrom);
-        return 101;
-    }
-    if(outTable->validTo != tableU8_validTo) {
-        psError(PS_ERR_UNKNOWN,true,"Member validTo = %d not as expected %d",
-                outTable->validTo, tableU8_validTo);
-        return 102;
-    }
-    if(strcmp(outTable->filename,tableU8_filename) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Member filename = %d not as expected %s",
-                outTable->filename,tableU8_filename);
-        return 103;
-    }
-    if(strcmp(outTable->format,tableU8_format) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Member format = %d not as expected %s",
-                outTable->format,tableU8_format);
-        return 104;
-    }
-    psFree(inTable);
-    psFree(vectors);
-
-    return 0;
-}
-
-psS32 testLookupTableRead(void)
-{
-    psLookupTable*  table1  = NULL;
-    long           numRows = 0;
-
-    // Attempt to read table with NULL input table specified
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL table");
-    numRows = psLookupTableRead(table1);
-    if(numRows != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return zero for NULL input table");
-        return 1;
-    }
-
-    // Set up valid table to read
-    table1 = psLookupTableAlloc(tableF32_filename,tableF32_format,tableF32_indexCol);
-    // Read table
-    numRows = psLookupTableRead(table1);
-    // Verify return value equals number of lines read
-    if(numRows != tableF32_size) {
-        psError(PS_ERR_UNKNOWN,true,"Return value %d not as expected %d",
-                numRows,tableF32_size);
-        return 1;
-    }
-    // Verify the members and values in table
-    if(fabs(table1->validFrom - tableF32_validFrom) > errorTol_psF64) {
-        psError(PS_ERR_UNKNOWN,true,"Member validFrom = %f not as expected %f",
-                table1->validFrom,tableF32_validFrom);
-        return 2;
-    }
-    if(fabs(table1->validTo - tableF32_validTo) > errorTol_psF64) {
-        psError(PS_ERR_UNKNOWN,true,"Member validTo = %f not as expected %f",
-                table1->validTo,tableF32_validTo);
-        return 3;
-    }
-    if(strcmp(table1->filename,tableF32_filename) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Member filename %s not as expected %s",
-                table1->filename,tableF32_filename);
-        return 4;
-    }
-    if(strcmp(table1->format,tableF32_format) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Member format %s not as expected %s",
-                table1->format,tableF32_format);
-        return 5;
-    }
-    if(table1->indexCol != tableF32_indexCol) {
-        psError(PS_ERR_UNKNOWN,true,"Member indexCol %d not as expected %d",
-                table1->indexCol,tableF32_indexCol);
-        return 6;
-    }
-    for(psS32 i = 0; i < table1->index->n; i++) {
-        if(fabs(table1->index->data.F32[i]-tableF32_index[i]) > errorTol_psF64) {
-            psError(PS_ERR_UNKNOWN,true,"Index column[%d] = %f not as expected %f",
-                    i,table1->index->data.F32[i],tableF32_index[i]);
-            return i*7;
-        }
-    }
-    psVector* tempVector = table1->values->data[1];
-    for(psS32 i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col1[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value column[%d] = %d not as expected %d",
-                    i,tempVector->data.S32[i],tableF32_col1[i]);
-            return i*8;
-        }
-    }
-    tempVector = table1->values->data[2];
-    for(psS32 i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col2[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value column[%d] = %d not as expected %d",
-                    i,tempVector->data.S32[i],tableF32_col2[i]);
-            return i*9;
-        }
-    }
-    tempVector = table1->values->data[3];
-    for(psS32 i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S64[i] != tableF32_col3[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value column[%d] = %ld not as expected %ld",
-                    i,tempVector->data.S64[i],tableF32_col3[i]);
-            return i*10;
-        }
-    }
-    tempVector = table1->values->data[4];
-    for(psS32 i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col4[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value column[%d] = %d not as expected %d",
-                    i,tempVector->data.S32[i],tableF32_col4[i]);
-            return i*11;
-        }
-    }
-    tempVector = table1->values->data[5];
-    for(psS32 i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col5[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value column[%d] = %d not as expected %d",
-                    i,tempVector->data.S32[i],tableF32_col5[i]);
-            return i*12;
-        }
-    }
-    tempVector = table1->values->data[6];
-    for(psS32 i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S32[i] != tableF32_col6[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value column[%d] = %d not as expected %d",
-                    i,tempVector->data.S32[i],tableF32_col6[i]);
-            return i*13;
-        }
-    }
-    tempVector = table1->values->data[7];
-    for(psS32 i = 0; i < tempVector->n; i++) {
-        if(tempVector->data.S64[i] != tableF32_col7[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value column[%d] = %ld not as expected %ld",
-                    i,tempVector->data.S64[i],tableF32_col7[i]);
-            return i*14;
-        }
-    }
-    psFree(table1);
-
-    // Set up invalid table to read
-    table1 = psLookupTableAlloc(tableF32_filename,tableF32_format,tableF32_indexCol);
-    table1->indexCol = -1;
-    // Read invalid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message invalid table indexCol");
-    numRows = psLookupTableRead(table1);
-    // Verify the num of rows read is zero
-    if(numRows != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return 0 for line read for invalid table");
-        return 15;
-    }
-    psFree(table1);
-
-    return 0;
-}
-
-psS32 testLookupTableInterpolate(void)
-{
-    psLookupTable*  table1 = NULL;
-    psF64            out1 = 0.0;
-
-    // Attempt to perform interpolation with NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid table");
-    out1 = psLookupTableInterpolate(table1,0,0);
-    if( !isnan(out1) ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NaN as expected");
-        return 1;
-    }
-
-    // Interpolate values within the list and verify return values
-    table1 = psLookupTableAlloc(table10_filename,table10_format,table10_indexCol);
-    psS32 numLines = psLookupTableRead(table1);
-    if(numLines != table10_size) {
-        psError(PS_ERR_UNKNOWN,true,"Line read %d not as expected %d",numLines,table10_size);
-        return 2;
-    }
-    for(psS32 i = 0; i < table1->values->n; i++ ) {
-        out1 = psLookupTableInterpolate(table1, 5.25, i);
-        if( fabs(out1-interpolVal1[i]) > errorTol_psF64) {
-            psError(PS_ERR_UNKNOWN,true,"Did not return expected value. %lg expected %lg",out1,interpolVal1[i]);
-            return 3*i;
-        }
-    }
-    for(psS32 i = 0; i < table1->values->n; i++ ) {
-        out1 = psLookupTableInterpolate(table1, 5.0, i);
-        if( fabs(out1-interpolVal2[i]) > errorTol_psF64) {
-            psError(PS_ERR_UNKNOWN,true,"Did not return expected value. %lg expected %lg",out1,interpolVal2[i]);
-            return 4*i;
-        }
-    }
-
-    // Interpolate value just below the lowest index value
-    out1 = psLookupTableInterpolate(table1,0,0);
-    if ( fabs(out1- NAN) > FLT_EPSILON ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN returned %lf",out1);
-        return 5;
-    }
-
-    // Interpolate value just above the highest index value
-    out1 = psLookupTableInterpolate(table1,11,0);
-    if ( fabs(out1-NAN) > FLT_EPSILON ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN returned %lf",out1);
-        return 7;
-    }
-
-    // Interpolate value with a column number greater than the table has
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error out of range.");
-    out1 = psLookupTableInterpolate(table1, 5, 100);
-    if ( fabs(out1-NAN) > FLT_EPSILON ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN returned %lf",out1);
-        return 9;
-    }
-    psFree(table1);
-
-    return 0;
-}
-
-psS32 testLookupTableInterpolateAll(void)
-{
-    psLookupTable*  table1 = NULL;
-    psVector*        interpValues;
-
-    // Interpolate values with NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL table");
-    interpValues = psLookupTableInterpolateAll(table1,5);
-    if(interpValues != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for NULL table");
-        return 5;
-    }
-
-    // Interpolate values within the list and verify return values
-    table1 = psLookupTableAlloc(table10_filename,table10_format,table10_indexCol);
-    psS32 numLines = psLookupTableRead(table1);
-    if(numLines != table10_size) {
-        psError(PS_ERR_UNKNOWN,true,"Num lines read %d not as expected %d",numLines,table10_size);
-        return 6;
-    }
-    interpValues = psLookupTableInterpolateAll(table1,5.25);
-    if(interpValues == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned vector is NULL.");
-        return 1;
-    }
-    for(psS32 i = 0; i < table1->values->n; i++ ) {
-        if( fabs(interpValues->data.F64[i]-interpolVal1[i]) > errorTol_psF64) {
-            psError(PS_ERR_UNKNOWN,true,"Did not return expected value. %lg expected %lg",
-                    interpValues->data.F64[i],interpolVal1[i]);
-            return 2*i;
-        }
-    }
-    psFree(interpValues);
-
-    // Interpolate values with index outside table
-    interpValues = psLookupTableInterpolateAll(table1,0);
-    if(interpValues != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did return NULL");
-        return 4;
-    }
-    psFree(table1);
-
-    return 0;
-}
-
Index: trunk/psLib/test/types/tst_psMetadataIO.c
===================================================================
--- trunk/psLib/test/types/tst_psMetadataIO.c	(revision 41166)
+++ 	(revision )
@@ -1,1021 +1,0 @@
-/** @file  tst_psMetadataIO.c
- *
- *  @brief Test driver for psMetadataIO functions
- *
- *  This test driver contains the following tests for psMetadata:
- *    Read config file with overwrite set true
- *    Read config file with overwrite set false
- *    Attempt to use null fileName argument
- *    Attempt to open nonexistant file
- *
- *  @author  Ross Harman, MHPCC
- *  @author  Robert DeSonia, MHPCC
- *  @author  Eric Van Alst, MHPCC
- *
- *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-06-07 01:39:17 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static psS32 testMetadataParseConfig(void);
-static psS32 testMetadataParseConfig1(void);
-static psS32 testMetadataParseConfig2(void);
-static psS32 testMetadataParseConfig3(void);
-static psS32 testMetadataParseConfig4(void);
-
-testDescription tests[] = {
-                              {testMetadataParseConfig,0,"psMetadataConfigParse",0,false},
-                              {testMetadataParseConfig1,1,"psMetadataConfigParse1",0,false},
-                              {testMetadataParseConfig2,2,"psMetadataConfigParse2",0,false},
-                              {testMetadataParseConfig3,3,"psMetadataConfigParse3",0,false},
-                              {testMetadataParseConfig4,4,"psMetadataConfigParse4",0,false},
-                              {NULL}
-                          };
-
-static void writeMetadataItem(psMetadataItem* metadataIem, char* indentStr);
-static void writeMetadata(psMetadata* metadata, char* indentStr);
-static void writeMetadataList(psList *metadataItemList, char* indentStr);
-
-static psBool checkFailedLines(psS32 failedLines, psS32 expectedFailedLines, char* configFile);
-static psBool checkNumberOfItems(psMetadata* md, psS32 expectedItems, char* configFile);
-static psBool checkItemName(psMetadataItem* mdItem, char* expectedName, char* configFile);
-static psBool checkItemType(psMetadataItem* mdItem, psS32 expectedType, char* configFile);
-static psBool checkItemComment(psMetadataItem* mdItem, char* expectedComment, char* configFile);
-
-#define ERROR_TOL  0.0001
-
-const char testConfig5[] = "test5.config";
-const psS32 testConfig5Fails = 7;
-
-const char testConfig4[] = "test4.config";
-const psS32 testConfig4Fails = 0;
-
-const char testConfig3[] = "test3.config";
-const psS32 testConfig3Fails = 1;
-
-const char testConfig2[] = "test2.config";
-const psS32 testConfig2Fails = 17;
-
-// SDR-14 test config file #1
-const char  testConfig1[] = "test1.config";
-const psS32 testConfig1FailsOverwrite = 0;
-const psS32 testConfig1Fails = 1;
-const psS32 testConfig1Items = 25;
-const char* testConfig1KeyOverwrite[] =
-    {
-        "Double","String","boolean","primes","comment",
-        "comment","comment","comment","comment","Float",
-        "boolean1","negprimes","vector1","vector2","vector3",
-        "vector4","vector5","vector6","vector7","vector8",
-        "CELL.00", "CELL.01","MYCELL","MYCELL","cell"
-    };
-const char* testConfig1CommentOverwrite[] =
-    {
-        "This is a comment","comment","The value of 'boolean' is 'true'","These are prime numbers",
-        "","","","","",
-        "This generates a warning, and, if 'overwrite' is 'false', is ignored","The value of 'boolean' is 'false'",
-        "","","","","",
-        "","","","",
-        "","","","A number",""
-    };
-const psDataType testConfig1TypeOverwrite[] =
-    {
-        PS_DATA_F64, PS_DATA_STRING, PS_DATA_BOOL, PS_DATA_VECTOR, PS_DATA_STRING,
-        PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING,  PS_DATA_F64,
-        PS_DATA_BOOL, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR,
-        PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR,
-        PS_DATA_METADATA, PS_DATA_METADATA, PS_DATA_METADATA, PS_DATA_S32, PS_DATA_METADATA
-    };
-const psS32 testConfig1ValueS32Overwrite[] =
-    {
-        0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0,
-        0, 0, 0, 123, 0
-    };
-const psF32 testConfig1ValueF32Overwrite[] =
-    {
-        0.0, 0.0, 0.0, 0.0, 0.0,
-        0.0, 0.0, 0.0, 0.0, 0.0,
-        0.0, 0.0, 0.0, 0.0, 0.0,
-        0.0, 0.0, 0.0, 0.0, 0.0,
-        0.0, 0.0, 0.0, 0.0, 0.0
-    };
-const psF64 testConfig1ValueF64Overwrite[] =
-    {
-        1.23456789, 0.0, 0.0, 0.0, 0.0,
-        0.0, 0.0, 0.0, 0.0, 1.23456,
-        0.0, 0.0, 0.0, 0.0, 0.0,
-        0.0, 0.0, 0.0, 0.0, 0.0,
-        0.0, 0.0, 0.0, 0.0, 0.0
-    };
-const psBool testConfig1ValueBoolOverwrite[] =
-    {
-        false, false, true, false, false,
-        false, false, false, false, false,
-        false, false, false, false, false,
-        false, false, false, false, false,
-        false, false, false, false, false
-    };
-const char* testConfig1ValueStrOverwrite[] =
-    {
-        "", "This is the string that forms the value","","","This",
-        "is","a","non-unique","key","",
-        "","","","","",
-        "","","","","",
-        "","","","",""
-    };
-const psS32 testConfig1ValueVecItemsU8 = 7;
-const psElemType testConfig1ValueVecTypeU8 = PS_TYPE_U8;
-const psU8 testConfig1ValueVecValueU8[] =
-    {
-        2, 3, 5, 7, 11, 13, 17
-    };
-const psS32 testConfig1ValueVecItemsS8 = 8;
-const psElemType testConfig1ValueVecTypeS8 = PS_TYPE_S8;
-const psS8 testConfig1ValueVecValueS8[] =
-    {
-        -2, -3, -5, -7, -11, -13, -17, -19
-    };
-const psS32 testConfig1ValueVecItemsU16 = 5;
-const psElemType testConfig1ValueVecTypeU16 = PS_TYPE_U16;
-const psU16 testConfig1ValueVecValueU16[] =
-    {
-        0, 1, 2, 4, 8
-    };
-const psS32 testConfig1ValueVecItemsU32 = 6;
-const psElemType testConfig1ValueVecTypeU32 = PS_TYPE_U32;
-const psU32 testConfig1ValueVecValueU32[] =
-    {
-        0, 8, 16, 32, 64, 128
-    };
-const psS32 testConfig1ValueVecItemsU64 = 3;
-const psElemType testConfig1ValueVecTypeU64 = PS_TYPE_U64;
-const psU64 testConfig1ValueVecValueU64[] =
-    {
-        0, 64, 256
-    };
-const psS32 testConfig1ValueVecItemsS16 = 5;
-const psElemType testConfig1ValueVecTypeS16 = PS_TYPE_S16;
-const psS16 testConfig1ValueVecValueS16[] =
-    {
-        -2, -1, 0, 1, 2
-    };
-const psS32 testConfig1ValueVecItemsS32 = 6;
-const psElemType testConfig1ValueVecTypeS32 = PS_TYPE_S32;
-const psS32 testConfig1ValueVecValueS32[] =
-    {
-        -4, -2, 0, 2, 4, 6
-    };
-const psS32 testConfig1ValueVecItemsS64 = 7;
-const psElemType testConfig1ValueVecTypeS64 = PS_TYPE_S64;
-const psS64 testConfig1ValueVecValueS64[] =
-    {
-        -16, -4, 0, 4, 16, 36, 64
-    };
-const psS32 testConfig1ValueVecItemsF32 = 4;
-const psElemType testConfig1ValueVecTypeF32 = PS_TYPE_F32;
-const psF32 testConfig1ValueVecValueF32[] =
-    {
-        -1.03, 1.04, -1.05, 1.06
-    };
-const psS32 testConfig1ValueVecItemsF64 = 5;
-const psElemType testConfig1ValueVecTypeF64 = PS_TYPE_F64;
-const psF64 testConfig1ValueVecValueF64[] =
-    {
-        -2.22, 2.21, -2.20, 2.19, -2.18
-    };
-const psS32 testConfig1ValueMetaItems1 = 3;
-const char* testConfig1ValueMetaNames1[] =
-    {
-        "EXTNAME","BIASSEC","CHIP"
-    };
-const psDataType testConfig1ValueMetaTypes1[] =
-    {
-        PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING
-    };
-const char* testConfig1ValueMetaValue1[] =
-    {
-        "CCD00","BSEC-00","CHIP.00"
-    };
-const psS32 testConfig1ValueMetaItems2 = 3;
-const char* testConfig1ValueMetaNames2[] =
-    {
-        "EXTNAME","BIASSEC","CHIP"
-    };
-const psDataType testConfig1ValueMetaTypes2[] =
-    {
-        PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING
-    };
-const char* testConfig1ValueMetaValue2[] =
-    {
-        "CCD01","BSEC-01","CHIP.00"
-    };
-const psS32 testConfig1ValueMetaItems3 = 4;
-const char* testConfig1ValueMetaNames3[] =
-    {
-        "EXTNAME","BIASSEC","CHIP","NCELL"
-    };
-const psDataType testConfig1ValueMetaTypes3[] =
-    {
-        PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING, PS_DATA_S32
-    };
-const char* testConfig1ValueMetaValueStr3[] =
-    {
-        "CCD00","BSEC-00","CHIP.00",""
-    };
-const psS32 testConfig1ValueMetaValueS323[] =
-    {
-        0, 0, 0, 24
-    };
-
-static void writeMetadata(psMetadata* metadata, char* indentStr)
-{
-    writeMetadataList(metadata->list, indentStr);
-}
-
-static void writeMetadataList(psList* metadataItemList, char* indentStr)
-{
-    psMetadataItem* entryChild        = NULL;
-    psMetadataItem* searchChild       = NULL;
-    psArray*        nonUniqueKeyArray = NULL;
-    psBool          keyFound          = false;
-    char*           tempKey           = NULL;
-
-    // Allocate iterator for moving through metadata list
-    psListIterator* iter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD, true);
-    psListIterator* searchIter = psListIteratorAlloc(metadataItemList, PS_LIST_HEAD, true);
-
-    // Allocate array for nonUnique key names
-    nonUniqueKeyArray = psArrayAlloc(10);
-    nonUniqueKeyArray->n = 0;
-
-
-    // Loop through all items in the list
-    while ( (entryChild = psListGetAndIncrement(iter)) != NULL) {
-        // Search list for another entry with same key name
-        // Check if last entry
-        if(iter->index != metadataItemList->n) {
-            // Set search iterator to index
-            if(!psListIteratorSet(searchIter,iter->index) ) {
-                psError(PS_ERR_UNKNOWN,true,"Error searching list for multiple keys");
-                break;
-            }
-            keyFound = false;
-            while ( (searchChild = psListGetAndIncrement(searchIter)) != NULL) {
-                if(strcmp(entryChild->name,searchChild->name) == 0) {
-                    // Search nonUnique key array
-                    for(psS32 i = 0; i < nonUniqueKeyArray->n; i++) {
-                        if(strcmp(entryChild->name,nonUniqueKeyArray->data[i]) == 0) {
-                            keyFound = true;
-                        }
-                    }
-                    if(!keyFound) {
-                        // Add key to non-unique array
-                        tempKey = psStringCopy(entryChild->name);
-                        nonUniqueKeyArray = psArrayAdd(nonUniqueKeyArray,1,tempKey);
-                        psFree(tempKey);
-
-                        // Print MULTI line
-                        printf("%-25s MULTI\n",entryChild->name);
-
-                        // Break out of loop
-                        break;
-                    }
-                }
-            }
-        }
-        writeMetadataItem(entryChild,indentStr);
-    }
-
-    psFree(iter);
-    psFree(searchIter);
-    psFree(nonUniqueKeyArray);
-}
-
-char* vectorToConfigString(psVector* vector)
-{
-    psS32  maxLength = 256;
-
-    char* str = psAlloc(sizeof(char)*maxLength+1);
-
-    if (vector == NULL) {
-        snprintf(str,maxLength, "NULL");
-        return str;
-    }
-
-    int size = vector->n;
-
-    if (size == 0) {
-        snprintf(str,maxLength, " ");
-        return str;
-    }
-
-    char* tempStr = psAlloc(sizeof(char)*maxLength+1);
-    *str = '\0';
-    bool full = false;
-
-    #define APPEND_ELEMENTS_CASE(TYPE, NATIVE_TYPE, FORMAT) \
-case PS_TYPE_##TYPE: \
-    strcat(str,#TYPE); \
-    for(psS32 i = 0; i < (strlen(str)-6); i++) {  \
-        strcat(str," "); \
-    } \
-    for (lcv=0; lcv < size && ! full; lcv++) { \
-        snprintf(tempStr, maxLength, "%s" FORMAT, prefix, (NATIVE_TYPE) (vector->data.TYPE[lcv])); \
-        strncat(str,tempStr,maxLength); \
-        full = (strlen(str) > maxLength-2); \
-        prefix = ","; \
-    } \
-    break;
-
-    int lcv;
-    char* prefix = " ";
-    switch(vector->type.type) {
-        APPEND_ELEMENTS_CASE(S8,char,"%hd")
-        APPEND_ELEMENTS_CASE(S16,short int,"%hd")
-        APPEND_ELEMENTS_CASE(S32,int,"%d")
-        APPEND_ELEMENTS_CASE(S64,long,"%ld")
-        APPEND_ELEMENTS_CASE(U8,unsigned char,"%hu")
-        APPEND_ELEMENTS_CASE(U16,unsigned short,"%hu")
-        APPEND_ELEMENTS_CASE(U32,unsigned int, "%u")
-        APPEND_ELEMENTS_CASE(U64,unsigned long,"%lu")
-        APPEND_ELEMENTS_CASE(F32,double,"%g")
-        APPEND_ELEMENTS_CASE(F64,double,"%g")
-    default:
-        snprintf(str,maxLength,"INVALID TYPE");
-        break;
-    }
-
-    psFree(tempStr);
-
-    return str;
-}
-
-
-static void writeMetadataItem(psMetadataItem *metadataItem, char* indentStr)
-{
-    char*  vecStr;
-
-    switch(metadataItem->type) {
-    case PS_DATA_BOOL:
-        printf("%s%-25s BOOL  %40d",indentStr,metadataItem->name,metadataItem->data.B);
-        break;
-    case PS_DATA_S32:
-        printf("%s%-25s S32   %40d",indentStr,metadataItem->name,metadataItem->data.S32);
-        break;
-    case PS_DATA_F32:
-        printf("%s%-25s F32   %40f",indentStr,metadataItem->name,metadataItem->data.F32);
-        break;
-    case PS_DATA_F64:
-        printf("%s%-25s F64   %40lf",indentStr,metadataItem->name,metadataItem->data.F64);
-        break;
-    case PS_DATA_VECTOR:
-        vecStr = (char*)vectorToConfigString((psVector*)metadataItem->data.V);
-        printf("%s@%-24s %s",indentStr,metadataItem->name,vecStr);
-        psFree(vecStr);
-        break;
-    case PS_DATA_STRING:
-        printf("%s%-25s STR   %40s",indentStr,metadataItem->name,(char*)metadataItem->data.V);
-        break;
-    case PS_DATA_METADATA:
-        printf("%s%-25s METADATA\n",indentStr,metadataItem->name);
-        char nestedStr[256] = "    ";
-        strcat(nestedStr,indentStr);
-        writeMetadata((psMetadata*)metadataItem->data.md,nestedStr);
-        printf("%sEND",indentStr);
-        break;
-    default:
-        printf("#%s%-24s BAD TYPE=%d",indentStr,metadataItem->name,metadataItem->type);
-        break;
-    }
-    if(strlen(metadataItem->comment) > 0) {
-        printf("  # %-20s\n",metadataItem->comment);
-    } else {
-        printf("\n");
-    }
-}
-
-static psBool checkFailedLines(psS32 failedLines, psS32 expectedFailedLines, char* configFile)
-{
-    psBool     returnValue = true;
-
-    // Verify the expected number of failed lines
-    if(failedLines != expectedFailedLines) {
-        psError(PS_ERR_UNKNOWN,true,"File: %s : Number of failed lines = %d not as expected %d",
-                configFile,failedLines,expectedFailedLines);
-        returnValue = false;
-    }
-    return returnValue;
-}
-
-static psBool checkNumberOfItems(psMetadata* md, psS32 expectedItems, char* configFile)
-{
-    psBool     returnValue = true;
-
-    // Verify the number of items in metadata
-    if(md->list->n != expectedItems) {
-        psError(PS_ERR_UNKNOWN,true,"File: %s : Number of items = %d not as expected %d",
-                configFile,md->list->n, expectedItems);
-        returnValue = false;
-    }
-    return returnValue;
-}
-
-static psBool checkItemName(psMetadataItem* mdItem, char* expectedName, char* configFile)
-{
-    psBool    returnValue = true;
-
-    // Compare key names
-    if(strcmp(mdItem->name,expectedName) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"File: %s : Key name %s not as expected %s",
-                configFile,mdItem->name,expectedName);
-        returnValue = false;
-    }
-
-    return returnValue;
-}
-
-static psBool checkItemType(psMetadataItem* mdItem, psS32 expectedType, char* configFile)
-{
-    psBool     returnValue = true;
-
-    // Compare types
-    if(mdItem->type != expectedType) {
-        psError(PS_ERR_UNKNOWN,true,"File: %s : Type %d not as expected %d",
-                configFile,mdItem->type,expectedType);
-        returnValue = false;
-    }
-    return returnValue;
-}
-
-static psBool checkItemComment(psMetadataItem* mdItem, char* expectedComment, char* configFile)
-{
-    psBool    returnValue = true;
-
-    // Compare comments
-    if(strcmp(mdItem->comment,expectedComment) != 0) {
-        psError(PS_ERR_UNKNOWN,true,"File: %s : Comment %s not as expected %s",
-                configFile,mdItem->comment,expectedComment);
-        returnValue = false;
-    }
-    return returnValue;
-}
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    if( !runTestSuite(stderr,"psMetadataConfigParse",tests,argc,argv)) {
-        return 1;
-    }
-
-    return 0;
-}
-
-psS32 testMetadataParseConfig(void)
-{
-    psMetadata*       metadata1      = NULL;
-    psMetadataItem*   entryChild     = NULL;
-    psU32             failedLines    = 0;
-    psListIterator*   iter           = NULL;
-    psListIterator*   mdIter         = NULL;
-    psMetadataItem*   mdChild        = NULL;
-    psS32             metaCounter    = 0;
-    psS32             mdCounter      = 0;
-
-    // Read config file test1.config with overwrite set true
-    metadata1 = psMetadataConfigParse(metadata1,&failedLines,testConfig1,true);
-    // Verify the expected number of failed lines
-    if(!checkFailedLines(failedLines,testConfig1FailsOverwrite,(char*)testConfig1)) {
-        return 1;
-    }
-    // Verify the number of items in metadata
-    if(!checkNumberOfItems(metadata1,testConfig1Items,(char*)testConfig1)) {
-        return 2;
-    }
-    // Verify metadata item quads
-    iter = psListIteratorAlloc(metadata1->list, PS_LIST_HEAD, true);
-    for(psS32 i = 0; i < testConfig1Items; i++) {
-        // Get list item
-        entryChild = psListGetAndIncrement(iter);
-
-        // Verify end of list not reached prematurely
-        if(entryChild == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"End of list encountered at %d not as expected %d",
-                    i,testConfig1Items);
-            return i*10+1;
-        }
-        // Verify name
-        if(!checkItemName(entryChild,(char*)testConfig1KeyOverwrite[i],(char*)testConfig1)) {
-            return i*10+2;
-        }
-        // Verify type
-        if(!checkItemType(entryChild,testConfig1TypeOverwrite[i],(char*)testConfig1)) {
-            return i*10+3;
-        }
-        // Verify comment
-        if(!checkItemComment(entryChild,(char*)testConfig1CommentOverwrite[i],(char*)testConfig1)) {
-            return i*10+4;
-        }
-        // Compare values
-        switch(entryChild->type) {
-        case PS_DATA_S32:
-            if(entryChild->data.S32 != testConfig1ValueS32Overwrite[i]) {
-                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %d not as expected %d",
-                        testConfig1,entryChild->data.S32, testConfig1ValueS32Overwrite[i]);
-                return i*10+5;
-            }
-            break;
-        case PS_DATA_F32:
-            if(fabs(entryChild->data.F32 - testConfig1ValueF32Overwrite[i]) > ERROR_TOL) {
-                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %f not as expected %f",
-                        testConfig1,entryChild->data.F32, testConfig1ValueF32Overwrite[i]);
-                return i*10+5;
-            }
-            break;
-        case PS_DATA_F64:
-            if(fabs(entryChild->data.F64 - testConfig1ValueF64Overwrite[i]) > ERROR_TOL) {
-                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %lf not as expected %lf",
-                        testConfig1,entryChild->data.F64, testConfig1ValueF64Overwrite[i]);
-                return i*10+5;
-            }
-            break;
-        case PS_DATA_BOOL:
-            if(entryChild->data.B != testConfig1ValueBoolOverwrite[i]) {
-                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %d not as expected %d",
-                        testConfig1,entryChild->data.B,testConfig1ValueBoolOverwrite[i]);
-                return i*10+5;
-            }
-            break;
-        case PS_DATA_STRING:
-            if(strcmp(entryChild->data.V,testConfig1ValueStrOverwrite[i]) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"File: %s : Value %s not as expected %s",
-                        testConfig1,entryChild->data.V,testConfig1ValueStrOverwrite[i]);
-                return i*10+5;
-            }
-            break;
-        case PS_DATA_VECTOR:
-            // Verify the correct number of entries
-            switch(((psVector*)(entryChild->data.V))->type.type) {
-            case PS_TYPE_U8:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsU8) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsU8);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeU8) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeU8);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsU8; j++) {
-                    if(((psVector*)entryChild->data.V)->data.U8[j] != testConfig1ValueVecValueU8[j]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %d not as expected %d",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.U8[j],
-                                testConfig1ValueVecValueU8[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_U16:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsU16) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsU16);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeU16) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeU16);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsU16; j++) {
-                    if(((psVector*)entryChild->data.V)->data.U16[j] != testConfig1ValueVecValueU16[j]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %d not as expected %d",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.U16[j],
-                                testConfig1ValueVecValueU16[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_U32:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsU32) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsU32);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeU32) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeU32);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsU32; j++) {
-                    if(((psVector*)entryChild->data.V)->data.U32[j] != testConfig1ValueVecValueU32[j]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %d not as expected %d",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.U32[j],
-                                testConfig1ValueVecValueU32[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_U64:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsU64) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsU64);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeU64) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeU64);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsU64; j++) {
-                    if(((psVector*)entryChild->data.V)->data.U64[j] != testConfig1ValueVecValueU64[j]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %ld not as expected %ld",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.U64[j],
-                                testConfig1ValueVecValueU64[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_S8:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsS8) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsS8);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeS8) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeS8);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsS8; j++) {
-                    if(((psVector*)entryChild->data.V)->data.S8[j] != testConfig1ValueVecValueS8[j]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %d not as expected %d",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.S8[j],
-                                testConfig1ValueVecValueS8[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_S16:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsS16) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsS16);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeS16) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeS16);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsS16; j++) {
-                    if(((psVector*)entryChild->data.V)->data.S16[j] != testConfig1ValueVecValueS16[j]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %d not as expected %d",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.S16[j],
-                                testConfig1ValueVecValueS16[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_S32:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsS32) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsS32);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeS32) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeS32);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsS32; j++) {
-                    if(((psVector*)entryChild->data.V)->data.S32[j] != testConfig1ValueVecValueS32[j]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %d not as expected %d",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.S32[j],
-                                testConfig1ValueVecValueS32[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_S64:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsS64) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsS64);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeS64) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeS64);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsS64; j++) {
-                    if(((psVector*)entryChild->data.V)->data.S64[j] != testConfig1ValueVecValueS64[j]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %ld not as expected %ld",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.S64[j],
-                                testConfig1ValueVecValueS64[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_F32:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsF32) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsF32);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeF32) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeF32);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsF32; j++) {
-                    if(fabs(((psVector*)entryChild->data.V)->data.F32[j]-testConfig1ValueVecValueF32[j])
-                            > ERROR_TOL) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %f not as expected %f",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.F32[j],
-                                testConfig1ValueVecValueF32[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            case PS_TYPE_F64:
-                if(((psVector*)(entryChild->data.V))->n != testConfig1ValueVecItemsF64) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector entries %d not as expected %d",
-                            testConfig1,((psVector*)(entryChild->data.V))->n,testConfig1ValueVecItemsF64);
-                    return i*10+5;
-                }
-                // Verify the correct type
-                if(((psVector*)(entryChild->data.V))->type.type != testConfig1ValueVecTypeF64) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Vector type %d not as expected %s",
-                            testConfig1,((psVector*)entryChild->data.V)->type.type,testConfig1ValueVecTypeF64);
-                    return i*10+5;
-                }
-                // Verify the values in vector
-                for(psS32 j = 0; j < testConfig1ValueVecItemsF64; j++) {
-                    if(fabs(((psVector*)entryChild->data.V)->data.F64[j]-testConfig1ValueVecValueF64[j])
-                            > ERROR_TOL) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Vector data[%d] = %lf not as expected %lf",
-                                testConfig1,j,((psVector*)entryChild->data.V)->data.F64[j],
-                                testConfig1ValueVecValueF64[j]);
-                        return i*10+5*j;
-                    }
-                }
-                break;
-            default:
-                break;
-            }
-            break;
-        case PS_DATA_METADATA:
-            if(metaCounter == 0) {
-                // Check if number of items is as expected
-                if(entryChild->data.md->list->n != testConfig1ValueMetaItems1) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 1 items %d not as expected %d",
-                            testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems1);
-                    return i*10+6;
-                }
-                // Loop through metadata items
-                mdIter = psListIteratorAlloc(entryChild->data.md->list, PS_LIST_HEAD, true);
-                mdCounter = 0;
-                while ( (mdChild = psListGetAndIncrement(mdIter)) != NULL) {
-                    if(strcmp(mdChild->name,testConfig1ValueMetaNames1[mdCounter]) != 0) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 1 name[%d] %s not as expected %s",
-                                testConfig1,mdCounter,mdChild->name,testConfig1ValueMetaNames1[mdCounter]);
-                        return i*10+6*mdCounter;
-                    }
-                    if(mdChild->type != testConfig1ValueMetaTypes1[mdCounter]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 1 type[%d] %d not as expected %d",
-                                testConfig1,mdCounter,mdChild->type,testConfig1ValueMetaTypes1[mdCounter]);
-                        return i*10+6*mdCounter;
-                    }
-                    if(strcmp((char*)mdChild->data.V,testConfig1ValueMetaValue1[mdCounter]) != 0) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 1 value[%d] %s not as expected %s",
-                                testConfig1,mdCounter,(char*)mdChild->data.V,testConfig1ValueMetaValue1[mdCounter]);
-                        return i*10+6*mdCounter;
-                    }
-                    mdCounter++;
-                }
-                psFree(mdIter);
-            } else if(metaCounter == 1) {
-                // Check if number of items is as expected
-                if(entryChild->data.md->list->n != testConfig1ValueMetaItems2) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 2 items %d not as expected %d",
-                            testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems2);
-                    return i*10+6;
-                }
-                // Loop through metadata items
-                mdIter = psListIteratorAlloc(entryChild->data.md->list, PS_LIST_HEAD, true);
-                mdCounter = 0;
-                while ( (mdChild = psListGetAndIncrement(mdIter)) != NULL) {
-                    if(strcmp(mdChild->name,testConfig1ValueMetaNames2[mdCounter]) != 0) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 2 name[%d] %s not as expected %s",
-                                testConfig1,mdCounter,mdChild->name,testConfig1ValueMetaNames2[mdCounter]);
-                        return i*10+6*mdCounter;
-                    }
-                    if(mdChild->type != testConfig1ValueMetaTypes2[mdCounter]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 2 type[%d] %d not as expected %d",
-                                testConfig1,mdCounter,mdChild->type,testConfig1ValueMetaTypes2[mdCounter]);
-                        return i*10+6*mdCounter;
-                    }
-                    if(strcmp((char*)mdChild->data.V,testConfig1ValueMetaValue2[mdCounter]) != 0) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 2 value[%d] %s not as expected %s",
-                                testConfig1,mdCounter,(char*)mdChild->data.V,testConfig1ValueMetaValue2[mdCounter]);
-                        return i*10+6*mdCounter;
-                    }
-                    mdCounter++;
-                }
-                psFree(mdIter);
-            } else if(metaCounter == 2) {
-                // Check if number of items is as expected
-                if(entryChild->data.md->list->n != testConfig1ValueMetaItems3) {
-                    psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 items %d not as expected %d",
-                            testConfig1,entryChild->data.md->list->n,testConfig1ValueMetaItems3);
-                    return i*10+6;
-                }
-                // Loop through metadata items
-                mdIter = psListIteratorAlloc(entryChild->data.md->list, PS_LIST_HEAD, true);
-                mdCounter = 0;
-                while ( (mdChild = psListGetAndIncrement(mdIter)) != NULL) {
-                    if(strcmp(mdChild->name,testConfig1ValueMetaNames3[mdCounter]) != 0) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 name[%d] %s not as expected %s",
-                                testConfig1,mdCounter,mdChild->name,testConfig1ValueMetaNames3[mdCounter]);
-                        return i*10+6*mdCounter;
-                    }
-                    if(mdChild->type != testConfig1ValueMetaTypes3[mdCounter]) {
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 type[%d] %d not as expected %d",
-                                testConfig1,mdCounter,mdChild->type,testConfig1ValueMetaTypes3[mdCounter]);
-                        return i*10+6*mdCounter;
-                    }
-                    switch(mdChild->type) {
-                    case PS_DATA_STRING:
-                        if(strcmp((char*)mdChild->data.V,testConfig1ValueMetaValueStr3[mdCounter]) != 0) {
-                            psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 value[%d] %s not as expected %s",
-                                    testConfig1,mdCounter,(char*)mdChild->data.V,
-                                    testConfig1ValueMetaValueStr3[mdCounter]);
-                            return i*10+6*mdCounter;
-                        }
-                        break;
-                    case PS_DATA_S32:
-                        if(mdChild->data.S32 != testConfig1ValueMetaValueS323[mdCounter]) {
-                            psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 value[%d] %d not as expected %d",
-                                    testConfig1,mdCounter,mdChild->data.S32,
-                                    testConfig1ValueMetaValueS323[mdCounter]);
-                            return i*10+6*mdCounter;
-                        }
-                        break;
-                    default:
-                        psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 value[%d] unknown type",
-                                testConfig1,mdCounter);
-                        return i*10+6*mdCounter;
-                        break;
-                    }
-                    mdCounter++;
-                }
-                psFree(mdIter);
-            }
-            metaCounter++;
-            break;
-        default:
-            psError(PS_ERR_UNKNOWN,true,"Unexpected type %d encountered",entryChild->type);
-            return i*10+5;
-            break;
-        }
-    }
-
-    writeMetadata(metadata1,"");
-
-    psFree(metadata1);
-
-    return 0;
-}
-
-psS32 testMetadataParseConfig1(void)
-{
-    psMetadata*       metadata1      = NULL;
-    psU32             failedLines    = 0;
-
-    // Read config file test2.config with overwrite set true
-    // This file contains parse errors
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate parse error message");
-    metadata1 = psMetadataConfigParse(metadata1,&failedLines,testConfig2,true);
-    // Verify the expected number of failed lines
-    if(!checkFailedLines(failedLines,testConfig2Fails,(char*)testConfig2)) {
-        return 1;
-    }
-    // Verify return value is null
-    if(metadata1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expected a NULL return for failed parse");
-        return 2;
-    }
-    psFree(metadata1);
-
-    // Attempt parse a non-existant file
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    metadata1 = psMetadataConfigParse(metadata1,&failedLines,"ab.config",true);
-    if(metadata1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Expected a NULL return for non-existant file");
-        return 3;
-    }
-
-    // Attempt parse with NULL failed lines ptr
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL failed lines arg");
-    metadata1 = psMetadataConfigParse(metadata1,NULL,testConfig2,true);
-    if(metadata1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return for NULL failed lines argument");
-        return 4;
-    }
-    psFree(metadata1);
-    // Attempt parse with NULL file name
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL file name arg");
-    metadata1 = psMetadataConfigParse(metadata1,&failedLines,NULL,true);
-    if(metadata1 != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Expected a NULL return for NULL filename argument");
-        return 5;
-    }
-
-    psFree(metadata1);
-
-    return 0;
-}
-
-psS32 testMetadataParseConfig2(void)
-{
-    psMetadata*       metadata1      = NULL;
-    psU32             failedLines    = 0;
-
-    // Read config file test3.config with overwrite set false
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error of duplicate key names");
-    metadata1 = psMetadataConfigParse(metadata1,&failedLines,testConfig3,false);
-    // Verify the expected number of failed lines
-    if(!checkFailedLines(failedLines,testConfig3Fails,(char*)testConfig3)) {
-        return 1;
-    }
-    if(metadata1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expected a NULL return for failed due to overwrite false");
-        return 2;
-    }
-    psFree(metadata1);
-
-    return 0;
-}
-
-psS32 testMetadataParseConfig3(void)
-{
-    psMetadata*       metadata1      = NULL;
-    psU32             failedLines    = 0;
-
-    // Read config file test4.config with overwrite set false
-    metadata1 = psMetadataConfigParse(metadata1,&failedLines,testConfig4,false);
-    // Verify the expected number of failed lines
-    if(!checkFailedLines(failedLines,testConfig4Fails,(char*)testConfig4)) {
-        return 1;
-    }
-    // Print out metadata items for comparison against STDERR verified file
-    writeMetadata(metadata1,"");
-
-    psFree(metadata1);
-
-    return 0;
-}
-
-psS32 testMetadataParseConfig4(void)
-{
-    psMetadata*       metadata1      = NULL;
-    psU32             failedLines    = 0;
-
-    // Read config file test4.config with overwrite set false
-    metadata1 = psMetadataConfigParse(metadata1,&failedLines,testConfig5,true);
-    // Verify the expected number of failed lines
-    if(!checkFailedLines(failedLines,testConfig5Fails,(char*)testConfig5)) {
-        return 1;
-    }
-    psFree(metadata1);
-
-    return 0;
-}
-
Index: trunk/psLib/test/types/tst_psMetadata_01.c
===================================================================
--- trunk/psLib/test/types/tst_psMetadata_01.c	(revision 41166)
+++ 	(revision )
@@ -1,299 +1,0 @@
-/** @file  tst_psMetadata_01.c
-*
-*  @brief Test driver for psMetadata functions
-*
-*  @author  dRob, MHPCC
-*
-*  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2006-08-09 00:06:26 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*
-*/
-
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static psS32 testMetadataItemCopy(void);
-static psS32 testMetadataItemTransfer(void);
-static psS32 testMetadataPrint(void);
-static psS32 testMetadataItemCompare(void);
-static psS32 testMetadataItemParse(void);
-
-testDescription tests[] = {
-                              {testMetadataItemCopy, 666, "psMetadataItemCopy()", 0, false},
-                              {testMetadataItemTransfer, 1, "psMetadataItemTransfer()", 0, false},
-                              {testMetadataPrint,667,"psMetadataPrint",0,false},
-                              {testMetadataItemCompare,669,"psMetadataItemCompare",0,false},
-                              {testMetadataItemParse,665,"psMetadataItemParse",0,false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( !runTestSuite(stderr,"psMetadata_01",tests,argc,argv) );
-
-}
-
-psS32 testMetadataItemCopy(void)
-{
-    psMetadataItem *item = psMetadataItemAlloc("metaITEM", PS_DATA_S32, "no Comment");
-    item->data.S32 = 666;
-    psMetadataItem *item2 = NULL;
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    item2 = psMetadataItemCopy(NULL);
-    if (item2 != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psMetadataItemCopy failed to return NULL for NULL input psMetadataItem.\n");
-        return 1;
-    }
-
-    //Simple copy of psS32 data
-    item2 = psMetadataItemCopy(item);
-    if (item2 == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psMetadataItemCopy incorrectly returned NULL for valid input psMetadataItem.\n");
-        return 2;
-    }
-    if ( strncmp(item2->name, item->name, 10) || item2->type != item->type ||
-            item2->data.S32 != item->data.S32 || strncmp(item2->comment, item->comment, 15) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psMetadataItemCopy returned an incorrect psMetadataItem (S32 test).\n");
-        return 3;
-    }
-    psFree(item2);
-    psFree(item);
-    item2 = NULL;
-
-    //Copy of MetadataItem containing a psMetadata
-    psMetadata* metadata = psMetadataAlloc();
-    psMetadataAddS32(metadata, PS_LIST_TAIL, "item01", 0, "", 55);
-    psMetadataAddF32(metadata, PS_LIST_TAIL, "item02", 0, NULL, 3.14);
-    item = psMetadataItemAlloc("metaItem2", PS_DATA_METADATA, "newMeta", metadata);
-    item2 = psMetadataItemCopy(item);
-    if (item2 == NULL || item2->data.md == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psMetadataItemCopy returned either a NULL item or NULL metadata data\n");
-        return 4;
-    }
-    if ( strncmp(item2->name, item->name, 11) || item2->type != item->type ||
-            strncmp(item2->comment, item->comment, 15) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psMetadataItemCopy returned an incorrect psMetadataItem (Metadata test).\n");
-        return 5;
-    }
-    psMetadataItem *temp1 = psMetadataGet(item->data.md, PS_LIST_HEAD);
-    psMetadataItem *temp2 = psMetadataGet(item2->data.md, PS_LIST_HEAD);
-    if ( strncmp(temp2->name, temp1->name, 10) || temp2->type != temp1->type ||
-            temp2->data.S32 != temp1->data.S32 || strncmp(temp2->comment, temp1->comment, 15) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psMetadataItemCopy incorrectly returned non-matching metadata data.\n");
-        return 6;
-    }
-
-    psFree(item2);
-    psFree(metadata);
-    psFree(item);
-    return 0;
-}
-
-psS32 testMetadataItemTransfer(void)
-{
-
-    psMetadata *md = psMetadataAlloc();
-    psMetadata *out = NULL;
-    psMetadataAddS32(md, PS_LIST_TAIL, "metaITEM", 0, "no Comment", 666);
-
-    //attempt transfer to NULL 'out' metadata.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if ( psMetadataItemTransfer(out, md, "metaITEM") ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psMetadataItemTransfer failed to return false for NULL 'out' metadata.\n");
-        return 1;
-    }
-    out = psMetadataAlloc();
-    //attempt to transfer using a NULL key.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if ( psMetadataItemTransfer(out, md, NULL) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psMetadataItemTransfer failed to return false for NULL key input.\n");
-        return 2;
-    }
-    //attempt transfer to NULL 'in' metadata.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if ( psMetadataItemTransfer(out, NULL, "metaITEM") ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psMetadataItemTransfer failed to return false for NULL 'in' metadata.\n");
-        return 3;
-    }
-    //attempt to transfer using an allocated metadata and invalid key
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psMetadataItemTransfer(out, md, "metaITEM2") ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psMetadataItemTransfer failed to return false for invalid 'key'.\n");
-        return 4;
-    }
-    //attempt to transfer with all valid inputs.
-    psMetadataItem *item = NULL;
-    if ( !psMetadataItemTransfer(out, md, "metaITEM") ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psMetadataItemTransfer failed with valid inputs.\n");
-        return 7;
-    }
-    item = psMetadataGet(out, PS_LIST_HEAD);
-    if (item->data.S32 != 666 || strncmp(item->comment, "no Comment", 20)) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "psMetadataItemTransfer failed to correctly transfer item data.\n");
-        return 8;
-    }
-
-    psFree(out);
-    psFree(md);
-
-    return 0;
-}
-
-static psMetadata *setupMeta2(void)
-{
-    psMetadata *md = NULL;
-    psVector *vec = NULL;
-    psMetadata *newMD = NULL;
-    psTime *time;
-    int i = 0;
-    md = psMetadataAlloc();
-    newMD = psMetadataAlloc();
-    vec = psVectorAlloc(60, PS_DATA_S32);
-    time = psTimeAlloc(PS_TIME_TAI);
-    for (i = 0; i < 5; i++) {
-        vec->data.S32[i] = i+1;
-    }
-    vec->n = 5;
-    time->sec = 1000;
-    time->nsec = 25;
-    time->leapsecond = true;
-    psMetadataAddBool(md, PS_LIST_TAIL, "item1", 0, "I am a boolean", true);
-    psMetadataAddS32(md, PS_LIST_TAIL, "item2", 0, "I am a integer", 55);
-    psMetadataAddF32(md, PS_LIST_TAIL, "item3", 0, NULL, 3.14);
-    psMetadataAddF64(md, PS_LIST_TAIL, "item4", 0, "", 6.28);
-    psMetadataAddStr(md, PS_LIST_TAIL, "item5", 0, "I am a string", "GNIRTS");
-    psMetadataAddVector(md, PS_LIST_TAIL, "vector6", 0, "I am a vector", vec);
-    psMetadataAddTime(md, PS_LIST_TAIL, "time01", 0, "I am time", time);
-    psMetadataAddS8(md, PS_LIST_TAIL, "item6", 0, "I am S8", 6);
-    psMetadataAddS16(md, PS_LIST_TAIL, "item7", 0, "I am S16", -666);
-    psMetadataAddU8(md, PS_LIST_TAIL, "item8", 0, "I am U8", 6);
-    psMetadataAddU16(md, PS_LIST_TAIL, "item9", 0, "I am U16", 666);
-    psMetadataAddU32(md, PS_LIST_TAIL, "item10", 0, "I am U32", 666);
-    psMetadataAddS64(md, PS_LIST_TAIL, "item11", 0, "I am S64", 666);
-    psMetadataAddU64(md, PS_LIST_TAIL, "item12", 0, "I am U64", 666);
-
-    psMetadataAddS32(newMD, PS_LIST_TAIL, "ITEM01", 0, NULL, 666);
-    psMetadata *newestMD = NULL;
-    newestMD = psMetadataAlloc();
-    psMetadataAddVector(newestMD, PS_LIST_TAIL, "VECTORNEW", 0, "Newest VECTOR", vec);
-    psMetadataAddStr(newestMD, PS_LIST_TAIL, "cell", 0, "I am a p-Star", "pStArRs");
-    psMetadataAddMetadata(newMD, PS_LIST_TAIL, "META NEW", 0, "I AM Newest METADATA", newestMD);
-    psMetadataAddF32(newMD, PS_LIST_TAIL, "ITEM02", 0, "I AM FLOAT", 666.6);
-    psMetadataAddF64(newMD, PS_LIST_TAIL, "ITEM03", 0, "I AM DOUBLE", 666.666);
-
-    psMetadataAddMetadata(md, PS_LIST_TAIL, "metadata7", 0, "I am a metadata", newMD);
-    psFree(time);
-    psFree(newestMD);
-    psFree(vec);
-    psFree(newMD);
-    return md;
-}
-
-psS32 testMetadataPrint(void)
-{
-    psMetadata *meta = NULL;
-    meta = setupMeta2();
-    psMetadataPrint(NULL, meta, 0);
-    psFree(meta);
-    return 0;
-}
-
-psS32 testMetadataItemCompare(void)
-{
-    psMetadataItem *compare = NULL;
-    psMetadataItem *template = NULL;
-    psMetadataItem *itemCopy = NULL;
-    psMetadataItem *item = psMetadataItemAlloc("Snickers", PS_DATA_BOOL, "No Comment", true)
-                           ;
-    if (!item->data.B) {
-        return 1;
-    }
-
-    //compare = NULL
-    if ( psMetadataItemCompare(compare, item)) {
-        return 2;
-    }
-    //template = NULL
-    if ( psMetadataItemCompare(item, template)) {
-        return 3;
-    }
-
-    template = psMetadataItemAlloc("Milky Way", PS_DATA_BOOL, "No Comment", true)
-               ;
-    compare = psMetadataItemAlloc("Snickers", PS_DATA_S32, "No Comment", 1);
-    //template->name != item->name
-    if ( psMetadataItemCompare(template, item) ) {
-        return 4;
-    }
-    //compare->type != item->type
-    if ( psMetadataItemCompare(compare, item) ) {
-        printf("\ncompare == item b/c of type\n");
-        //        return 5;
-    }
-
-    //compare->type == F32  compare->data.F32 = 1.4
-    psFree(compare);
-    compare = psMetadataItemAlloc("Snickers", PS_DATA_F64, "No Comment", 1.00001);
-    if ( psMetadataItemCompare(compare, item) ) {
-        printf("\ncompare2 == item b/c of type\n");
-        //        return 5;
-    }
-    psFree(template)
-    ;
-    template = psMetadataItemAlloc("Snickers", PS_DATA_S32, "No Comment", 1)
-               ;
-    if ( psMetadataItemCompare(compare, template) ) {
-        printf("\ncompare3 == item b/c of type\n");
-        //        return 5;
-    }
-
-    psFree(template)
-    ;
-    template = psMetadataItemAlloc("Snickers", PS_DATA_F32, "No Comment", 1.00001)
-               ;
-    if ( psMetadataItemCompare(compare, template) ) {
-        printf("\ncompare4 == item b/c of type\n");
-        //        return 5;
-    }
-
-
-    //itemCopy == item
-    itemCopy = psMetadataItemCopy(item);
-    if ( !psMetadataItemCompare(itemCopy, item) ) {
-        return 7;
-    }
-
-    psFree(compare);
-    psFree(template)
-    ;
-    psFree(itemCopy);
-    psFree(item);
-
-    return 0;
-}
-
-psS32 testMetadataItemParse(void)
-{
-
-    return 0;
-}
-
-
Index: trunk/psLib/test/types/tst_psMetadata_02.c
===================================================================
--- trunk/psLib/test/types/tst_psMetadata_02.c	(revision 41166)
+++ 	(revision )
@@ -1,145 +1,0 @@
-/** @file  tst_psMetadata_02.c
- *
- *  @brief Test driver for psMetadata functions
- *
- *  This test driver contains the following tests for psMetadata:
- *     Test A - Allocate metadata items
- *     Test B - Attempt to create metadata item with null name
- *     Test C - Attempt to create metadata item with invalid type
- *     Test D - Allocate metadata
- *     Test E - Attempt to add metadata item to null metadata
- *     Test F - Attempt to add null metadata item to metadata
- *     Test G - Free psMetadata
- *
- *  @author  Ross Harman, MHPCC
- *  @author  Robert DeSonia, MHPCC
- *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-09-26 21:13:33 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static void printMetadataItem(psMetadataItem *metadataItem)
-{
-    printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key mdType: 0x%08x  ", metadataItem->type);
-
-    switch (metadataItem->type) {
-    case PS_DATA_METADATA_MULTI:
-        printf("Key Value: %17c", ' ');
-        break;
-    case PS_DATA_BOOL:
-        printf("Key Value: %15d  ", metadataItem->data.B);
-        break;
-    case PS_DATA_S32:
-        printf("Key Value: %15d  ", metadataItem->data.S32);
-        break;
-    case PS_DATA_F32:
-        printf("Key Value: %15.3f  ", metadataItem->data.F32);
-        break;
-    case PS_DATA_F64:
-        printf("Key Value: %15.3f  ", metadataItem->data.F64);
-        break;
-    case PS_DATA_STRING:
-        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
-        break;
-    default:
-        printf("Bad type: %d ", metadataItem->type);
-    }
-    printf("Key Comment: %s\n", metadataItem->comment);
-}
-
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psMetadataItem *item1 = NULL;
-    psMetadata *metadata = NULL;
-    psMetadataItem *item2 = NULL;
-    psMetadataItem *item3 = NULL;
-    psMetadataItem *item4 = NULL;
-    psMetadataItem *item5 = NULL;
-    psMetadataItem *badItem = NULL;
-
-
-    // Test A - Allocate metadata items
-    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
-    item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a signed integer", 111);
-    item3 = psMetadataItemAlloc("myItem3", PS_DATA_F32, "I am a single precision floating point", 222.222);
-    item4 = psMetadataItemAlloc("myItem4", PS_DATA_F64, "I am a double precision floating point", 333.333);
-    item5 = psMetadataItemAlloc("myItem5", PS_DATA_STRING, "I am a string", "HELLO WORLD");
-    printMetadataItem(item1);
-    printMetadataItem(item2);
-    printMetadataItem(item3);
-    printMetadataItem(item4);
-    printMetadataItem(item5);
-    printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true);
-
-
-    // Test B - Attempt to create metadata item with null name
-    printNegativeTestHeader(stdout,"psMetadata", "Test B - Attempt to create metadata item with null name",
-                            "Null value for name not allowed", 0);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should produce error for null name.");
-    badItem = psMetadataItemAlloc(NULL, PS_DATA_STRING, "I am a string", "HELLO WORLD");
-    if (badItem != NULL) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataItemAlloc did not return null with null name item.");
-        return 10;
-    }
-    printFooter(stdout, "psMetadata", "Test B - Attempt to create metadata item with null name", true);
-
-
-    // Test C - Attempt to create metadata item with invalid type
-    printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to create metadata item with invalid type",
-                            "Invalid psDataType: 6", 0);
-    badItem = psMetadataItemAlloc("badItem", -1, "I am bad", "Bad comment");
-    printFooter(stdout, "psMetadata", "Test C - Attempt to create metadata item with invalid type", true);
-
-
-    // Test D - Allocate metadata
-    printPositiveTestHeader(stdout, "psMetadata", "Test D - Allocate metadata");
-    metadata = psMetadataAlloc();
-    printFooter(stdout, "psMetadata", "Test D - Allocate metadata", true);
-
-
-    // Test E - Attempt add metadata item to null metadata
-    printNegativeTestHeader(stdout,"psMetadata", "Test E - Attempt to add metadata item to null metadata",
-                            "Null metadata collection not allowed", 0);
-    psMetadataAddItem(NULL, item1, PS_LIST_HEAD, PS_META_DEFAULT);
-    printFooter(stdout, "psMetadata", "Test E - Attempt to add metadata item to null metadata", true);
-
-
-    // Test F - Attempt add null metadata item to metadata
-    printNegativeTestHeader(stdout,"psMetadata", "Test F - Attempt to add null metadata item to metadata",
-                            "Null metadata item not allowed", 0);
-    psMetadataAddItem(metadata, NULL, PS_LIST_HEAD, PS_META_DEFAULT);
-    printFooter(stdout, "psMetadata", "Test F - Attempt to add null metadata item to metadata", true);
-
-
-    // Test G - Free psMetadata
-    printPositiveTestHeader(stdout, "psMetadata", "Test G - Free psMetadata");
-    psFree(item1);
-    psFree(item2);
-    psFree(item3);
-    psFree(item4);
-    psFree(item5);
-    psFree(badItem);
-    psFree(metadata);
-    if(psMemCheckLeaks(0, NULL, stdout,false) ) {
-        psError(PS_ERR_UNKNOWN,true,"Memory leaks detected.");
-        return 10;
-    }
-    psMemCheckCorruption(0);
-    psS32 nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-    }
-    printFooter(stdout, "psMetadata", "Test G - Free psMetadata", true);
-
-    return 0;
-}
Index: trunk/psLib/test/types/tst_psMetadata_03.c
===================================================================
--- trunk/psLib/test/types/tst_psMetadata_03.c	(revision 41166)
+++ 	(revision )
@@ -1,241 +1,0 @@
-/** @file  tst_psMetadata_03.c
-*
-*  @brief Test driver for psMetadata functions
-*
-*  This test driver contains the following tests for psMetadata:
-*     Test A - Allocate metadata and items
-*     Test B - Remove items from metadata by name
-*     Test C - Remove items from metadata by index
-*     Test D - Attempt to use null metadata
-*     Test E - Attempt to remove non-existant metadata item by name
-*     Test F - Attempt to remove non-existant metadata item by index
-*     Test G - Attempt to add item to an invalid metadata structure
-*     Test H - Attempt to add item to an invalid metadata structure
-*     Test I - Attempt to add item with a null name
-*     Test J - Attempt to add item to an invalid metadata structure
-*     Test K - Free psMetadata
-*
-*  @author  Ross Harman, MHPCC
-*
-*  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-09-26 21:13:33 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*
-*/
-
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static void printMetadataItem(psMetadataItem *metadataItem)
-{
-    printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key mdType: 0x%08x  ", metadataItem->type);
-
-    switch (metadataItem->type) {
-    case PS_DATA_METADATA_MULTI:
-        printf("Key Value: %17c", ' ');
-        break;
-    case PS_DATA_BOOL:
-        printf("Key Value: %15d  ", metadataItem->data.B);
-        break;
-    case PS_DATA_S32:
-        printf("Key Value: %15d  ", metadataItem->data.S32);
-        break;
-    case PS_DATA_F32:
-        printf("Key Value: %15.3f  ", metadataItem->data.F32);
-        break;
-    case PS_DATA_F64:
-        printf("Key Value: %15.3f  ", metadataItem->data.F64);
-        break;
-    case PS_DATA_STRING:
-        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
-        break;
-    default:
-        printf("Bad type: %d ", metadataItem->type);
-    }
-    printf("Key Comment: %s\n", metadataItem->comment);
-}
-
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psMetadataItem *item1 = NULL;
-    psMetadataItem *item2 = NULL;
-    psMetadataItem *item3 = NULL;
-    psMetadataItem *item4 = NULL;
-    psMetadataItem *errItem = NULL;
-    psMetadata *metadata = NULL;
-    psMetadata *errMetadata = NULL;
-    psHash *mdTable = NULL;
-    psList *mdList = NULL;
-    char *errName = NULL;
-
-    // Test A - Allocate metadata and items
-    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
-    metadata = psMetadataAlloc();
-    item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66);
-    errItem = psMetadataItemAlloc("errItem", PS_DATA_S32, "I am a integer", 99);
-    printMetadataItem(item1);
-    printMetadataItem(item2);
-    printMetadataItem(item3);
-    printMetadataItem(item4);
-    printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true);
-
-
-    // Test B - Remove items from metadata by name
-    printPositiveTestHeader(stdout, "psMetadata", "Test B - Remove items from metadata by name");
-    if(!psMetadataAddItem(metadata, item1, PS_LIST_HEAD, PS_META_DEFAULT)) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name.");
-        return 10;
-    }
-    if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_DATA_S32, "I am S32 integer",77)) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name.");
-        return 11;
-    }
-    if (!psMetadataRemove(metadata, 0, "myItem1")) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return true when removing by name.");
-        return 12;
-    }
-    if (!psMetadataRemove(metadata, 0, "myItem2")) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return true when removing by name.");
-        return 13;
-    }
-    printFooter(stdout, "psMetadata", "Test B - Remove items from metadata by name", true);
-
-
-    // Test C - Remove items from metadata by index
-    printPositiveTestHeader(stdout, "psMetadata", "Test C - Remove items from metadata by index");
-    if ( ! psMetadataAddItem(metadata, item3, PS_LIST_HEAD, PS_META_DEFAULT) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index.");
-        return 14;
-    }
-    if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_DATA_S32, "I am S32 integer",88) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index.");
-        return 15;
-    }
-    if( ! psMetadataRemove(metadata, 0, NULL) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return true when removing by index.");
-        return 16;
-    }
-    if ( ! psMetadataRemove(metadata, 0, NULL ) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return true when removing by index.");
-        return 17;
-    }
-    printFooter(stdout, "psMetadata", "Test C - Remove items from metadata by index", true);
-
-
-    // Test D - Attempt to use null metadata
-    printNegativeTestHeader(stdout,"psMetadata", "Test D - Attempt to use null metadata",
-                            "Null metadata collection not allowed", 0);
-    if ( psMetadataRemove(NULL, 0, NULL) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false when removing from null metadata.");
-        return 18;
-    }
-    printFooter(stdout, "psMetadata", "Test D - Attempt to use null metadata", true);
-
-
-    // Test E - Attempt to remove non-existant metadata item by name
-    printNegativeTestHeader(stdout,"psMetadata", "Test E - Attempt to remove non-existant metadata item by name",
-                            "Couldn't find metadata item. Name: AARGH", 0);
-    if( psMetadataRemove(metadata, 0, "AARGH") ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false when removing non-existant item.");
-        return 19;
-    }
-    printFooter(stdout, "psMetadata", "Test E - Attempt to remove non-existant metadata item by name", true);
-
-
-    // Test F - Attempt to remove non-existant metadata item by index
-    printNegativeTestHeader(stdout,"psMetadata", "Test E - Attempt to remove non-existant metadata item by index",
-                            "Couldn't find metadata item in list. Index: 22", 0);
-    if( psMetadataRemove(metadata, 22, NULL) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false when removing non-existant item.");
-        return 20;
-    }
-    printFooter(stdout, "psMetadata", "Test E - Attempt to remove non-existant metadata item by index", true);
-
-
-    // Test G - Attempt to add item to an invalid metadata structure
-    printNegativeTestHeader(stdout,"psMetadata","Test G - Attempt to add item to metadata w/o hash table",
-                            "Couldn't add item to invalid metadata structure.",0);
-    errMetadata = psMetadataAlloc();
-    mdTable = errMetadata->hash;
-    errMetadata->hash = NULL;
-    if ( psMetadataAddItem(errMetadata, item3, PS_LIST_HEAD, PS_META_DEFAULT) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table.");
-        return 21;
-    }
-    if ( psMetadataRemove(errMetadata, PS_LIST_HEAD, "errItem") ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false w/ invalid metadata struct w/o hash table.");
-        return 31;
-    }
-    errMetadata->hash = mdTable;
-    printFooter(stdout,"psMetadata","Test G - Attempt to add item to invalid metadata w/o hash table", true);
-
-    // Test H - Attempt to add item to an invalid metadata structure
-    printNegativeTestHeader(stdout,"psMetadata","Test H - Attempt to add item to metadata w/o link list",
-                            "Couldn't add item to invalid metadata structure.",0);
-    mdList = errMetadata->list;
-    errMetadata->list = NULL;
-    if ( psMetadataAddItem(errMetadata, item3, PS_LIST_HEAD, PS_META_DEFAULT) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o link list.");
-        return 22;
-    }
-    if ( psMetadataRemove(errMetadata, PS_LIST_HEAD, "errItem") ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataRemove did not return false w/ invalid metadata struct w/o link list.");
-        return 32;
-    }
-    errMetadata->list = mdList;
-    printFooter(stdout,"psMetadata","Test H - Attempt to add item to invalid metadata w/o link list", true);
-
-    // Test I - Attempt to add item with a null name
-    printNegativeTestHeader(stdout,"psMetadata","Test I - Attempt to add item with null name",
-                            "Couldn't add item with null name.",0);
-    errName = errItem->name;
-    errItem->name = NULL;
-    if ( psMetadataAddItem(errMetadata, errItem, PS_LIST_HEAD, PS_META_DEFAULT) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false with item with null name.");
-        return 23;
-    }
-    errItem->name = errName;
-    printFooter(stdout,"psMetadata","Test I - Attempt to add item with null name", true);
-
-    // Test J - Attempt to add item to an invalid metadata structure
-    printNegativeTestHeader(stdout,"psMetadata","Test J - Attempt to add item to metadata w/o hash table",
-                            "Couldn't add item to invalid metadata structure.",0);
-    mdTable = errMetadata->hash;
-    errMetadata->hash = NULL;
-    if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_DATA_S32, "Integer",22) ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table.");
-        return 24;
-    }
-    errMetadata->hash = mdTable;
-    printFooter(stdout,"psMetadata","Test J - Attempt to add item to invalid metadata w/o hash table", true);
-
-    // Test K - Free psMetadata
-    printPositiveTestHeader(stdout, "psMetadata", "Test K - Free psMetadata");
-    psFree(metadata);
-    psFree(item1);
-    psFree(item2);
-    psFree(item3);
-    psFree(item4);
-    psFree(errItem);
-    psFree(errMetadata);
-    if( psMemCheckLeaks(0, NULL, stdout,false) != 0 ) {
-        psError(PS_ERR_UNKNOWN, true,"Memory leaks detected.");
-        return 25;
-    }
-    psMemCheckCorruption(0);
-    psS32 nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-    }
-    printFooter(stdout, "psMetadata", "Test K - Free psMetadata", true);
-
-
-    return 0;
-}
Index: trunk/psLib/test/types/tst_psMetadata_04.c
===================================================================
--- trunk/psLib/test/types/tst_psMetadata_04.c	(revision 41166)
+++ 	(revision )
@@ -1,332 +1,0 @@
-/** @file  tst_psMetadata_04.c
- *
- *  @brief Test driver for psMetadata functions
- *
- *  This test driver contains the following tests for psMetadata:
- *     Test A - Allocate metadata and items
- *     Test B - Lookup metadata item by name
- *     Test C - Attempt to use null metadata
- *     Test D - Attempt to use null key
- *     Test E - Attempt to lookup non-existant metadata item
- *     Test F - Lookup metadata item by index
- *     Test G - Lookup metadata item and return psS32 value
- *     Test H - Lookup metadata item and return psF64 value
- *     Test I - Lookup metadata item and return psVector pointer
- *     Test J - Lookup metadata item and return psMetadata pointer
- *     Test K - Lookup metadata item and return psString value
- *     Test L - Attempt to use null metadata
- *     Test M - Attempt to get non-existant metadata item
- *     Test N - Attempt to look up with an invalid metadata object
- *     Test O - Attempt get item  with an invalid metadata object
- *     Test P - Attempt get value of non-existant metadata item
- *     Test Q - Free psMetadata
- *
- *  @author  Ross Harman, MHPCC
- *
- *  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2006-02-03 00:12:02 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- */
-
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static void printMetadataItem(psMetadataItem *metadataItem)
-{
-    printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key mdType: 0x%08x  ", metadataItem->type);
-
-    switch (metadataItem->type) {
-    case PS_DATA_METADATA_MULTI:
-        printf("Key Value: %17c", ' ');
-        break;
-    case PS_DATA_BOOL:
-        printf("Key Value: %15d  ", metadataItem->data.B);
-        break;
-    case PS_DATA_S32:
-        printf("Key Value: %15d  ", metadataItem->data.S32);
-        break;
-    case PS_DATA_F32:
-        printf("Key Value: %15.3f  ", metadataItem->data.F32);
-        break;
-    case PS_DATA_F64:
-        printf("Key Value: %15.3f  ", metadataItem->data.F64);
-        break;
-    case PS_DATA_STRING:
-        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
-        break;
-    default:
-        printf("Bad type: %d ", metadataItem->type);
-    }
-    printf("Key Comment: %s\n", metadataItem->comment);
-}
-
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psBool status = 0;
-    psMetadataItem *item1 = NULL;
-    psMetadataItem *item2 = NULL;
-    psMetadataItem *item3 = NULL;
-    psMetadataItem *item4 = NULL;
-    psMetadataItem *item5 = NULL;
-    psMetadataItem *item6 = NULL;
-    psMetadataItem *item7 = NULL;
-    psMetadataItem *item8 = NULL;
-    psMetadataItem *item = NULL;
-    psMetadata *metadata = NULL;
-    psMetadata *newMD = NULL;
-    char string[50];
-    psHash* tmpTable = NULL;
-    psList* tmpList = NULL;
-
-
-    // Test A - Allocate metadata and items
-    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
-    psVector *vec = psVectorAlloc(5, PS_TYPE_S32);
-    metadata = psMetadataAlloc();
-    newMD = psMetadataAlloc();
-    strncpy(string, "String was here", 50);
-    psMetadataAddF64(newMD, PS_LIST_HEAD, "yourItem1", 0, "I am a psF64", 4.14);
-    item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66);
-    item5 = psMetadataItemAlloc("myItem5", PS_DATA_F64, "I am a double", 3.14);
-    item6 = psMetadataItemAlloc("myItem6", PS_DATA_VECTOR, "I am a vector", vec);
-    item7 = psMetadataItemAlloc("myItem7", PS_DATA_METADATA, "I am a metadata", newMD);
-    item8 = psMetadataItemAlloc("myItem8", PS_DATA_STRING, "I am a string", string);
-    printMetadataItem(item1);
-    printMetadataItem(item2);
-    printMetadataItem(item3);
-    printMetadataItem(item4);
-    printMetadataItem(item5);
-    psMetadataAddItem(metadata, item1, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item2, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item3, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item4, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item5, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item6, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item7, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item8, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMemDecrRefCounter(vec); // vs. psFree, which now would set vec to NULL (want to keep it to comparison later)
-    printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true);
-
-
-    // Test B - Lookup metadata item by name
-    printPositiveTestHeader(stdout, "psMetadata", "Test B - Lookup metadata item by name");
-    item = psMetadataLookup(metadata, "myItem2");
-    printf("Found item named %s\n", item->name);
-    if(item == NULL) {
-        printf("ERROR: Item should not be null\n");
-        return 10;
-    }
-    printFooter(stdout, "psMetadata", "Test B - Lookup metadata item by name", true);
-
-
-    // Test C - Attempt to use null metadata
-    printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to use null metadata",
-                            "Null metadata collection not allowed", 0);
-    if ( psMetadataLookup(NULL, "myItem2") != NULL ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataLookup did not return NULL with null metadata.");
-        return 11;
-    }
-    printFooter(stdout, "psMetadata", "Test C - Attempt to use null metadata", true);
-
-
-    // Test D - Attempt to use null key
-    printNegativeTestHeader(stdout,"psMetadata", "Test D - Attempt to use null key",
-                            "Null key name not allowed", 0);
-    if ( psMetadataLookup(metadata, NULL) != NULL ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadata did not return NULL with null key.");
-        return 12;
-    }
-    printFooter(stdout, "psMetadata", "Test D - Attempt to use null key", true);
-
-
-    // Test E - Attempt to lookup non-existant metadata item
-    printNegativeTestHeader(stdout,"psMetadata", "Test E - Attempt to lookup non-existant metadata item",
-                            "Couldn't find metadata item. Name: AARGH", 0);
-    if ( psMetadataLookup(metadata, "AARGH") != NULL ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadata did not return NULL with a non-existant item.");
-        return 13;
-    }
-    printFooter(stdout, "psMetadata", "Test E - Attempt to lookup non-existant metadata item", true);
-
-
-    // Test F - Lookup metadata item by index
-    printPositiveTestHeader(stdout, "psMetadata", "Test F - Lookup metadata item by index");
-    item = psMetadataGet(metadata, 0);
-    printf("Found item named %s\n", item->name);
-    if(item == NULL) {
-        printf("ERROR: Item should not be null\n");
-        return 14;
-    }
-    printFooter(stdout, "psMetadata", "Test F - Lookup metadata item by index", true);
-
-    // Test G - Lookup metadata item and return psS32 value
-    printPositiveTestHeader(stdout, "psMetadata", "Test G - Lookup metadata item and return psS32 value");
-    psS32 valueS32 = 0;
-    valueS32 = psMetadataLookupS32(&status, metadata, "myItem2");
-    if(valueS32 != 55) {
-        printf("ERROR: Bad value, %d, Expected 55\n", valueS32);
-        return 15;
-    } else if(! status) {
-        printf("ERROR: Bad status, %d\n", status);
-        return 15;
-    }
-    printFooter(stdout, "psMetadata", "Test G - Lookup metadata item and return psS32 value", true);
-
-    // Test H - Lookup metadata item and return psF64 value
-    printPositiveTestHeader(stdout, "psMetadata", "Test H - Lookup metadata item and return psF64 value");
-    psF64 valueF64 = 0.0;
-    valueF64 = psMetadataLookupF64(&status, metadata, "myItem5");
-    if(fabs(valueF64-3.14) > FLT_EPSILON) {
-        printf("ERROR: Bad value, %g, Expected 3.14\n", valueF64);
-        return 16;
-    } else if(! status) {
-        printf("ERROR: Bad status, %d\n", status);
-        return 16;
-    }
-    printFooter(stdout, "psMetadata", "Test H - Lookup metadata item and return psF64 value", true);
-
-    // Test I - Lookup metadata item and return psVector pointer
-    printPositiveTestHeader(stdout, "psMetadata", "Test I - Lookup metadata item and return psVector pointer");
-    psVector *valueVec = psMetadataLookupPtr(&status, metadata, "myItem6");
-    if(valueVec != vec) {
-        printf("ERROR: Bad vector pointer\n");
-        return 17;
-    } else if(! status) {
-        printf("ERROR: Bad status, %d\n", status);
-        return 17;
-    }
-    printFooter(stdout, "psMetadata", "Test I - Lookup metadata item and return psVector pointer", true);
-
-    // Test J - Lookup metadata item and return psMetadata pointer
-    printPositiveTestHeader(stdout, "psMetadata", "Test J - Lookup metadata item and return psMetadata pointer");
-    psMetadata *metaData = NULL;
-    metaData = psMetadataLookupMD(&status, metadata, "myItem7");
-    if(metaData != newMD) {
-        printf("ERROR: Bad metadata pointer\n");
-        return 25;
-    } else if(! status) {
-        printf("ERROR: Bad status, %d\n", status);
-        return 25;
-    }
-    printFooter(stdout, "psMetadata", "Test J - Lookup metadata item and return psMetadata pointer", true);
-
-    // Test K - Lookup metadata item and return psString value
-    printPositiveTestHeader(stdout, "psMetadata", "Test K - Lookup metadata item and return psString value");
-    psString newSTR;
-    newSTR = psMetadataLookupStr(&status, metadata, "myItem8");
-    if( strncmp(newSTR, string, 50) ) {
-        printf("ERROR: Bad string value \n");
-        return 26;
-    } else if(! status) {
-        printf("ERROR: Bad status, %d\n", status);
-        return 26;
-    }
-    printFooter(stdout, "psMetadata", "Test K - Lookup metadata item and return psString value", true);
-
-    // Test L - Attempt to use null metadata
-    printNegativeTestHeader(stdout,"psMetadata", "Test L - Attempt to use null metadata",
-                            "Null metadata collection not allowed", 0);
-    item = psMetadataGet(NULL, 0);
-    if ( item != NULL ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataGet did not return NULL with null metadata structure");
-        return 18;
-    }
-    printFooter(stdout, "psMetadata", "Test L - Attempt to use null metadata", true);
-
-
-    // Test M - Attempt to get non-existant metadata item
-    printNegativeTestHeader(stdout,"psMetadata", "Test M - Attempt to get non-existant metadata item",
-                            "Couldn't find metadata item with given index. Index: 22", 0);
-    if ( psMetadataGet(metadata, 22) != NULL ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataGet did not return NULL with non-existant metadata item");
-        return 19;
-    }
-    printFooter(stdout, "psMetadata", "Test M - Attempt to get non-existant metadata item", true);
-
-    // Test N - Attempt to look up with an invalid metadata object
-    printNegativeTestHeader(stdout,"psMetadata","Test N - Attemp to look up with an invalid metadata",
-                            "Lookup item with invalid metadata object.", 0 );
-    tmpTable = metadata->hash;
-    metadata->hash = NULL;
-    if ( psMetadataLookup(metadata,"myItem2") != NULL ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataLookup did not return null for invalid metadata object");
-        return 20;
-    }
-    metadata->hash = tmpTable;
-    printFooter(stdout, "psMetadata","Test N - Attempt to lookup an invalid metadata object.",true);
-
-    // Test O - Attempt get item with an invalid metadata object
-    printNegativeTestHeader(stdout,"psMetadata","Test O - Attempt to get item with an invalid metadata",
-                            "Get item with invalid metadata object.", 0 );
-    tmpList = metadata->list;
-    metadata->list = NULL;
-    if ( psMetadataGet(metadata,0) != NULL ) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataLookup did not return null for invalid metadata object");
-        return 21;
-    }
-    metadata->list = tmpList;
-    printFooter(stdout, "psMetadata","Test O - Attempt to get item with  invalid metadata object",true);
-
-    // Test P - Attempt get psS32 value of non-existant metadata item
-    printPositiveTestHeader(stdout, "psMetadata", "Test P - Attempt get psS32 value of non-existant metadata item");
-    valueS32 = psMetadataLookupS32(&status, metadata, "myItem22");
-    if(status) {
-        printf("ERROR: Bad status, %d, \n", status);
-        return 22;
-    }
-    printFooter(stdout, "psMetadata","Test P - Attempt get psS32 value of non-existant metadata item",true);
-
-    // Test P - Attempt get psF64 value of non-existant metadata item
-    printPositiveTestHeader(stdout, "psMetadata", "Test P - Attempt get psF64 value of non-existant metadata item");
-    valueF64 = psMetadataLookupF64(&status, metadata, "myItem22");
-    if(status) {
-        printf("ERROR: Bad status, %d, \n", status);
-        return 23;
-    }
-    printFooter(stdout, "psMetadata","Test P - Attempt get psF64 value of non-existant metadata item",true);
-
-    // Test P - Attempt get psVector value of non-existant metadata item
-    printPositiveTestHeader(stdout, "psMetadata", "Test P - Attempt get psVector value of non-existant metadata item");
-    valueVec = psMetadataLookupPtr(&status, metadata, "myItem22");
-    if(status) {
-        printf("ERROR: Bad status, %d, \n", status);
-        return 24;
-    }
-    printFooter(stdout, "psMetadata","Test P - Attempt get psVector value of non-existant metadata item",true);
-
-    // Test Q - Free psMetadata
-    printPositiveTestHeader(stdout, "psMetadata", "Test Q - Free psMetadata");
-    //    psFree(string);
-    psFree(newMD);
-    psFree(item1);
-    psFree(item2);
-    psFree(item3);
-    psFree(item4);
-    psFree(item5);
-    psFree(item6);
-    psFree(item7);
-    psFree(item8);
-    psFree(metadata);
-    if ( psMemCheckLeaks(0, NULL, stdout,false) != 0 ) {
-        psError(PS_ERR_UNKNOWN, true,"memory leaks detected.");
-        return 23;
-    }
-    psMemCheckCorruption(0);
-    psS32 nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-        return 24;
-    }
-    printFooter(stdout, "psMetadata", "Test Q - Free psMetadata", true);
-
-
-    return 0;
-}
Index: trunk/psLib/test/types/tst_psMetadata_05.c
===================================================================
--- trunk/psLib/test/types/tst_psMetadata_05.c	(revision 41166)
+++ 	(revision )
@@ -1,342 +1,0 @@
-
-
-/** @file  tst_psMetadata_05.c
-*
-*  @brief Test driver for psMetadata functions
-*
-*  This test driver contains the following tests for psMetadata:
-*     Test A - Allocate metadata and items
-*     Test B - Set iterator at second index
-*     Test C - Get next item at index
-*     Test D - Get next item at index and string
-*     Test E - Get previous item at index
-*     Test F - Write metadata item to file
-*     Test G - Attempt to use null metadata with setIterator
-*     Test H - Attempt to use null metadata with getNext
-*     Test I - Attempt to use null metadata with getPrevious
-*     Test J - Attempt to use null file with itemPrint
-*     Test K - Attempt to use null format with itemPrint
-*     Test L - Attempt to use null item with itemPrint
-*     Test M - Free psMetadata
-*
-*  @author  Ross Harman, MHPCC
-*
-*  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-09-26 21:13:33 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*
-*/
-
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static void printMetadataItem(psMetadataItem *metadataItem)
-{
-    printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key mdType: 0x%08x  ", metadataItem->type);
-
-    switch (metadataItem->type) {
-    case PS_DATA_METADATA_MULTI:
-        printf("Key Value: %17c", ' ');
-        break;
-    case PS_DATA_BOOL:
-        printf("Key Value: %15d  ", metadataItem->data.B);
-        break;
-    case PS_DATA_S32:
-        printf("Key Value: %15d  ", metadataItem->data.S32);
-        break;
-    case PS_DATA_F32:
-        printf("Key Value: %15.3f  ", metadataItem->data.F32);
-        break;
-    case PS_DATA_F64:
-        printf("Key Value: %15.3f  ", metadataItem->data.F64);
-        break;
-    case PS_DATA_STRING:
-        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
-        break;
-    default:
-        printf("Bad type: %d ", metadataItem->type);
-    }
-    printf("Key Comment: %s\n", metadataItem->comment);
-}
-
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psMetadataItem *item1 = NULL;
-    psMetadataItem *item2 = NULL;
-    psMetadataItem *item3 = NULL;
-    psMetadataItem *item4 = NULL;
-    psMetadataItem *item5 = NULL;
-    psMetadataItem *item6 = NULL;
-    psMetadataItem *item7 = NULL;
-    //    psMetadataItem *item8 = NULL;
-    psMetadata *metadata = NULL;
-    FILE *fd = NULL;
-
-    // Test A - Allocate metadata and items
-    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
-    metadata = psMetadataAlloc();
-    item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66);
-    item5 = psMetadataItemAlloc("myItem5", PS_DATA_F32, "I am a float", 3.14);
-    item6 = psMetadataItemAlloc("myItem6", PS_DATA_F64,"I am a double", 6.28);
-    item7 = psMetadataItemAlloc("myItem7", PS_DATA_STRING, "I am a string", "GNIRTS");
-    //    item8 = psMetadataItemAlloc("myItem8", PS_TYPE_PTR, PS_META_UNKNOWN, "I am unknown");
-    printMetadataItem(item1);
-    printMetadataItem(item2);
-    printMetadataItem(item3);
-    printMetadataItem(item4);
-    psMetadataAddItem(metadata, item1, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item2, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item3, PS_LIST_HEAD, PS_META_DEFAULT);
-    psMetadataAddItem(metadata, item4, PS_LIST_HEAD, PS_META_DEFAULT);
-    printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true);
-
-    /*
-        // Test B - Set iterator at second index
-        printPositiveTestHeader(stdout, "psMetadata", "Test B - Set iterator at second index");
-        if (!psMetadataSetIterator(metadata, 2)) {
-            psError(PS_ERR_UNKNOWN,true,"Failed to set iterator");
-            return 100;
-        }
-        printFooter(stdout, "psMetadata", "Test B - Set iterator at second index", true);
-
-
-        // Test C - Get next item at index
-        printPositiveTestHeader(stdout, "psMetadata", "Test C - Get next item at index");
-        item = psMetadataGetNext(metadata, NULL, 2);
-        if(item == NULL) {
-            printf("ERROR: Item should not be null\n");
-        } else {
-            printf("Found item named %s\n", item->name);
-        }
-        printFooter(stdout, "psMetadata", "Test C - Get next item at index", true);
-
-
-        // Test D - Get next item at index and string
-        printPositiveTestHeader(stdout, "psMetadata", "Test D - Get next item at index and string");
-        item = psMetadataGetNext(metadata, "myItem1", 1);
-        if(item == NULL) {
-            printf("ERROR: Item should not be null\n");
-        } else {
-            printf("Found item named %s\n", item->name);
-        }
-        printFooter(stdout, "psMetadata", "Test D - Get next item at index and string", true);
-
-
-        // Test E - Get previous item at index
-        printPositiveTestHeader(stdout, "psMetadata", "Test E - Get previous item at index");
-        item = psMetadataGetPrevious(metadata, NULL, 1);
-        if(item == NULL) {
-            printf("ERROR: Item should not be null\n");
-        } else {
-            printf("Found item named %s\n", item->name);
-        }
-        if( psMetadataGetPrevious(metadata,"myItem3",1) == NULL) {
-            psError(PS_ERR_UNKNOWN, true,"psMetadataGetPrevious did not return an item from metadata.");
-            return 45;
-        }
-        tmpList = metadata->list;
-        metadata->list = NULL;
-        if ( psMetadataGetPrevious(metadata,NULL,1) != NULL) {
-            psError(PS_ERR_UNKNOWN, true,"psMetadataGetPrevious did not return null for invalid metadata.");
-            return 50;
-        }
-        metadata->list = tmpList;
-        printFooter(stdout, "psMetadata", "Test E - Get previous item at index", true);
-
-    */
-    // Test F - Write metadata item to file
-    printPositiveTestHeader(stdout, "psMetadata", "Test F - Write metadata item to file");
-    fd = fopen("temp/tst_psMetadata05_OUT", "w");
-    if(fd == NULL) {
-        printf("ERROR: Couldn't open file for writing\n");
-    }
-
-    if (psMetadataItemPrint(fd, "S32 = %ld\n", item2) == false) {
-        printf("ERROR: Return type should be true\n");
-        return 10;
-    }
-
-    if (psMetadataItemPrint(fd, "S32 = %+06.1f\n", item2) == false) {
-        printf("ERROR: Return type should be true\n");
-        return 10;
-    }
-
-    if (psMetadataItemPrint(fd, "BOL = %ld\n", item3) == false) {
-        printf("ERROR: Return type should be true\n");
-        return 11;
-    }
-
-    if (psMetadataItemPrint(fd, "F32 = %g\n", item5) == false) {
-        printf("ERROR: Return type should be true\n");
-        return 12;
-    }
-
-    if (psMetadataItemPrint(fd, "F32 = % #i\n", item5) == false) {
-        printf("ERROR: Return type should be true\n");
-        return 12;
-    }
-
-    if (psMetadataItemPrint(fd, "F64 = %g\n", item6) == false) {
-        printf("ERROR: Return type should be true\n");
-        return 13;
-    }
-
-    if (psMetadataItemPrint(fd, "STR = %s\n", item7) == false) {
-        printf("ERROR: Return type should be true\n");
-        return 14;
-    }
-    //    psLogMsg(__func__,PS_LOG_INFO,"Attempt to print item of invalid type, should generate error message");
-    //    if (psMetadataItemPrint(fd, "UNK = \n", item8) == true) {
-    //        printf("ERROR: Return type should be false\n");
-    //        fclose(fd);
-    //        return 15;
-    //    }
-    fclose(fd);
-
-    fd = fopen("temp/tst_psMetadata05_OUT", "r");
-    if(fd == NULL) {
-        printf("ERROR: Couldn't open file for reading\n");
-    }
-
-    char line[256];
-    char truth1[] = "S32 = 55";
-    fgets(line, 256, fd);
-    if(strncmp(line, truth1, 8)) {
-        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth1);
-    }
-
-    char truth1b[] = "S32 = +055.0";
-    fgets(line, 256, fd);
-    if(strncmp(line, truth1b, 12)) {
-        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth1b);
-    }
-
-    char truth2[] = "BOL = 0";
-    fgets(line, 256, fd);
-    if(strncmp(line, truth2, 7)) {
-        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth2);
-    }
-
-    char truth3[] = "F32 = 3.14";
-    fgets(line, 256, fd);
-    if(strncmp(line, truth3, 10)) {
-        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth3);
-    }
-
-    char truth3b[] = "F32 =  3";
-    fgets(line, 256, fd);
-    if(strncmp(line, truth3b, 8)) {
-        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth3b);
-    }
-
-    char truth4[] = "F64 = 6.28";
-    fgets(line, 256, fd);
-    if(strncmp(line, truth4, 10)) {
-        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth4);
-    }
-
-    char truth5[] = "STR = GNIRTS";
-    fgets(line, 256, fd);
-    if(strncmp(line, truth5, 12)) {
-        printf("ERROR: Data in file is not as expected. Value: %s. Should be: %s\n", line, truth5);
-    }
-
-    fclose(fd);
-    printFooter(stdout, "psMetadata", "Test F - Write metadata item to file", true);
-    /*
-        // Test G - Attempt to use null metadata with setIterator
-        printNegativeTestHeader(stdout,"psMetadata", "Test G - Attempt to use null metadata with setIterator",
-                                "Null metadata collection not allowed", 0);
-        if( psMetadataSetIterator(NULL, 0)) {
-            psError(PS_ERR_UNKNOWN,true,"Set iterator did not detect invalid parameter.");
-            return 101;
-        }
-        tmpList = metadata->list;
-        metadata->list = NULL;
-        if( psMetadataSetIterator(metadata,0)) {
-            psError(PS_ERR_UNKNOWN,true,"Set iterator did not detect null list.");
-            return 102;
-        }
-        metadata->list = tmpList;
-        printFooter(stdout, "psMetadata", "Test G - Attempt to use null metadata with setIterator", true);
-
-
-        // Test H - Attempt to use null metadata with getNext
-        printNegativeTestHeader(stdout,"psMetadata", "Test H - Attempt to use null metadata with getNext",
-                                "Null metadata collection not allowed", 0);
-        if( psMetadataGetNext(NULL, "myItem2", 0) != NULL ) {
-            psError(PS_ERR_UNKNOWN, true,"psMetadataGetNext did not return null for null metadata.");
-            return 40;
-        }
-        tmpList = metadata->list;
-        metadata->list = NULL;
-        if ( psMetadataGetNext(metadata, "myItem2", 0) != NULL ) {
-            psError(PS_ERR_UNKNOWN, true,"psMetadataGetNext did not return null for invalid metadata.");
-            return 41;
-        }
-        metadata->list = tmpList;
-
-        printFooter(stdout, "psMetadata", "Test H - Attempt to use null metadata with getNext", true);
-
-
-        // Test I - Attempt to use null metadata with getPrevious
-        printNegativeTestHeader(stdout,"psMetadata", "Test I - Attempt to use null metadata with getPrevious",
-                                "Null metadata collection not allowed", 0);
-        psMetadataGetPrevious(NULL, "myItem2", 0);
-        printFooter(stdout, "psMetadata", "Test I - Attempt to use null metadata with getPrevious", true);
-
-    */
-    // Test J - Attempt to use null file with itemPrint
-    printNegativeTestHeader(stdout,"psMetadata", "Test J - Attempt to use null file with itemPrint",
-                            "Null file descriptor not allowed", 0);
-    psMetadataItemPrint(NULL, "Item value: %ld", item2);
-    printFooter(stdout, "psMetadata", "Test J - Attempt to use null file with itemPrint", true);
-
-
-    // Test K - Attempt to use null format with itemPrint
-    printNegativeTestHeader(stdout,"psMetadata", "Test K - Attempt to use null format with itemPrint",
-                            "Null format not allowed", 0);
-    psMetadataItemPrint(fd, NULL, item2);
-    printFooter(stdout, "psMetadata", "Test K - Attempt to use null format with itemPrint", true);
-
-
-    // Test L - Attempt to use null item with itemPrint
-    printNegativeTestHeader(stdout,"psMetadata", "Test L - Attempt to use null item with itemPrint",
-                            "Null metadata not allowed", 0);
-    psMetadataItemPrint(fd, "Item value: %ld", NULL);
-    printFooter(stdout, "psMetadata", "Test L - Attempt to use null item with itemPrint", true);
-
-
-    // Test M - Free psMetadata
-    printPositiveTestHeader(stdout, "psMetadata", "Test M - Free psMetadata");
-    psFree(metadata);
-    psFree(item1);
-    psFree(item2);
-    psFree(item3);
-    psFree(item4);
-    psFree(item5);
-    psFree(item6);
-    psFree(item7);
-    //    psFree(item8);
-    if ( psMemCheckLeaks(0, NULL, stdout, false) != 0 ) {
-        psError(PS_ERR_UNKNOWN, true,"Memory leaks detected.");
-        return 50;
-    }
-    psMemCheckCorruption(0);
-    psS32 nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-        return 51;
-    }
-    printFooter(stdout, "psMetadata", "Test M - Free psMetadata", true);
-
-
-    return 0;
-}
Index: trunk/psLib/test/types/tst_psMetadata_06.c
===================================================================
--- trunk/psLib/test/types/tst_psMetadata_06.c	(revision 41166)
+++ 	(revision )
@@ -1,166 +1,0 @@
-
-/** @file  tst_psMetadata_06.c
-*
-*  @brief Test driver for psMetadata functions
-*
-*  This test driver contains the following tests for psMetadata:
-*     Test A - Allocate metadata and items
-*     Test B - Add leaf node on top of existing leaf node
-*     Test C - Add leaf node to existing folder node
-*     Test D - Add folder node on top of existing leaf node
-*     Test E - Free psMetadata
-*
-*  @author  Ross Harman, MHPCC
-*
-*  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-09-26 21:13:33 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*
-*/
-
-#include <string.h>
-#include "pslib_strict.h"
-#include "psTest.h"
-
-static void printMetadataItem(psMetadataItem *metadataItem)
-{
-    printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key mdType: 0x%08x  ", metadataItem->type);
-
-    switch (metadataItem->type) {
-    case PS_DATA_METADATA_MULTI:
-        printf("Key Value: %17c", ' ');
-        break;
-    case PS_DATA_LIST:
-        printf("Key Value: %15s  ", "psList");
-        break;
-    case PS_DATA_BOOL:
-        printf("Key Value: %15d  ", metadataItem->data.B);
-        break;
-    case PS_DATA_S32:
-        printf("Key Value: %15d  ", metadataItem->data.S32);
-        break;
-    case PS_DATA_F32:
-        printf("Key Value: %15.3f  ", metadataItem->data.F32);
-        break;
-    case PS_DATA_F64:
-        printf("Key Value: %15.3f  ", metadataItem->data.F64);
-        break;
-    case PS_DATA_STRING:
-        printf("Key Value: %15s  ", (char*)metadataItem->data.V);
-        break;
-    default:
-        printf("Bad type: %d ", metadataItem->type);
-    }
-    printf("Key Comment: %s\n", metadataItem->comment);
-}
-
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psMetadataItem *item1a = NULL;
-    psMetadataItem *item1b = NULL;
-    psMetadataItem *item1c = NULL;
-    psMetadataItem *item2a = NULL;
-    psMetadataItem *item2b = NULL;
-    psMetadata *metadata = NULL;
-
-
-    // Test A - Allocate metadata and items
-    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata and items");
-    item1a = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true);
-    item1b = psMetadataItemAlloc("myItem1", PS_DATA_S32, "I am a signed integer", 111);
-    item1c = psMetadataItemAlloc("myItem1", PS_DATA_S32, "I am a signed integer", 222);
-    item2a = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a signed integer", 333);
-    item2b = psMetadataItemAlloc("myItem2", PS_DATA_LIST, "I am a list", NULL);
-    metadata = psMetadataAlloc();
-    printMetadataItem(item1a);
-    printMetadataItem(item1b);
-    printMetadataItem(item1c);
-    printMetadataItem(item2a);
-    printMetadataItem(item2b);
-    printFooter(stdout, "psMetadata", "Test A - Allocate metadata and items", true);
-
-
-    // Test B - Add leaf node on top of existing leaf node
-    printPositiveTestHeader(stdout, "psMetadata", "Test B - replace an item in the metadata");
-    if(!psMetadataAddItem(metadata, item1a, PS_LIST_HEAD, PS_META_DEFAULT)) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem returned false for adding a node top.");
-        return 20;
-    }
-    psMetadataItem* tempItem = psMetadataLookup(metadata, item1a->name);
-    if (tempItem != item1a) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add the metadata entry.");
-        return 20;
-    }
-
-    if (!psMetadataAddItem(metadata, item1b, PS_LIST_HEAD, PS_META_REPLACE)) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem returned false for adding a node top.");
-        return 21;
-    }
-
-    tempItem = psMetadataLookup(metadata, item1a->name);
-    if (tempItem != item1b) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't replace the metadata entry.");
-        return 21;
-    }
-
-    printFooter(stdout, "psMetadata", "Test B - replace an item in the metadata", true);
-
-
-    // Test C - Add leaf node to existing folder node
-    printPositiveTestHeader(stdout, "psMetadata", "Test C - add duplicate-key metadata item");
-    if (!psMetadataAddItem(metadata, item1c, PS_LIST_HEAD, PS_META_DUPLICATE_OK)) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem return false for adding a not to existing node.");
-        return 22;
-    }
-
-    tempItem = psMetadataLookup(metadata, item1a->name);
-    if (tempItem == NULL || tempItem->type != PS_DATA_METADATA_MULTI) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add additional metadata entry of same key.");
-        return 22;
-    }
-    printFooter(stdout, "psMetadata", "Test C - add duplicate-key metadata item", true);
-
-
-    // Test D - Add folder node on top of existing leaf node
-    printPositiveTestHeader(stdout, "psMetadata", "Test D - Add folder node on top of existing leaf node");
-    if (!psMetadataAddItem(metadata, item2a, PS_LIST_HEAD, PS_META_DEFAULT)) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem returned false for adding a node to existing leaf node.");
-        return 23;
-    }
-    if (!psMetadataAddItem(metadata, item2b, PS_LIST_HEAD, PS_META_DUPLICATE_OK)) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem returned false for adding a nod to existing leaf node.");
-        return 24;
-    }
-    printFooter(stdout, "psMetadata", "Test D - Add folder node on top of existing leaf node", true);
-    tempItem = psMetadataLookup(metadata, item1a->name);
-    if (tempItem == NULL || tempItem->type != PS_DATA_METADATA_MULTI) {
-        psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add additional metadata entry of same key.");
-        return 24;
-    }
-
-
-    // Test E - Free psMetadata
-    printPositiveTestHeader(stdout, "psMetadata", "Test E - Free psMetadata");
-    psFree(item1a);
-    psFree(item1b);
-    psFree(item1c);
-    psFree(item2a);
-    psFree(item2b);
-    psFree(metadata);
-    if ( psMemCheckLeaks(0, NULL, stdout, false) != 0 ) {
-        psError(PS_ERR_UNKNOWN, true,"Memory leaks detected.");
-        return 25;
-    }
-    psMemCheckCorruption(0);
-    psS32 nBad = psMemCheckCorruption(0);
-    if(nBad) {
-        printf("ERROR: Found %d bad memory blocks\n", nBad);
-    }
-    printFooter(stdout, "psMetadata", "Test E - Free psMetadata", true);
-
-
-    return 0;
-}
Index: trunk/psLib/test/types/tst_psMetadata_07.c
===================================================================
--- trunk/psLib/test/types/tst_psMetadata_07.c	(revision 41166)
+++ 	(revision )
@@ -1,362 +1,0 @@
-/** @file  tst_psMetadata_07.c
-*
-*  @brief Test driver for psMetadataIterator functions
-*
-*  This test driver contains the following tests for psMetadata:
-*     Test A - Allocate a psMetadataIterator
-*     Test B - Set a psMetadataIterator
-*     Test C - Get and Increment a psMetadataIterator
-*     Test D - Get and Decrement a psMetadataIterator
-*     Test E - psMetadataConfigWrite (also tests psMetadataConfigFormat)
-*     Test F - psMetadataRemoveKey, RemoveIndex
-*     Test G - psMetadataAddPtr, psMetadataItemAllocPtr
-*     Test H - psMetadataCopy
-*     Test I - psArgument Functions
-*
-*  @author  David Robbins, MHPCC
-*
-*  @version $Revision: 1.22 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2006-05-03 01:10:09 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*
-*/
-#include "config.h"
-#include "pslib_strict.h"
-#include "psTest.h"
-//#include "psMetadata.h"
-
-static psS32 testMetaIter(void);
-static psS32 testMetaWrite(void);
-static psS32 testMetaRemove(void);
-static psS32 testMetaAddPtr(void);
-static psS32 testMetaCopy(void);
-
-testDescription tests[] = {
-                              {testMetaIter, 1, "Test psMetadataIterator fxns", 0, false},
-                              {testMetaWrite, 2, "Test psMetadataConfigWrite", 0, false},
-                              {testMetaRemove, 3, "Test psMetadataRemoveKey/Index", 0, false},
-                              {testMetaAddPtr, 4, "Test psMetadataAddPtr", 0, false},
-                              {testMetaCopy, 5, "Test psMetadataCopy", 0, false},
-                              {NULL}
-                          };
-
-static psMetadata *setupMeta(void);
-
-static psMetadata *setupMeta(void)
-{
-    psMetadata *md = NULL;
-    psVector *vec = NULL;
-    psMetadata *newMD = NULL;
-    psTime *time;
-    int i = 0;
-    md = psMetadataAlloc();
-    newMD = psMetadataAlloc();
-    vec = psVectorAlloc(60, PS_DATA_S32);
-    time = psTimeAlloc(PS_TIME_TAI);
-    for (i = 0; i < 5; i++) {
-        vec->data.S32[i] = i+1;
-    }
-    vec->n = 5;
-    time->sec = 1000;
-    time->nsec = 25;
-    time->leapsecond = true;
-    psMetadataAddBool(md, PS_LIST_TAIL, "item1", 0, "I am a boolean", true);
-    psMetadataAddS32(md, PS_LIST_TAIL, "item2", 0, "", 55);
-    psMetadataAddF32(md, PS_LIST_TAIL, "item3", 0, NULL, 3.14);
-    psMetadataAddF64(md, PS_LIST_TAIL, "item4", 0, "", 6.28);
-    psMetadataAddStr(md, PS_LIST_TAIL, "item5", 0, "I am a string", "GNIRTS");
-    psMetadataAddVector(md, PS_LIST_TAIL, "vector6", 0, "I am a vector", vec);
-    psMetadataAddTime(md, PS_LIST_TAIL, "time01", 0, "I am time", time);
-
-    psMetadataAddS32(newMD, PS_LIST_TAIL, "ITEM01", 0, NULL, 666);
-    psMetadata *newestMD = NULL;
-    newestMD = psMetadataAlloc();
-    psMetadataAddVector(newestMD, PS_LIST_TAIL, "VECTORNEW", 0, "Newest VECTOR", vec);
-    psMetadataAddStr(newestMD, PS_LIST_TAIL, "cell", 0, "I am a p-Star", "pStArRs");
-    psMetadataAddMetadata(newMD, PS_LIST_TAIL, "META NEW", 0, "I AM Newest METADATA", newestMD);
-    psMetadataAddF32(newMD, PS_LIST_TAIL, "ITEM02", 0, "I AM FLOAT", 666.6);
-    psMetadataAddF64(newMD, PS_LIST_TAIL, "ITEM03", 0, "I AM DOUBLE", 666.666);
-
-    psMetadataAddMetadata(md, PS_LIST_TAIL, "metadata7", 0, "I am a metadata", newMD);
-    psFree(time);
-    psFree(newestMD);
-    psFree(vec);
-    psFree(newMD);
-    return md;
-}
-
-int main(int argc, char* argv[])
-{
-    psLogSetLevel( PS_LOG_INFO );
-    if( !runTestSuite(stderr,"psMetadata_07",tests,argc,argv)) {
-        return 1;
-    }
-    return 0;
-}
-
-//Set a psMetadataIterator //
-static psS32 testMetaIter(void)
-{
-    psMetadata *metadata = NULL;
-    metadata = setupMeta();
-    psMetadataIterator *iter = NULL;
-    psMetadataItem *item1 = NULL;
-    psMetadataItem *item2 = NULL;
-    psMetadataItem *item3 = NULL;
-    printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate psMetadataIterator");
-    iter = psMetadataIteratorAlloc(metadata, PS_LIST_HEAD, NULL);
-    if (iter == NULL) {
-        fprintf(stderr, "Failed test point - Allocate a psMetadataIterator.  Iterator NULL. \n");
-    }
-    printFooter(stdout, "psMetadata", "Test A - Allocate psMetadataIterator", true);
-    printPositiveTestHeader(stdout, "psMetadata", "Test B - Set psMetadataIterator");
-    psMetadataIteratorSet(iter, 2);
-    item1 = psMetadataGetAndIncrement(iter);
-    if ( !strncmp(item1->name, "item2", 20) ) {
-        fprintf(stderr, "Failed test point - IteratorSet - Item names don't match. \n");
-    }
-    printFooter(stdout, "psMetadata", "Test B - Set psMetadataIterator", true);
-    printPositiveTestHeader(stdout, "psMetadata", "Test C - Get and Increment Iterator");
-    item2 = psMetadataGetAndDecrement(iter);
-    if ( !strncmp(item2->name, "item3", 20) ) {
-        fprintf(stderr, "Failed test point - GetAndIncrement - Item names don't match. \n");
-    }
-    printFooter(stdout, "psMetadata", "Test C - Get and Increment Iterator", true);
-    printPositiveTestHeader(stdout, "psMetadata", "Test D - Get and Decrement Iterator");
-    item3 = psMetadataGetAndDecrement(iter);
-    if ( !strncmp(item3->name, "item2", 20) ) {
-        fprintf(stderr, "Failed test point - GetAndDecrement - Item names don't match. \n");
-    }
-    printFooter(stdout, "psMetadata", "Test D - Get and Decrement Iterator", true);
-    psFree(iter);
-    psFree(metadata);
-    return 0;
-}
-
-static psS32 testMetaWrite(void)
-{
-    psMetadata *newMD = NULL;
-    //Return false for NULL input metadata
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psMetadataConfigWrite(newMD, "mdcfgwrt.out")) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psMetadataConfigWrite failed to return false for NULL input metadata.\n");
-        return 1;
-    }
-    newMD = setupMeta();
-    //Return false for NULL input filename
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psMetadataConfigWrite(newMD, NULL)) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psMetadataConfigWrite failed to return false for NULL input filename.\n");
-        return 2;
-    }
-    //Return false for bad input filename
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psMetadataConfigWrite(newMD, "temp")) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, false,
-                "psMetadataConfigWrite failed to return false for bad input filename.\n");
-        return 3;
-    }
-    //Return true for valid inputs
-    if ( !psMetadataConfigWrite(newMD, "mdcfgwrt.out") ) {
-        fprintf(stderr, "Failed test point E - Failed to write metadata to file. \n");
-        return 4;
-    }
-
-    //Make sure the output file matches the verified file output.
-    FILE *verified;
-    FILE *output;
-    verified = fopen("mdcfgwrt.verified", "r");
-    output = fopen("mdcfgwrt.out", "r");
-    char buffer1[100];
-    char buffer2[100];
-    while ( fscanf(verified, "%s", buffer1) != EOF ) {
-        if (fscanf(output, "%s", buffer2) == EOF) {
-            psError(PS_ERR_BAD_PARAMETER_SIZE, false,
-                    "Output file is smaller than the expected output file.\n");
-            return 5;
-        }
-        if (strncmp(buffer1, buffer2, 100) ) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                    "Output file contents do not match the expected output.\n");
-            return 6;
-        }
-    }
-    if (fscanf(output, "%s", buffer2) != EOF) {
-        psError(PS_ERR_BAD_PARAMETER_SIZE, false,
-                "Output file is larger than the expected output file.\n");
-        return 7;
-    }
-    fclose(verified);
-    fclose(output);
-
-    psFree(newMD);
-    return 0;
-}
-
-psS32 testMetaRemove(void)
-{
-    psMetadata *md = NULL;
-    md = setupMeta();
-    if ( !psMetadataRemoveKey(md, "item1") ) {
-        fprintf(stderr, "Failed to remove item1 from psMetadata.\n");
-        return 1;
-    }
-    if ( !psMetadataRemoveIndex(md, PS_LIST_HEAD) ) {
-        fprintf(stderr, "Failed to remove item2 from psMetadata.\n");
-        return 2;
-    }
-    psFree(md);
-    return 0;
-}
-
-psS32 testMetaAddPtr(void)
-{
-    bool status;
-    psVector *vecptr = NULL;
-    psVector *vecptr2 = NULL;
-    vecptr = psVectorAlloc(5, PS_TYPE_S32);
-    vecptr->data.S32[0] = 666;
-    psMetadata *md = NULL;
-    md = psMetadataAlloc();
-    psMetadataItem *item = NULL;
-    psMetadataItem *item2 = NULL;
-    item = psMetadataItemAllocPtr("itemptr", PS_DATA_STRING, "", "Devil String");
-    status = psMetadataAddPtr(md, PS_LIST_HEAD, "vecptr", PS_DATA_VECTOR,
-                              "this is a vector comment", vecptr);
-    if (!status) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "Unable to add psPtr (vector) to metadata.\n");
-        return 1;
-    }
-    status = false;
-    vecptr2 = (psVector*)psMetadataLookupPtr(&status, md, "vecptr");
-    if (!status) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "Unable to retrieve psPtr (vector) from metadata.\n");
-        return 2;
-    }
-    if (vecptr2->data.S32[0] != 666) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "Failed to retrieve correct psPtr (vector) from metadata.\n");
-        return 3;
-    }
-    status = false;
-    if (item == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "Unable to Alloc psPtr (string) metadata item .\n");
-        return 5;
-    }
-    if ( !psMetadataAddItem(md, item, PS_LIST_TAIL, 0) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "Unable to add psPtr (string) metadata item to metadata.\n");
-        return 6;
-    }
-    item2 = psMetadataGet(md, PS_LIST_TAIL);
-    if (item2 == NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "Unable to retrieve psPtr (string) metadata item .\n");
-        return 7;
-    }
-    if ( strncmp((char*)item2->data.V, "Devil String", 20) ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "Unable to retrieve correct psPtr (string) metadata item .\n");
-        printf("\n string = %s \n", (char*)item2->data.V);
-        return 8;
-    }
-
-    psMetadata *strtest = psMetadataAlloc();
-    //should return false for NULL input string
-    //    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if ( !psMetadataAddStr(strtest, PS_LIST_TAIL, "bar", 0, "baz", NULL) ) {
-        psError(PS_ERR_BAD_PARAMETER_NULL, true, "strtest failed for NULL.\n");
-        return 9;
-    }
-    psFree(strtest);
-
-    psFree(item);
-    psFree(vecptr);
-    psFree(md);
-    return 0;
-
-}
-
-psS32 testMetaCopy(void)
-{
-    psMetadata *test = NULL;
-    psMetadata *empty = NULL;
-    psMetadata *md = setupMeta();
-
-    //Return NULL for NULL input Metadata
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    test = psMetadataCopy(test, empty);
-    if (test != NULL) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psMetadataCopy failed to return NULL for NULL input metadata.\n");
-        psFree(md);
-        return 1;
-    }
-
-    //Return a copy in of md in test
-    test = psMetadataCopy(NULL, md);
-    //Check if contents are the same
-    psMetadataItem *testItem = NULL;
-    psMetadataItem *mdItem = NULL;
-    psMetadataIterator *testIterator = NULL;
-    psMetadataIterator *mdIterator = NULL;
-    testIterator = psMetadataIteratorAlloc(test, PS_LIST_HEAD, NULL);
-    mdIterator = psMetadataIteratorAlloc(md, PS_LIST_HEAD, NULL);
-    testItem = psMetadataGetAndIncrement(testIterator);
-    mdItem = psMetadataGetAndIncrement(mdIterator);
-    while (testItem != NULL || mdItem != NULL ) {
-        testItem = psMetadataGetAndIncrement(testIterator);
-        mdItem = psMetadataGetAndIncrement(mdIterator);
-    }
-
-    if (!psMetadataConfigWrite(md, "MDCopy.in") ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psMetadataConfigWrite failed to output original metadata contents.\n");
-        return 3;
-    }
-    if (!psMetadataConfigWrite(test, "MDCopy.out") ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psMetadataConfigWrite failed to output copied metadata contents.\n");
-        return 4;
-    }
-    FILE *verified;
-    FILE *output;
-    verified = fopen("MDCopy.in", "r");
-    output = fopen("MDCopy.out", "r");
-    char buffer1[100];
-    char buffer2[100];
-    while ( fscanf(verified, "%s", buffer1) != EOF ) {
-        if (fscanf(output, "%s", buffer2) == EOF) {
-            psError(PS_ERR_BAD_PARAMETER_SIZE, false,
-                    "Copied metadata is smaller than the original.\n");
-            return 5;
-        }
-        if (strncmp(buffer1, buffer2, 100) ) {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                    "Copied metadata contents do not match original metadata contents.\n");
-            return 6;
-        }
-    }
-    if (fscanf(output, "%s", buffer2) != EOF) {
-        psError(PS_ERR_BAD_PARAMETER_SIZE, false,
-                "Copied metadata is larger than the original.\n");
-        return 7;
-    }
-    fclose(verified);
-    fclose(output);
-
-
-    psFree(testItem);
-    psFree(mdItem);
-    psFree(testIterator);
-    psFree(mdIterator);
-    psFree(test);
-    psFree(md);
-    return 0;
-}
Index: trunk/psLib/test/types/tst_psPixels.c
===================================================================
--- trunk/psLib/test/types/tst_psPixels.c	(revision 41166)
+++ 	(revision )
@@ -1,602 +1,0 @@
-/** @file  tst_psPixels.c
- *
- *  @brief Contains the tests for psPixels.[ch]
- *
- *  @author Robert DeSonia, MHPCC
- *
- *  @version $Revision: 1.5 $
- *           $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-01 02:43:57 $
- *
- *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
- */
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-static psS32 testPixelsAlloc(void);
-static psS32 testPixelsRealloc(void);
-static psS32 testPixelsCopy(void);
-static int testPixelsToMask(void);
-static int testPixelsFromMask(void);
-static int testPixelsConcatenate(void);
-static psS32 testPixelsGetSet(void);
-static psS32 testPixelsLength( void );
-
-testDescription tests[] = {
-                              {testPixelsAlloc,860,"psPixelsAlloc",0,false},
-                              {testPixelsRealloc,862,"psPixelsRealloc",0,false},
-                              {testPixelsCopy,863,"psPixelsCopy",0,false},
-                              {testPixelsToMask,864,"psPixelsToMask",0,false},
-                              {testPixelsFromMask,865,"psPixelsFromMask",0,false},
-                              {testPixelsConcatenate,866,"psPixelsConcatenate",0,false},
-                              {testPixelsGetSet,867,"psPixelsGet/Set",0,false},
-                              {testPixelsLength,666,"psPixelsLength",0,false},
-                              {NULL}
-                          };
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel(PS_LOG_INFO);
-
-    if ( ! runTestSuite(stderr,"psPixels",tests,argc,argv) ) {
-        psError(PS_ERR_UNKNOWN,true,"One or more tests failed");
-        return 1;
-    }
-    return 0;
-}
-
-psS32 testPixelsAlloc(void)
-{
-
-    psPixels* p0 = psPixelsAlloc(0);
-
-    if (p0 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to allocate a zero-sized psPixels");
-        return 1;
-    }
-    if (p0->data != NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to set data to NULL for a zero-sized psPixels");
-        return 2;
-    }
-    if (p0->n != p0->nalloc) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to set n = 0");
-        return 3;
-    }
-    if (p0->nalloc != 0) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to set nalloc = 0");
-        return 4;
-    }
-
-    psPixels* p1 = psPixelsAlloc(1);
-
-    if (p1 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to allocate a one-sized psPixels");
-        return 11;
-    }
-    if (p1->data == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to allocate data for a one-sized psPixels");
-        return 12;
-    }
-    p1->data[0].x = 1;
-    p1->data[0].y = 2;
-    p1->n++;
-    if (p1->n != p1->nalloc) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to set n = %ld", p1->nalloc);
-        return 13;
-    }
-    if (p1->nalloc != 1) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to set nalloc = 1 (%ld)",
-                p1->nalloc);
-        return 14;
-    }
-
-    psPixels* p2 = psPixelsAlloc(10);
-
-    if (p2 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to allocate a one-sized psPixels");
-        return 11;
-    }
-    if (p2->data == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to allocate data for a one-sized psPixels");
-        return 12;
-    }
-    for (int i = 0; i < 10; i++) {
-        p2->data[i].x = i;
-        p2->data[i].y = 100+i;
-        p2->n++;
-    }
-
-    if (p2->n != p2->nalloc) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to set n = %ld", p2->nalloc);
-        return 13;
-    }
-    if (p2->nalloc != 10) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsAlloc failed to set nalloc = 1 (%ld)",
-                p2->nalloc);
-        return 14;
-    }
-
-
-    psFree(p2);
-    psFree(p1);
-    psFree(p0);
-
-    return 0;
-}
-
-psS32 testPixelsRealloc(void)
-{
-
-    // first, tests that reallocing a NULL just allocates
-    psPixels* p0 = psPixelsRealloc(NULL,10);
-    p0->n = 10;
-
-    if (p0 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to allocate a zero-sized psPixels");
-        return 1;
-    }
-    if (p0->data == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set data to NULL for a zero-sized psPixels");
-        return 2;
-    }
-    if (p0->n != p0->nalloc) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set n = 0");
-        return 3;
-    }
-    if (p0->nalloc != 10) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set nalloc = 10");
-        return 4;
-    }
-    for (int i = 0; i < 10; i++) {
-        p0->data[i].x = i;
-        p0->data[i].y = 100+i;
-    }
-    p0->n = 10;
-
-    psPixels* p1 = psPixelsRealloc(p0, 20);
-    //    p1->n = 20;
-
-    if (p1 != p0) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to return a resized input psPixels");
-        return 11;
-    }
-    if (p1->data == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set data to non-NULL");
-        return 12;
-    }
-    if (p1->n != 10) {
-        psError(PS_ERR_UNKNOWN, true,
-                "resizing up didn't preserve the size");
-        return 13;
-    }
-    if (p1->nalloc != 20) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set nalloc = 0");
-        return 14;
-    }
-    for (int i = 0; i < 10; i++) {
-        if (p0->data[i].x != i || p0->data[i].y != 100+i) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "The value of pixel %d was not preserved (%f,%f) vs (%d,%d).",
-                    i, p0->data[i].x, p0->data[i].y, i, 100+i);
-            return 15;
-        }
-    }
-    for (int i = 10; i < 20; i++) {
-        p1->data[i].x = i;
-        p1->data[i].y = 100+i;
-    }
-    p1->n = 20;
-
-
-    psPixels* p2 = psPixelsRealloc(p1,5);
-    p2->n = 5;
-    if (p2 != p1) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc didn't return input psPixels.");
-        return 21;
-    }
-    if (p2->data == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to allocate data");
-        return 22;
-    }
-
-    if (p2->n != 5) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set n=nalloc after shrinking");
-        return 23;
-    }
-    if (p2->nalloc != 5) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set nalloc properly");
-        return 24;
-    }
-
-    psPixels* p3 = psPixelsRealloc(p2,0);
-
-    if (p3 != p2) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc didn't return input psPixels.");
-        return 31;
-    }
-    if (p3->data != NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to deallocate data when size=0");
-        return 32;
-    }
-
-    if (p3->n != 0) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set n=nalloc after shrinking");
-        return 33;
-    }
-    if (p3->nalloc != 0) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psPixelsRealloc failed to set nalloc properly");
-        return 34;
-    }
-
-    psFree(p3);
-
-    return 0;
-}
-
-psS32 testPixelsCopy(void)
-{
-    psPixels* in1 = psPixelsAlloc(10);
-
-    for (int i = 0; i < 10; i++) {
-        in1->data[i].x = i;
-        in1->data[i].y = 100+i;
-    }
-    in1->n = 10;
-
-    psPixels* out1 = psPixelsCopy(NULL, in1);
-    if (out1 == in1) {
-        psError(PS_ERR_UNKNOWN, true,
-                "output == input?");
-        return 1;
-    }
-    if (out1 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "output == NULL?");
-        return 2;
-    }
-
-    if (out1->n != in1->n) {
-        psError(PS_ERR_UNKNOWN, true,
-                "out->n != in->n");
-        return 3;
-    }
-    for (long i = 0; i < out1->n; i++) {
-        if (out1->data[i].x != in1->data[i].x || out1->data[i].y != in1->data[i].y) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "failed to copy the values correctly at index %ld", i);
-            return 4;
-        }
-    }
-
-    // now test what happens when copying a 0-length list.
-    psPixels* in2 = psPixelsAlloc(0);
-    psPixels* out2 = psPixelsCopy(out1, in2);
-    if (out2 != out1) {
-        psError(PS_ERR_UNKNOWN, true,
-                "failed to recycle.");
-        return 10;
-    }
-    if (out2->n != in2->n) {
-        psError(PS_ERR_UNKNOWN, true,
-                "failed to set size when copying 0-length pixel list.");
-        return 11;
-    }
-
-    // Attempt to copy from NULL input
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input");
-    out2 = psPixelsCopy(out2,NULL);
-    if (out2 != NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "Copying a NULL should create a NULL.");
-        return 20;
-    }
-
-    psFree(in1);
-    psFree(in2);
-
-    return 0;
-}
-
-int testPixelsToMask(void)
-{
-    // create a pixel list for
-    psPixels* pixels = psPixelsAlloc(10);
-    for (int i = 0; i < 10; i++) {
-        pixels->data[i].x = i;
-        pixels->data[i].y = i;
-    }
-    pixels->n = 10;
-
-    psImage* mask = psPixelsToMask(NULL,pixels, psRegionSet(0,10,0,10), 1);
-
-    if (mask == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "Resulting mask was null.");
-        return 1;
-    }
-    if (mask->type.type != PS_TYPE_MASK) {
-        psError(PS_ERR_UNKNOWN, true,
-                "mask type was not PS_TYPE_MASK.");
-        return 2;
-    }
-
-    for (int row=0;row<10;row++) {
-        psMaskType* rowData = mask->data.PS_TYPE_MASK_DATA[row];
-        for (int col=0;col<10;col++) {
-            if ( (col==row && rowData[col] != 1) ||
-                    (col!=row && rowData[col] != 0) ) {
-                psError(PS_ERR_UNKNOWN,true,
-                        "Mask has unexpected value, %d, at (%d,%d)",
-                        rowData[col], col, row);
-                return 10;
-            }
-        }
-    }
-
-    // test when input psPixels is NULL.
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for NULL pixels");
-    mask = psPixelsToMask(mask, NULL, psRegionSet(0,10,0,10), 1);
-    if (mask != NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "Resulting mask was not null though input psPixels was NULL.");
-        return 20;
-    }
-
-
-    // Test for invalid region
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for invalid range");
-    mask = psPixelsToMask(mask,pixels,psRegionSet(10,0,10,0),1);
-    if(mask != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL for invalid range");
-        return 21;
-    }
-    // Test for invalid region
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for invalid range");
-    mask = psPixelsToMask(mask,pixels,psRegionSet(0,-1,0,10),1);
-    if(mask != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL for invalid range");
-        return 22;
-    }
-
-    psFree(mask);
-    psFree(pixels);
-
-    return 0;
-}
-
-int testPixelsFromMask(void)
-{
-    const int numRows = 10;
-    const int numCols = 20;
-    psImage* mask = psImageAlloc(numCols,numRows,PS_TYPE_MASK);
-    for (int row=0;row<numRows;row++) {
-        for (int col=0;col<numCols;col++) {
-            mask->data.PS_TYPE_MASK_DATA[row][col] = (row*2 == col) ? 1 : 0;
-        }
-    }
-
-    psPixels* pixels = psPixelsFromMask(NULL, mask, 1);
-
-    if (pixels == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "resulting psPixels was NULL?");
-        return 1;
-    }
-
-    if (pixels->n != numRows) {
-        psError(PS_ERR_UNKNOWN, false,
-                "wrong number of pixels in list.  Got %ld, should be %d.",
-                pixels->n, numRows);
-        return 2;
-    }
-
-    for (long i = 0; i < pixels->n; i++) {
-        if (mask->data.PS_TYPE_MASK_DATA[(int)pixels->data[i].y][(int)pixels->data[i].x] != 1) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Item in psPixels list (%f,%f) didn't coorespond to a masked value in image",
-                    pixels->data[i].x, pixels->data[i].y);
-            return 3;
-        }
-    }
-
-    // Attempt to create pixels from NULL mask
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error for NULL mask");
-    pixels = psPixelsFromMask(pixels, NULL, 1);
-
-    if (pixels != NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "given a NULL image, got a non-NULL mask?");
-        return 4;
-    }
-
-    psFree(mask);
-
-    return 0;
-}
-
-int testPixelsConcatenate(void)
-{
-    // create a pixel list for
-    psPixels* pixels = psPixelsAlloc(10);
-    psPixels* pixels1 = psPixelsAlloc(10);
-    for (int i = 0; i < 10; i++) {
-        pixels->data[i].x = i;
-        pixels->data[i].y = i;
-        if (i%2) {
-            pixels1->data[i].x = -i;
-        } else {
-            pixels1->data[i].x = i;
-        }
-        pixels1->data[i].y = i;
-    }
-    pixels->n = 10;
-    pixels1->n = 10;
-    p_psPixelsPrint(stdout, pixels, "pixels");
-    p_psPixelsPrint(stdout, pixels1, "pixels1");
-
-    psPixels* pixels2 = psPixelsConcatenate(NULL, pixels);
-    p_psPixelsPrint(stdout, pixels2, "pixels2");
-    if (pixels2 == NULL) {
-        psError(PS_ERR_UNKNOWN, true,
-                "pixels2 == NULL?");
-        return 1;
-    }
-    if (pixels == pixels2) {
-        psError(PS_ERR_UNKNOWN, true,
-                "pixels == pixels2?  Should have made a copy.");
-        return 2;
-    }
-    if (pixels2->n != pixels->n) {
-        psError(PS_ERR_UNKNOWN, true,
-                "pixels2->n != pixels->n");
-        return 3;
-    }
-    for (long i = 0; i < pixels2->n; i++) {
-        if (pixels2->data[i].x != pixels->data[i].x || pixels2->data[i].y != pixels->data[i].y) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "failed to copy the values correctly at index %ld", i);
-            return 4;
-        }
-    }
-
-    // add pixels that are half unique.
-    psPixels* pixels3 = psPixelsConcatenate(pixels2, pixels1);
-    p_psPixelsPrint(stdout, pixels3, "pixels3");
-    if (pixels3 != pixels2) {
-        psError(PS_ERR_UNKNOWN, true,
-                "return expected to be the out parameter.");
-        return 10;
-    }
-    if (pixels3->n != 15) {
-        psError(PS_ERR_UNKNOWN, true,
-                "pixels3->n != 15, == %ld", pixels3->n);
-        return 11;
-    }
-
-    // Attempt to concatenate with NULL pixels
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL pixels");
-    if(psPixelsConcatenate(pixels2,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return to be non-NULL for NULL input pixels");
-        return 12;
-    }
-
-    psFree(pixels3);
-    psFree(pixels1);
-    psFree(pixels);
-
-    return 0;
-}
-
-psS32 testPixelsGetSet(void)
-{
-    psPixels *in = psPixelsAlloc(5);
-    in->n = 0;
-    psPixelCoord value;
-    psPixelCoord out;
-    value.x = 3;
-    value.y = 13;
-    if ( psPixelsSet(in, 2, value) ) {
-        psError(PS_ERR_LOCATION_INVALID, true, "psPixelSet set to Invalid location\n");
-        return 1;
-    }
-    if ( !psPixelsSet(in, 0, value) ) {
-        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
-        return 2;
-    }
-    if ( !psPixelsSet(in, 1, value) ) {
-        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
-        return 3;
-    }
-    out = psPixelsGet(in, 1);
-    if ( out.x != 3 || out.y != 13 ) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %f,%f",
-                out.x, out.y);
-        return 4;
-    }
-    value.x = 1;
-    value.y = 2;
-    if ( !psPixelsSet(in, 0, value) ) {
-        psError(PS_ERR_UNKNOWN, true, "psPixelsSet failed to set pixels at location 0\n");
-        return 5;
-    }
-    out = psPixelsGet(in, 0);
-    if (out.x != 1 || out.y != 2) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psPixelsGet return incorrect values %f,%f",
-                out.x, out.y);
-        return 6;
-    }
-    psFree(in);
-    return 0;
-}
-
-psS32 testPixelsLength( void )
-{
-    psPixels *pixels = psPixelsAlloc(5);
-
-    if (psPixelsLength(pixels) != 0) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psPixelsLength failed to return the correct length of pixels.\n");
-        return 1;
-    }
-    pixels->n = 5;
-    if (psPixelsLength(pixels) != 5) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psPixelsLength failed to return the correct length of pixels.\n");
-        return 2;
-    }
-    pixels->n++;
-    if (psPixelsLength(pixels) != 6) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psPixelsLength failed to return the correct length of pixels.\n");
-        return 3;
-    }
-    psFree(pixels);
-
-    psPixels *emptyPixels = NULL;
-    psVector *vector = psVectorAlloc(5, PS_TYPE_F32);
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psPixelsLength(emptyPixels) != -1) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psPixelsLength failed to return -1 for a NULL input pixels.\n");
-        return 4;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
-    if (psPixelsLength((psPixels*)vector) != -1) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
-                "psPixelsLength failed to return -1 for an invalid input pixels.\n");
-        return 5;
-    }
-    psFree(vector);
-
-    return 0;
-}
-
