Index: trunk/psLib/test/dataIO/tst_psDB.c
===================================================================
--- trunk/psLib/test/dataIO/tst_psDB.c	(revision 4457)
+++ 	(revision )
@@ -1,2216 +1,0 @@
-/** @file  tst_psDB.c
- *
- * -*- mode: C; c-basic-indent: 4; tab-width: 8; indent-tabs-mode: nil -*-
- * vim: set cindent ts=8 sw=4 expandtab:
- *
- *  @brief Contains the tests for psDB.[ch]
- *
- *
- *  @author Aaron Culliney, MHPCC
- *
- *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-06 03:04:35 $
- *
- *  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 <string.h>
-
-#include "psTest.h"
-#include "pslib_strict.h"
-
-#define STR_1 "hello world!"
-#define STR_2 "foobar"
-#define S32_1 1974
-#define S32_2 -18
-#define F32_1 3.14159
-#define F32_2 3.33
-#define F64_1 2.7182818
-#define F64_2 1.23456789
-#define B_1 TRUE
-#define B_2 FALSE
-
-#define ERROR_TOL   0.001
-
-#define CONST_ROW_1_STR      "randrow1"
-#define CONST_ROW_1_S32      12345
-#define CONST_ROW_1_F32      9876.5
-#define CONST_ROW_1_F64      456.75
-#define CONST_ROW_1_BOOL     TRUE
-
-#define CONST_ROW_2_STR      "randrow2"
-#define CONST_ROW_2_S32      2345
-#define CONST_ROW_2_F32      876.5
-#define CONST_ROW_2_F64      56.75
-#define CONST_ROW_2_BOOL     FALSE
-
-#define TAB_COL_0_NAME      "key_string"
-#define TAB_COL_1_NAME      "key_s32"
-#define TAB_COL_2_NAME      "key_f32"
-#define TAB_COL_3_NAME      "key_f64"
-#define TAB_COL_4_NAME      "key_bool"
-#define TAB_COL_5_NAME      "key_s32_0"
-
-static psDB *_init_psDB( void );
-static psMetadata *_get_CreateTableMetadata( void );
-static psMetadata *_get_RowMetadataValues(const char *val0, psS32 val1, psF32 val2, psF64 val3, psBool val4);
-static psMetadata *_get_RowMetadata(
-    const char *key0, const char *comm0, const char *val0,
-    const char *key1, const char *comm1, psS32  val1,
-    const char *key2, const char *comm2, psF32  val2,
-    const char *key3, const char *comm3, psF64  val3,
-    const char *key4, const char *comm4, psBool val4,
-    const char *key5, const char *comm5, psS32  val5);
-static psMetadata *_get_row( void );
-static psMetadata *_get_invalid_row( void );
-static psMetadata *_get_where( void );
-static psMetadata *_get_invalid_where( void );
-static psMetadata *_get_where_bad_value( void );
-static psMetadata *_get_update_values(const char *val0, psS32 val1, psF32 val2, psF64 val3, psBool val4);
-static bool _check_row(psMetadata* row);
-static bool _check_row_update(psMetadata* row);
-static bool _check_const_row1(psMetadata* row);
-static bool _check_const_row2(psMetadata* row);
-
-//static psS32 TPDBCreate( void );
-//static psS32 TPDBDrop( void );
-static psS32 TPDBInit( void );
-static psS32 TPDBChange( void );
-static psS32 TPDBCreateTable( void );
-static psS32 TPDBDropTable( void );
-static psS32 TPDBSelectColumn( void );
-static psS32 TPDBSelectColumnNum( void );
-static psS32 TPDBSelectRows( void );
-static psS32 TPDBInsertOneRow( void );
-static psS32 TPDBInsertRows( void );
-static psS32 TPDBDumpRows( void );
-static psS32 TPDBDumpCols( void );
-static psS32 TPDBUpdateRows( void );
-static psS32 TPDBDeleteRows( void );
-
-testDescription tests[] = {
-                              {TPDBInit,           841,  "dbInit",            0, false},
-                              {TPDBChange,         842,  "dbChange",          0, false},
-                              {TPDBCreateTable,    843,  "dbCreateTable",     0, false},
-                              {TPDBDropTable,      844,  "dbDropTable",       0, false},
-                              {TPDBSelectColumn,   845,  "dbSelectColumn",    0, false},
-                              {TPDBSelectColumnNum,846,  "dbSelectColumnNum", 0, false},
-                              {TPDBSelectRows,     847,  "dbSelectRows",      0, false},
-                              {TPDBInsertOneRow,   848,  "dbInsertOneRow",    0, false},
-                              {TPDBInsertRows,     849,  "dbInsertRows",      0, false},
-                              {TPDBDumpRows,       850,  "dbDumpRows",        0, false},
-                              {TPDBDumpCols,       851,  "dbDumpCols",        0, false},
-                              {TPDBUpdateRows,     852,  "dbUpdateRows",      0, false},
-                              {TPDBDeleteRows,     853,  "dbDeleteRows",      0, false},
-                              //{TPDBCreate,        -14, "dbCreate",          0, false},
-                              //{TPDBDrop,          -15, "dbDrop",            0, false},
-                              {NULL}
-                          };
-
-static const char *host    = "localhost";
-static const char *user    = "test";
-static const char *passwd  = "";
-static const char *dbname  = "test";
-
-// internal method to initialize DB
-psDB *_init_psDB( void )
-{
-    psDB *dbh = NULL;
-
-    // Initialize database connection with test database
-    dbh = psDBInit(host, user, passwd, dbname);
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "could not initialize DB connection in %s!", __func__ );
-    }
-
-    return dbh;
-}
-
-psMetadata *_get_CreateTableMetadata( void )
-{
-    return _get_RowMetadata(
-               TAB_COL_0_NAME, "comment-string",     "90000", // value used to determine size of field
-               TAB_COL_1_NAME,    "Primary Key",        0,       // values unused here ...
-               TAB_COL_2_NAME,    "Key",                0.0,
-               TAB_COL_3_NAME,    "",                   0.0,
-               TAB_COL_4_NAME,   "",                   FALSE,
-               TAB_COL_5_NAME,  "Key,AUTO_INCREMENT", 0);
-}
-
-psMetadata *_get_RowMetadataValues(const char *val0, psS32 val1, psF32 val2, psF64 val3, psBool val4)
-{
-    return _get_RowMetadata(
-               TAB_COL_0_NAME, "comment-string", val0,
-               TAB_COL_1_NAME,    "comment-s32",    val1,
-               TAB_COL_2_NAME,    "comment-f32",    val2,
-               TAB_COL_3_NAME,    "comment-f64",    val3,
-               TAB_COL_4_NAME,   "comment-bool",   val4,
-               NULL,         NULL,             0.0);
-}
-
-psMetadata *_get_RowMetadata(
-    const char *key0, const char *comm0, const char *val0,
-    const char *key1, const char *comm1, psS32  val1,
-    const char *key2, const char *comm2, psF32  val2,
-    const char *key3, const char *comm3, psF64  val3,
-    const char *key4, const char *comm4, psBool val4,
-    const char *key5, const char *comm5, psS32  val5)
-{
-    psMetadata *md = NULL;
-    psMetadataItem *str=NULL, *s32_0=NULL, *s32=NULL, *f32=NULL, *f64=NULL, *b;
-
-    md = psMetadataAlloc();
-    if (md == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "could not create psMetadata in %s!", __func__ );
-        return NULL;
-    }
-    if (key0 != NULL) {
-        str = psMetadataItemAllocStr(key0, comm0, val0);
-    }
-    if (key5 != NULL) {
-        s32_0 = psMetadataItemAllocS32(key5, comm5, val5);
-    }
-    s32 = psMetadataItemAllocS32 (key1, comm1, val1);
-    f32 = psMetadataItemAllocF32 (key2, comm2, val2);
-    f64 = psMetadataItemAllocF64 (key3, comm3, val3);
-    b   = psMetadataItemAllocBool(key4, comm4, val4);
-
-    if ( ((key0 != NULL) && (str == NULL)) || (s32 == NULL) || (f32 == NULL) || (f64 == NULL) || (b == NULL) ||
-            ((key5 != NULL) && (s32_0 == NULL)) ) {
-        psError(PS_ERR_UNKNOWN, true, "could not create psMetadataItem(s) in %s!", __func__ );
-        return NULL;
-    }
-    if ( ((key0 != NULL) && !psMetadataAddItem(md, str, 0, 0)) ||
-            !psMetadataAddItem(md, s32, 0, 0) || !psMetadataAddItem(md, f32, 0, 0) ||
-            !psMetadataAddItem(md, f64, 0, 0) || !psMetadataAddItem(md, b,   0, 0) ||
-            ((key5 != NULL) && !psMetadataAddItem(md, s32_0, 0, 0))) {
-        psError(PS_ERR_UNKNOWN, true, "could not add psMetadataItem(s) to psMetadata in %s!", __func__ );
-        return NULL;
-    }
-
-    if (str != NULL) {
-        psFree(str);
-    }
-    psFree(s32);
-    psFree(f32);
-    psFree(f64);
-    psFree(b);
-    if (s32_0 != NULL) {
-        psFree(s32_0);
-    }
-
-    return md;
-}
-
-psMetadata *_get_const_row1( void )
-{
-    char buf[32];
-    snprintf(buf, 32, "%s", CONST_ROW_1_STR );
-    return _get_RowMetadata(
-               TAB_COL_0_NAME, "comment-string", buf,
-               TAB_COL_1_NAME,    "comment-s32",    CONST_ROW_1_S32,
-               TAB_COL_2_NAME,    "comment-f32",    CONST_ROW_1_F32,
-               TAB_COL_3_NAME,    "comment-f64",    CONST_ROW_1_F64,
-               TAB_COL_4_NAME,   "comment-bool",   CONST_ROW_1_BOOL,
-               NULL,         NULL,             0.0);
-}
-
-psMetadata *_get_const_row2( void )
-{
-    char buf[32];
-    snprintf(buf, 32, "%s",CONST_ROW_2_STR);
-    return _get_RowMetadata(
-               TAB_COL_0_NAME, "comment-string", buf,
-               TAB_COL_1_NAME,    "comment-s32",    CONST_ROW_2_S32,
-               TAB_COL_2_NAME,    "comment-f32",    CONST_ROW_2_F32,
-               TAB_COL_3_NAME,    "comment-f64",    CONST_ROW_2_F64,
-               TAB_COL_4_NAME,   "comment-bool",   CONST_ROW_2_BOOL,
-               NULL,         NULL,             0.0);
-}
-
-psMetadata *_get_row( void )
-{
-    return _get_RowMetadata(
-               TAB_COL_0_NAME, "comment-string", STR_1,
-               TAB_COL_1_NAME,    "comment-s32",    S32_1,
-               TAB_COL_2_NAME,    "comment-f32",    F32_1,
-               TAB_COL_3_NAME,    "comment-f64",    F64_1,
-               TAB_COL_4_NAME,   "comment-bool",   B_1,
-               NULL,         NULL,             0.0);
-}
-
-psMetadata *_get_invalid_row( void )
-{
-    return _get_RowMetadata(
-               TAB_COL_0_NAME, "comment-string", STR_1,
-               TAB_COL_1_NAME,    "comment-s32",    S32_1,
-               "key_999",    "comment-f32",    F32_1,
-               TAB_COL_3_NAME,    "comment-f64",    F64_1,
-               TAB_COL_4_NAME,   "comment-bool",   B_1,
-               NULL,         NULL,             0.0);
-}
-
-psMetadata *_get_where( void )
-{
-    psMetadata *md = NULL;
-    psMetadataItem *s32=NULL;
-
-    md = psMetadataAlloc();
-    if (md == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "could not create psMetadata in %s!", __func__ );
-        return NULL;
-    }
-    s32 = psMetadataItemAllocS32(TAB_COL_1_NAME, "", S32_1);
-    if (s32 == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "could not create psMetadataItem in %s!", __func__ );
-        return NULL;
-    }
-    if (!psMetadataAddItem(md, s32, 0, 0)) {
-        psError(PS_ERR_UNKNOWN, true, "could not add psMetadataItem(s) to psMetadata in %s!", __func__ );
-        return NULL;
-    }
-
-    psFree(s32);
-    return md;
-}
-
-psMetadata *_get_invalid_where( void )
-{
-    psMetadata *md = NULL;
-    psMetadataItem *s32=NULL;
-
-    md = psMetadataAlloc();
-    if (md == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "could not create psMetadata in %s!", __func__ );
-        return NULL;
-    }
-    s32 = psMetadataItemAllocS32("col999", "", S32_1);
-    if (s32 == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "could not create psMetadataItem in %s!", __func__ );
-        return NULL;
-    }
-    if (!psMetadataAddItem(md, s32, 0, 0)) {
-        psError(PS_ERR_UNKNOWN, true, "could not add psMetadataItem(s) to psMetadata in %s!", __func__ );
-        return NULL;
-    }
-
-    psFree(s32);
-    return md;
-}
-
-psMetadata *_get_where_bad_value( void )
-{
-    psMetadata *md = NULL;
-    psMetadataItem *s32=NULL;
-
-    md = psMetadataAlloc();
-    if (md == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "could not create psMetadata in %s!", __func__ );
-        return NULL;
-    }
-    s32 = psMetadataItemAllocS32(TAB_COL_1_NAME, "", S32_1 + 1);
-    if (s32 == NULL) {
-        psError(PS_ERR_UNKNOWN, true, "could not create psMetadataItem in %s!", __func__ );
-        return NULL;
-    }
-    if (!psMetadataAddItem(md, s32, 0, 0)) {
-        psError(PS_ERR_UNKNOWN, true, "could not add psMetadataItem(s) to psMetadata in %s!", __func__ );
-        return NULL;
-    }
-
-    psFree(s32);
-    return md;
-}
-
-psMetadata *_get_update_values(const char *val0, psS32 val1, psF32 val2, psF64 val3, psBool val4)
-{
-    return _get_RowMetadataValues(val0, val1, val2, val3, val4);
-}
-
-bool _check_row(psMetadata* row)
-{
-    bool              returnValue = true;
-    psMetadataItem*   item        = NULL;
-
-    item = psMetadataLookup(row,TAB_COL_0_NAME);
-    if((item==NULL) || (strcmp(item->data.V,STR_1)!=0)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_string item %s not as expected %s",
-                item->data.V,STR_1);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_1_NAME);
-    if((item==NULL) || (item->data.S32 != S32_1)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_s32 item %d not as expected %d",
-                item->data.S32, S32_1);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_2_NAME);
-    if((item==NULL) || (fabs(item->data.F32-F32_1)>ERROR_TOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_f32 item %f not as expected %f",
-                item->data.F32, F32_1);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_3_NAME);
-    if((item==NULL) || (fabs(item->data.F64-F64_1)>ERROR_TOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_f64 item %lf not as expected %lf",
-                item->data.F64,F64_1);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_4_NAME);
-    if((item==NULL) || (item->data.B != B_1)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_bool item %d not as expected %d",
-                item->data.B, B_1);
-        return false;
-    }
-
-    return returnValue;
-}
-
-bool _check_row_update(psMetadata* row)
-{
-    bool              returnValue = true;
-    psMetadataItem*   item        = NULL;
-
-    item = psMetadataLookup(row,TAB_COL_0_NAME);
-    if((item==NULL) || (strcmp(item->data.V,STR_2)!=0)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_string item %s not as expected %s",
-                item->data.V,STR_2);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_1_NAME);
-    if((item==NULL) || (item->data.S32 != S32_2)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_s32 item %d not as expected %d",
-                item->data.S32, S32_2);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_2_NAME);
-    if((item==NULL) || (fabs(item->data.F32-F32_2)>ERROR_TOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_f32 item %f not as expected %f",
-                item->data.F32, F32_2);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_3_NAME);
-    if((item==NULL) || (fabs(item->data.F64-F64_2)>ERROR_TOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_f64 item %lf not as expected %lf",
-                item->data.F64,F64_2);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_4_NAME);
-    if((item==NULL) || (item->data.B != B_2)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_bool item %d not as expected %d",
-                item->data.B, B_2);
-        return false;
-    }
-
-    return returnValue;
-}
-
-bool _check_const_row1(psMetadata* row)
-{
-    bool              returnValue = true;
-    psMetadataItem*   item        = NULL;
-
-    item = psMetadataLookup(row,TAB_COL_0_NAME);
-    if((item==NULL) || (strcmp(item->data.V,CONST_ROW_1_STR)!=0)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_string item %s not as expected %s",
-                item->data.V,CONST_ROW_1_STR);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_1_NAME);
-    if((item==NULL) || (item->data.S32 != CONST_ROW_1_S32)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_s32 item %d not as expected %d",
-                item->data.S32, CONST_ROW_1_S32);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_2_NAME);
-    if((item==NULL) || (fabs(item->data.F32-CONST_ROW_1_F32)>ERROR_TOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_f32 item %f not as expected %f",
-                item->data.F32, CONST_ROW_1_F32);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_3_NAME);
-    if((item==NULL) || (fabs(item->data.F64-CONST_ROW_1_F64)>ERROR_TOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_f64 item %lf not as expected %lf",
-                item->data.F64,CONST_ROW_1_F64);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_4_NAME);
-    if((item==NULL) || (item->data.B != CONST_ROW_1_BOOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_bool item %d not as expected %d",
-                item->data.B, CONST_ROW_1_BOOL);
-        return false;
-    }
-
-    return returnValue;
-}
-
-bool _check_const_row2(psMetadata* row)
-{
-    bool              returnValue = true;
-    psMetadataItem*   item        = NULL;
-
-    item = psMetadataLookup(row,TAB_COL_0_NAME);
-    if((item==NULL) || (strcmp(item->data.V,CONST_ROW_2_STR)!=0)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_string item %s not as expected %s",
-                item->data.V,CONST_ROW_2_STR);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_1_NAME);
-    if((item==NULL) || (item->data.S32 != CONST_ROW_2_S32)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_s32 item %d not as expected %d",
-                item->data.S32, CONST_ROW_2_S32);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_2_NAME);
-    if((item==NULL) || (fabs(item->data.F32-CONST_ROW_2_F32)>ERROR_TOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_f32 item %f not as expected %f",
-                item->data.F32, CONST_ROW_2_F32);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_3_NAME);
-    if((item==NULL) || (fabs(item->data.F64-CONST_ROW_2_F64)>ERROR_TOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_f64 item %lf not as expected %lf",
-                item->data.F64,CONST_ROW_2_F64);
-        return false;
-    }
-
-    item = psMetadataLookup(row,TAB_COL_4_NAME);
-    if((item==NULL) || (item->data.B != CONST_ROW_2_BOOL)) {
-        psError(PS_ERR_UNKNOWN,true,"Column key_bool item %d not as expected %d",
-                item->data.B, CONST_ROW_2_BOOL);
-        return false;
-    }
-
-    return returnValue;
-}
-
-psS32 main(psS32 argc, char* argv[])
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    srand(time(NULL));
-
-    return ( ! runTestSuite( stderr, "psDB", tests, argc, argv ) );
-}
-
-// Testpoint #841, initialize/break-down MySQL connection.
-psS32 TPDBInit( void )
-{
-    psDB *dbh = NULL;
-
-    // Initialize database with valid arguments
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL to be returned for valid arguments");
-        return 1;
-    }
-
-    // Cleanup database/connection with valid psDB object
-    psDBCleanup(dbh);
-
-    // Attempt to initialize database with invalid arguments
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid host");
-    dbh = psDBInit("xxx",NULL,NULL,NULL);
-    if(dbh != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL psDB with invalid arguments");
-        return 2;
-    }
-
-    // Attempt cleanup database/connection with NULL psDB object
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL database objec");
-    psDBCleanup(NULL);
-
-    return 0;
-}
-
-// Testpoint #842, psDBChange shall change databases.
-psS32 TPDBChange( void )
-{
-    psDB *dbh = NULL;
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL for valid arguments");
-        return 1;
-    }
-
-    // Attempt to change database with valid arguments
-    if(!psDBChange(dbh, dbname)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for valid arguments");
-        return 2;
-    }
-
-    // Attemp to change database to invalid database name
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid database");
-    if(psDBChange(dbh,"abc")) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return true for unknown database name");
-        return 3;
-    }
-
-    // Cleanup database connection
-    psDBCleanup(dbh);
-
-    // Attempt to change database with NULL database object
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for null database object");
-    if(psDBChange(NULL,dbname)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return true for NULL database object");
-        return 4;
-    }
-
-    return 0;
-}
-
-// Testpoint #843, psDBCreateTable shall create tables in the test database ...
-psS32 TPDBCreateTable( void )
-{
-    psDB *dbh = NULL;
-    const char* table = "table1";
-
-    // Create metadata for table definition
-    psMetadata *md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL for valid argument in database connection");
-        return 1;
-    }
-
-    // Attempt to create database table with valid arguments
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of false for valid arguments");
-        return 2;
-    } else {
-        // Drop the table from the test database
-        psDBDropTable(dbh, table);
-    }
-
-    // Free metadata definition of table
-    psFree(md);
-
-    // Attempt to create table with NULL table definition
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL parameter");
-    if(psDBCreateTable(dbh,table,NULL)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of true for NULL metadata object");
-        return 3;
-    }
-
-    // Attempt to create table with NULL connection
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL parameter");
-    if(psDBCreateTable(NULL, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of true for NULL database object");
-        return 4;
-    }
-
-    // Close/cleanup database connection
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #844, psDBDropTable shall remove tables in the test database ...
-psS32 TPDBDropTable( void )
-{
-    psDB *dbh = NULL;
-    const char* table = "table2";
-
-    // Create table definition metadata
-    psMetadata *row=NULL, *md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return to initialize database");
-        return 1;
-    }
-
-    // Create table in database
-    if(psDBCreateTable(dbh, table, md)) {
-
-        // Drop table with valid arguments
-        if(!psDBDropTable(dbh, table)) {
-            psError(PS_ERR_UNKNOWN,true,"Did not expect return false for valid arguments");
-            return 2;
-        }
-
-        // insert should fail since the table has been drop from database
-        psLogMsg( __func__, PS_LOG_INFO, "psDBDropTable: insert should fail here...\n" );
-        row = _get_row();
-        if (psDBInsertOneRow(dbh, table, row)) {
-            psError(PS_ERR_UNKNOWN,true,"Did not expect to successfully insert row into dropped table");
-            return 3;
-        }
-        psFree(row);
-    } else {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false to create table");
-        return 4;
-    }
-
-    // Attempt to drop table from NULL psDB object
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL database object");
-    if(psDBDropTable(NULL,table)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return false as expected for NULL database object");
-        return 5;
-    }
-
-    // Attempt to drop table from valid psDB but invalid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid table");
-    if(psDBDropTable(dbh,"table99")) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return false as expected for invalid table");
-        return 6;
-    }
-
-    // Attempt to drop table from valid psDB but NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL table");
-    if(psDBDropTable(dbh,NULL)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return false as expected for NULL table");
-        return 7;
-    }
-
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #845, TPDBSelectColumn shall write/select a column from a test table ...
-psS32 TPDBSelectColumn( void )
-{
-    psDB *dbh = NULL;
-    const char* table = "table3";
-    psArray *ary = NULL;
-    char *ptr=NULL;
-
-    // Create table definition metadata
-    psMetadata *row=NULL, *md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL to initialize database connection");
-        return 1;
-    }
-
-    // Create database table
-    if(!psDBCreateTable(dbh,table,md)) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to create database table for testing");
-        psDBCleanup(dbh);
-        return 2;
-    }
-
-    // Insert known constant row #1
-    row = _get_const_row1();
-    if(!psDBInsertOneRow(dbh, table, row)) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to add rows to test database");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 3;
-    }
-    psFree(row);
-
-    // Insert known constant row #2
-    row = _get_const_row2();
-    if(!psDBInsertOneRow(dbh, table, row)) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to add rows to test database");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 4;
-    }
-    psFree(row);
-
-    // Insert known row
-    row = _get_row();
-    if(!psDBInsertOneRow(dbh, table, row)) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to add rows to test database");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-    psFree(row);
-
-    // Select all items in column key_string with valid arguments
-    ary = psDBSelectColumn(dbh, table, TAB_COL_0_NAME, 0);
-    if (ary == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return value of NULL");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-
-    // Verify array contents
-    if(ary->n != 3) {
-        psError(PS_ERR_UNKNOWN,true,"Array number of items %d not equal to expected %d",
-                ary->n, 3);
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 60;
-    }
-    ptr = psArrayGet(ary, 2);
-    if (strcmp(ptr, CONST_ROW_1_STR)) {
-        psError(PS_ERR_UNKNOWN,true,"key_str column entry[%d] = %s not as expected %s",
-                2,CONST_ROW_1_STR,ptr);
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 7;
-    }
-    ptr = psArrayGet(ary, 1);
-    if (strcmp(ptr, CONST_ROW_2_STR)) {
-        psError(PS_ERR_UNKNOWN,true,"key_str column entry[%d] = %s not as expected %s",
-                1,CONST_ROW_2_STR,ptr);
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 8;
-    }
-    ptr = psArrayGet(ary, 0);
-    if (strcmp(ptr, STR_1)) {
-        psError(PS_ERR_UNKNOWN,true,"key_str column entry[%d] = %s not as expected %s",
-                0,STR_1,ptr);
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 9;
-    }
-    psFree(ary);
-
-    // Select items in column key_bool with limit 10 and valid arguments
-    ary = psDBSelectColumn(dbh, table, TAB_COL_4_NAME, 10);
-    if (ary == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return value of NULL");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 10;
-    }
-
-    // Verify array contents
-    if(ary->n != 3) {
-        psError(PS_ERR_UNKNOWN,true,"Array number of items %d not equal to expected %d",
-                ary->n, 3);
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 100;
-    }
-    ptr = psArrayGet(ary, 2);
-    if(atoi(ptr) != CONST_ROW_1_BOOL) {
-        psError(PS_ERR_UNKNOWN,true,"key_bool column entry[%d] = %d not as expected %d",
-                2,CONST_ROW_1_BOOL,atoi(ptr));
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 11;
-    }
-    ptr = psArrayGet(ary, 1);
-    if(atoi(ptr) != CONST_ROW_2_BOOL) {
-        psError(PS_ERR_UNKNOWN,true,"key_bool column entry[%d] = %d not as expected %d",
-                1,CONST_ROW_2_BOOL,atoi(ptr));
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 12;
-    }
-    ptr = psArrayGet(ary, 0);
-    if(atoi(ptr) != B_1) {
-        psError(PS_ERR_UNKNOWN,true,"key_bool column entry[%d] = %d not as expected %d",
-                0,B_1,atoi(ptr));
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 13;
-    }
-    psFree(ary);
-
-    // Attempt to select columns from NULL database object
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL database");
-    if(psDBSelectColumn(NULL,table,"key_str",10) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return for selecting from NULL database");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 14;
-    }
-
-    // Attempt to select column from NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL table");
-    if(psDBSelectColumn(dbh,NULL,"key_str",10) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return for NULL table");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 15;
-    }
-
-    // Attempt to select column from invalid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid table");
-    if(psDBSelectColumn(dbh,"table99","key_str",10) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return for invalid table");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 16;
-    }
-
-    // Attempt to select invalid column from valid database object and valid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid column");
-    if(psDBSelectColumn(dbh,table,"key_null",10) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return for invalid column");
-        psDBDropTable(dbh, table);
-        psDBCleanup(dbh);
-        return 17;
-    }
-
-    // Clean up table and memory
-    psDBDropTable(dbh, table);
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #846, TPDBSelectColumnNum shall write/select a column from a test table ...
-psS32 TPDBSelectColumnNum( void )
-{
-    psDB *dbh = NULL;
-    const char* table = "table4";
-    psVector *vec = NULL;
-
-    // Create table definition metadata
-    psMetadata *row=NULL, *md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expected NULL return to initialize database");
-        return 1;
-    }
-
-    // Create database table for test
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for create table");
-        return 2;
-    }
-
-    // Initialize database table with known rows
-    row = _get_const_row1();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    row = _get_const_row2();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    row = _get_row();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    // Use valid arguments to select column with numeric values to return vector
-    vec = psDBSelectColumnNum(dbh, table, TAB_COL_1_NAME, PS_TYPE_S32, 0);
-
-    // Verify vector returned
-    if (vec == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return with valid arguments");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 3;
-    }
-    // Verify vector values
-    if(vec->n != 3) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return vector size not equal to 3");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 30;
-    }
-    if(vec->type.type != PS_TYPE_S32) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return vector type not equal to PS_TYPE_S32");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 31;
-    }
-    if ((vec->data.S32)[0] != S32_1) {
-        psError(PS_ERR_UNKNOWN,true,"vector value[%d] = %d not as expected %d",
-                0,vec->data.S32[0], S32_1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 4;
-    }
-    if ((vec->data.S32)[1] != CONST_ROW_2_S32) {
-        psError(PS_ERR_UNKNOWN,true,"vector value[%d] = %d not as expected %d",
-                1,vec->data.S32[1], CONST_ROW_2_S32);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-    if ((vec->data.S32)[2] != CONST_ROW_1_S32) {
-        psError(PS_ERR_UNKNOWN,true,"vector value[%d] = %d not as expected %d",
-                2,vec->data.S32[2], CONST_ROW_1_S32);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-    psFree(vec);
-
-    // Use valid arguments to select column with numeric values to return vector
-    vec = psDBSelectColumnNum(dbh, table, TAB_COL_4_NAME, PS_TYPE_BOOL, 0);
-
-    // Verify vector returned
-    if (vec == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return with valid arguments");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 7;
-    }
-    // Verify vector values
-    if(vec->n != 3) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return vector size not equal to 3");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 8;
-    }
-    if(vec->type.type != PS_TYPE_BOOL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return vector type not equal to PS_TYPE_BOOL");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 9;
-    }
-    if ((vec->data.U8)[0] != B_1) {
-        psError(PS_ERR_UNKNOWN,true,"vector value[%d] = %d not as expected %d",
-                0,vec->data.U8[0],B_1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 10;
-    }
-    if ((vec->data.U8)[1] != CONST_ROW_2_BOOL) {
-        psError(PS_ERR_UNKNOWN,true,"vector value[%d] = %d not as expected %d",
-                0,vec->data.U8[0],CONST_ROW_2_BOOL);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 11;
-    }
-    if ((vec->data.U8)[2] != CONST_ROW_1_BOOL) {
-        psError(PS_ERR_UNKNOWN,true,"vector value[%d] = %d not as expected %d",
-                0,vec->data.U8[0],CONST_ROW_1_BOOL);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 12;
-    }
-    psFree(vec);
-
-    // Attempt to select columns from NULL database
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for NULL database object");
-    if(psDBSelectColumnNum(NULL,table,TAB_COL_4_NAME,PS_TYPE_BOOL,10) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return with NULL database object");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 13;
-    }
-
-    // Attempt to select columns from NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for NULL table");
-    if(psDBSelectColumnNum(dbh,NULL,TAB_COL_4_NAME,PS_TYPE_BOOL,10) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return with NULL table");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 14;
-    }
-
-    // Attempt to select columns from invalid column
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for invalid column");
-    if(psDBSelectColumnNum(dbh,table,"key_999",PS_TYPE_BOOL,10) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return with NULL column");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 15;
-    }
-
-    // Attempt to select columns from invalid column
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for invalid type");
-    if(psDBSelectColumnNum(dbh,table,TAB_COL_0_NAME,0,10) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return with invalid type");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 16;
-    }
-
-    psDBDropTable(dbh, table);
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #847, TPDBSelectRows shall write/select data from a test table ...
-psS32 TPDBSelectRows( void )
-{
-    int i;
-    psDB *dbh = NULL;
-    const char* table = "table5";
-    psArray *ary=NULL, *ary1=NULL, *ary2=NULL;
-    psMetadataItem *item = NULL;
-
-    // Create database table definition
-    psMetadata *where=NULL, *row=NULL, *md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expected NULL return to initialize database");
-        return 1;
-    }
-
-    psDBDropTable(dbh,table);
-    // Create database table for test
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for create table");
-        psDBCleanup(dbh);
-        return 2;
-    }
-
-    // Initialize database table with known rows
-    row = _get_const_row1();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    row = _get_const_row2();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    row = _get_row();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    // Generate valid where clause
-    where = _get_where();
-
-    // Select rows with non limit
-    ary1 = psDBSelectRows(dbh, table, where, 0);
-
-    // Select rows with a limit
-    ary2 = psDBSelectRows(dbh, table, where, 1);
-    psFree(where);
-
-    // Cycle through both arrays to verify results
-    for (i=0; i<2; i++) {
-        ary = i ? ary2 : ary1;
-
-        // Verify return array not NULL
-        if (ary == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL");
-            psDBDropTable(dbh,table);
-            psDBCleanup(dbh);
-            return 1;
-        }
-
-        if(ary->n != 1) {
-            psError(PS_ERR_UNKNOWN,true,"Number of rows %d not as expected %d",
-                    ary->n, 1);
-            psDBDropTable(dbh,table);
-            psDBCleanup(dbh);
-            return 2;
-        }
-
-        // Get metadata which contains row from array
-        row = (psMetadata*)psArrayGet(ary, 0);
-
-        // Get key_s32 item from metadata
-        item = psMetadataLookup(row, TAB_COL_1_NAME);
-        if (item == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Could not find key_s32 item in row metadata");
-            psDBDropTable(dbh,table);
-            psDBCleanup(dbh);
-            return 2;
-        }
-        if (item->data.S32 != S32_1) {
-            psError(PS_ERR_UNKNOWN,true,"Row item %d not as expected %d",
-                    item->data.S32,S32_1);
-            psDBDropTable(dbh,table);
-            psDBCleanup(dbh);
-            return 3;
-        }
-
-        // Get key_bool item from metadata
-        item = psMetadataLookup(row, TAB_COL_4_NAME);
-        if (item == NULL) {
-            psError(PS_ERR_UNKNOWN,true,"Could not find key_bool item in row metadata");
-            psDBDropTable(dbh,table);
-            psDBCleanup(dbh);
-            return 2;
-        }
-        if (item->data.B != B_1) {
-            psError(PS_ERR_UNKNOWN,true,"Row item %d not as expected %d",
-                    item->data.S32,S32_1);
-            psDBDropTable(dbh,table);
-            psDBCleanup(dbh);
-            return 4;
-        }
-        psFree(ary);
-    }
-
-    // Attempt to select rows with NULL database object
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL database object");
-    if(psDBSelectRows(NULL, table, where, 0) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return for NULL database object");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-
-    // Attempt to select rows with invalid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid table");
-    if(psDBSelectRows(dbh, NULL, where, 0) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL return for NULL database object");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-
-    // Select rows with no where specified
-    ary1 = psDBSelectRows(dbh, table, NULL, 0);
-    if(ary1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return using NULL where");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-    if(ary1->n != 3) {
-        psError(PS_ERR_UNKNOWN,true,"Rows return %d not as expected %d",
-                ary->n,3);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 7;
-    }
-    psFree(ary1);
-
-    psDBDropTable(dbh, table);
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #848, TPDBInsertOneRow shall write a row of data into a test table ...
-psS32 TPDBInsertOneRow( void )
-{
-    psDB *dbh = NULL;
-    const char* table = "table6";
-    psMetadata *invalidRow = NULL;
-    psArray*    ary = NULL;
-
-    // Create table definition metadata
-    psMetadata *row=NULL, *md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL for database initialization");
-        return 1;
-    }
-
-    // Create database table
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for create database");
-        psDBCleanup(dbh);
-        return 2;
-    }
-
-    // Insert a single row with valid arguments
-    row = _get_const_row1();
-    if(!psDBInsertOneRow(dbh, table, row)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for inserting row w/ valid arguments");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 3;
-    }
-    // Verify row was added to table
-    ary = psDBSelectRows(dbh,table,NULL,0);
-    if(ary->n != 1) {
-        psError(PS_ERR_UNKNOWN,true,"Number of rows %d not as expected %d",
-                ary->n,1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 30;
-    }
-    psFree(ary);
-
-    // Insert a single row with NULL database
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL database");
-    if(psDBInsertOneRow(NULL,table,row)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for NULL database");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 4;
-    }
-
-    // Insert a single row which has column which does not match table
-    invalidRow = _get_invalid_row();
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid column item");
-    if(psDBInsertOneRow(dbh,table,invalidRow)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for invalid column item");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-
-    // Insert a single row with invalid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid table");
-    if(psDBInsertOneRow(dbh,"table999",row)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for invalid table");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-
-    // Insert a single row with NULL row
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL row");
-    if(psDBInsertOneRow(dbh,table,NULL)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for NULL row");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-
-    psFree(row);
-    psFree(invalidRow);
-    psDBDropTable(dbh, table);
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #849, TPDBInsertRows shall write rows of data into a test table ...
-psS32 TPDBInsertRows( void )
-{
-    psDB *dbh = NULL;
-    const char* table = "table7";
-    psArray *rowSet = NULL;
-    psArray* dumpRowSet = NULL;
-    psMetadataItem *item=NULL;
-    psArray* ary = NULL;
-    psMetadata* invalidRow = NULL;
-    psArray* invalidRowSet = NULL;
-
-    //Create database table definition metadata
-    psMetadata *row=NULL, *md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL for initializing database connection");
-        return 1;
-    }
-
-    // Create database table for testing
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for creating table");
-        psDBCleanup(dbh);
-        return 2;
-    }
-
-    // Create array of row elements
-    rowSet = psArrayAlloc(3);
-    rowSet->n = 0;
-
-    row = _get_const_row1();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-
-    row = _get_const_row2();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-
-    row = _get_row();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-
-    // Insert rows with valid arguments
-    if(!psDBInsertRows(dbh, table, rowSet)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for inserting rows w/ valid args");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 3;
-    }
-
-    // Verify row was added to table
-    ary = psDBSelectRows(dbh,table,NULL,0);
-    if(ary->n != 3) {
-        psError(PS_ERR_UNKNOWN,true,"Number of rows %d not as expected %d",
-                ary->n,3);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 30;
-    }
-    psFree(ary);
-
-    // extra checks ...
-    dumpRowSet = psDBDumpRows(dbh, table);
-    if (dumpRowSet == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL from dump rows");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 4;
-    }
-
-    // Get first row from array
-    row = (psMetadata*)psArrayGet(dumpRowSet, 0);
-    // Verify contents for column key_s32
-    item = psMetadataLookup(row, TAB_COL_1_NAME);
-    if ((item == NULL) || (item->data.S32 != S32_1)) {
-        psError(PS_ERR_UNKNOWN,true,"Column value %d not as expected %d",
-                item->data.S32, S32_1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-    // Verify contents for column key_bool
-    item = psMetadataLookup(row, TAB_COL_4_NAME);
-    if ((item == NULL) || (item->data.B != B_1)) {
-        psError(PS_ERR_UNKNOWN,true,"Column value %d not as expected %d",
-                item->data.B, B_1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-    psFree(dumpRowSet);
-
-    // Insert rows with NULL database object
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL database");
-    if(psDBInsertRows(NULL,table,rowSet)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of false for NULL database");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 7;
-    }
-
-    // Insert rows with NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL table");
-    if(psDBInsertRows(dbh,NULL,rowSet)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of false for NULL table");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 70;
-    }
-
-    // Insert rows with invalid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid table");
-    if(psDBInsertRows(dbh,"table999",rowSet)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of false for invalid table");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 8;
-    }
-
-    // Insert rows with NULL array of rows to be inserted
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL row array");
-    if(psDBInsertRows(dbh,table,NULL)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of false for NULL row array");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 9;
-    }
-
-    // Insert a single row which has column which does not match table
-    invalidRow = _get_invalid_row();
-    // Create array of invalid row element
-    invalidRowSet = psArrayAlloc(1);
-    invalidRowSet->n = 0;
-    psArrayAdd(invalidRowSet, 0, invalidRow);
-    psFree(invalidRow);
-
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid column item");
-    if(psDBInsertRows(dbh,table,invalidRowSet)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return value true for invalid column item");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 10;
-    }
-    psFree(invalidRowSet);
-
-    psFree(rowSet);
-    psDBDropTable(dbh, table);
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #850, TPDBDumpRows shall dump all rows from a test table ...
-psS32 TPDBDumpRows( void )
-{
-    psDB *dbh = NULL;
-    const char* table = "table8";
-    psArray *ary = NULL;
-
-    // Create table definition metadata
-    psMetadata *row=NULL, *md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL from initializing database");
-        return 1;
-    }
-
-    // Create table for testing
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false from creating table");
-        psDBCleanup(dbh);
-        return 2;
-    }
-
-    // Insert known data rows into table
-    row = _get_const_row1();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    row = _get_const_row2();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    row = _get_row();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    // Dump row with valid parameters
-    ary = psDBDumpRows(dbh, table);
-    if (ary == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL for dump rows");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 3;
-    }
-    if(ary->n != 3) {
-        psError(PS_ERR_UNKNOWN,true,"Rows dumped %d not as expected %d",
-                ary->n, 3);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 4;
-    }
-
-    row = (psMetadata*)psArrayGet(ary, 0);
-    if(!_check_row(row)) {
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-    row = (psMetadata*)psArrayGet(ary, 1);
-    if(!_check_const_row2(row)) {
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-    row = (psMetadata*)psArrayGet(ary, 2);
-    if(!_check_const_row1(row)) {
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 7;
-    }
-    psFree(ary);
-
-    // Attempt to dump row with database NULL
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL database");
-    if(psDBDumpRows(NULL,table)!=NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return non-NULL for NULL database specified");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 8;
-    }
-
-    // Attempt to dump row with table NULL
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL table");
-    if(psDBDumpRows(dbh,NULL)!=NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return non-NULL for NULL table specified");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 9;
-    }
-
-    psDBDropTable(dbh, table);
-
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #851, TPDBDumpCols shall dump all cols from a test table ...
-psS32 TPDBDumpCols( void )
-{
-    psDB*                dbh     = NULL;
-    const char*          table   = "table9";
-    psMetadata*          row     = NULL;
-    psMetadata*          meta    = NULL;
-    psMetadata*          md      = NULL;
-    psMetadataIterator*  mdIter  = NULL;
-    psMetadataItem*      mdItem  = NULL;
-    int                  itemNum = 0;
-
-    // Create database table definition
-    md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return to initialize database");
-        return 1;
-    }
-
-    // Create database table for testing
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of false to create test table");
-        psDBCleanup(dbh);
-        return 2;
-    }
-
-    // Add row with known data values
-    row = _get_const_row1();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    row = _get_const_row2();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    row = _get_row();
-    psDBInsertOneRow(dbh, table, row);
-    psFree(row);
-
-    // Dump columns with valid arguments
-    meta = psDBDumpCols(dbh, table);
-    mdIter = psMetadataIteratorAlloc(meta,PS_LIST_HEAD,NULL);
-
-    // Verify contents of metadata returned
-    if (meta == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return value NULL for dumpCols with valid args");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 3;
-    }
-    if(meta->list->n != 6) {
-        psError(PS_ERR_UNKNOWN,true,"Number of cols = %d not as expected %d",
-                meta->list->n,6);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 4;
-    }
-    // Verify the metadata items
-    itemNum = 0;
-    while ((mdItem = psMetadataGetAndIncrement(mdIter)) != NULL) {
-        switch(itemNum) {
-        case 0:
-            if(mdItem->type != PS_META_VEC) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
-                        itemNum,mdItem->type,PS_META_VEC);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 5*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_S32) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_S32);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 6*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->n != 3) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->n,3);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 7*(itemNum+1);
-            }
-            if(strcmp(mdItem->name,TAB_COL_5_NAME) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
-                        itemNum,mdItem->name,TAB_COL_5_NAME);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 8*(itemNum+1);
-            }
-            break;
-        case 1:
-            if(mdItem->type != PS_META_VEC) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
-                        itemNum,mdItem->type,PS_META_VEC);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 5*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_BOOL) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_BOOL);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 6*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->n != 3) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->n,3);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 7*(itemNum+1);
-            }
-            if(strcmp(mdItem->name,TAB_COL_4_NAME) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
-                        itemNum,mdItem->name,TAB_COL_4_NAME);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 8*(itemNum+1);
-            }
-            break;
-        case 2:
-            if(mdItem->type != PS_META_VEC) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
-                        itemNum,mdItem->type,PS_META_VEC);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 5*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_F64) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_F64);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 6*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->n != 3) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->n,3);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 7*(itemNum+1);
-            }
-            if(strcmp(mdItem->name,TAB_COL_3_NAME) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
-                        itemNum,mdItem->name,TAB_COL_3_NAME);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 8*(itemNum+1);
-            }
-            break;
-        case 3:
-            if(mdItem->type != PS_META_VEC) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
-                        itemNum,mdItem->type,PS_META_VEC);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 5*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_F32) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_F32);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 6*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->n != 3) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->n,3);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 7*(itemNum+1);
-            }
-            if(strcmp(mdItem->name,TAB_COL_2_NAME) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
-                        itemNum,mdItem->name,TAB_COL_2_NAME);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 8*(itemNum+1);
-            }
-            break;
-        case 4:
-            if(mdItem->type != PS_META_VEC) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
-                        itemNum,mdItem->type,PS_META_VEC);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 5*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->type.type != PS_TYPE_S32) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector type %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->type.type, PS_TYPE_S32);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 6*(itemNum+1);
-            }
-            if(((psVector*)mdItem->data.V)->n != 3) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
-                        itemNum,((psVector*)mdItem->data.V)->n,3);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 7*(itemNum+1);
-            }
-            if(strcmp(mdItem->name,TAB_COL_1_NAME) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
-                        itemNum,mdItem->name,TAB_COL_1_NAME);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 8*(itemNum+1);
-            }
-            break;
-        case 5:
-            if(mdItem->type != PS_META_ARRAY) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d",
-                        itemNum,mdItem->type,PS_META_ARRAY);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 5*(itemNum+1);
-            }
-            if(((psArray*)mdItem->data.V)->n != 3) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d vector size %d not as expected %d",
-                        itemNum,((psArray*)mdItem->data.V)->n,3);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 7*(itemNum+1);
-            }
-            if(strcmp(mdItem->name,TAB_COL_0_NAME) != 0) {
-                psError(PS_ERR_UNKNOWN,true,"Column #%d name %s not as expected %s",
-                        itemNum,mdItem->name,TAB_COL_0_NAME);
-                psDBDropTable(dbh,table);
-                psDBCleanup(dbh);
-                return 8*(itemNum+1);
-            }
-            break;
-
-        default:
-            break;
-        }
-        itemNum++;
-    }
-    psFree(mdIter);
-    psFree(meta);
-
-    // Attempt to dump columns from NULL database object
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL database");
-    if(psDBDumpCols(NULL,table) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL when dumping columns from NULL database");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 10;
-    }
-
-    // Attempt to dump columns for NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL table");
-    if(psDBDumpCols(dbh,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect non-NULL when dumping columns from NULL table");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 11;
-    }
-
-
-    psDBDropTable(dbh, table);
-
-    psFree(md);
-
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #852, TPDBUpdateRows shall update rows in a test table ...
-psS32 TPDBUpdateRows( void )
-{
-    psDB*            dbh       = NULL;
-    const char*      table     = "table10";
-    psArray*         ary       = NULL;
-    psArray*         rowSet    = NULL;
-    psMetadata*      row       = NULL;
-    psMetadata*      where     = NULL;
-    psMetadata*      updates   = NULL;
-    psMetadata*      md        = NULL;
-    int              chgRows   = 0;
-
-    // Create database table definition
-    md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL when initializing database");
-        return 1;
-    }
-
-    // Create test table
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false to create test table");
-        psDBCleanup(dbh);
-        return 2;
-    }
-
-    // Create array to hold rows to be added to test table
-    rowSet = psArrayAlloc(3);
-    rowSet->n = 0;
-
-    row = _get_const_row1();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-
-    row = _get_const_row2();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-
-    row = _get_row();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-
-    // Insert rows into test table
-    if(!psDBInsertRows(dbh, table, rowSet)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for inserting rows");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 3;
-    }
-
-    // Create where metadata to specify update - only one row
-    where = _get_where();
-
-    // Create update metadata to specify values
-    updates = _get_update_values(STR_2, S32_2, F32_2, F64_2, B_2);
-
-    // Perform database update with valid parameters
-    chgRows = psDBUpdateRows(dbh,table,where,updates);
-    if(chgRows != 1) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return other than 1 for valid arguments");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 4;
-    }
-    // Verify row contents after update
-    ary = psDBDumpRows(dbh, table);
-    if (ary == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return from dump rows");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-    row = (psMetadata*)psArrayGet(ary, 0);
-    if(!_check_row_update(row)) {
-        psError(PS_ERR_UNKNOWN,true,"Update row not verified");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-    psFree(ary);
-
-    // Attempt to update rows with NULL database
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL database");
-    chgRows = psDBUpdateRows(NULL,table,where,updates);
-    if(chgRows != -1) {
-        psError(PS_ERR_UNKNOWN,true,"Updated rows %ld not as expected %ld",
-                chgRows,-1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 7;
-    }
-
-    // Attempt to update rows with invalid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid table");
-    chgRows = psDBUpdateRows(dbh,"table999",where,updates);
-    if(chgRows != -1) {
-        psError(PS_ERR_UNKNOWN,true,"Updated rows %ld not as expected %ld",
-                chgRows,-1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 8;
-    }
-
-    // Attempt to update rows with NULL updates
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL updates");
-    chgRows = psDBUpdateRows(dbh,table,where,NULL);
-    if(chgRows != -1) {
-        psError(PS_ERR_UNKNOWN,true,"Updated rows %ld not as expected %ld",
-                chgRows,-1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 8;
-    }
-
-    // Attempt to update rows with invalid where specifying non-existent column
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid where");
-    psFree(where);
-    where = _get_invalid_where();
-    chgRows = psDBUpdateRows(dbh,table,where,updates);
-    if(chgRows != -1) {
-        psError(PS_ERR_UNKNOWN,true,"Updated rows %ld not as expected %ld",
-                chgRows,-1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 9;
-    }
-
-    // Attempt to update rows with bad value in where statement
-    psFree(where);
-    where = _get_where_bad_value();
-    chgRows = psDBUpdateRows(dbh,table,where,updates);
-    if(chgRows != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Updated rows %ld not as expected %ld",
-                chgRows,0);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 10;
-    }
-    // Verify row contents after update - no change
-    ary = psDBDumpRows(dbh, table);
-    if (ary == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect NULL return from dump rows");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 11;
-    }
-    row = (psMetadata*)psArrayGet(ary, 0);
-    if(!_check_row_update(row)) {
-        psError(PS_ERR_UNKNOWN,true,"Update row not verified");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 12;
-    }
-    psFree(ary);
-
-    psFree(updates);
-    psFree(where);
-    psFree(rowSet);
-    psDBDropTable(dbh, table);
-
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-// Testpoint #853, TPDBDeleteRows shall update rows in a test table ...
-psS32 TPDBDeleteRows( void )
-{
-    psDB*         dbh       = NULL;
-    const char*   table     = "table11";
-    psArray*      ary       = NULL;
-    psArray*      rowSet    = NULL;
-    psMetadata*   where     = NULL;
-    psMetadata*   row       = NULL;
-    psMetadata*   md        = NULL;
-    int           chgRows   = 0;
-
-    // Create database table definition
-    md = _get_CreateTableMetadata();
-
-    // Initialize database connection
-    dbh = _init_psDB();
-    if (dbh == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL for initialize database");
-        return 1;
-    }
-
-    // Create test table
-    if(!psDBCreateTable(dbh, table, md)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for creating test table");
-        psDBCleanup(dbh);
-        return 2;
-    }
-
-    // Create known data rows to put into test table
-    rowSet = psArrayAlloc(3);
-    rowSet->n = 0;
-    row = _get_const_row1();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-    row = _get_const_row2();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-    row = _get_row();
-    psArrayAdd(rowSet, 0, row);
-    psFree(row);
-    if(!psDBInsertRows(dbh, table, rowSet)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return false for inserting data into table");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 3;
-    }
-
-    // Create where clause to specify the row to remove
-    where = _get_where();
-
-    // Delete row with valid arguments
-    chgRows = psDBDeleteRows(dbh,table,where,10);
-    if(chgRows != 1) {
-        psError(PS_ERR_UNKNOWN,true,"Deleted rows %ld not as expected %ld",
-                chgRows,1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 4;
-    }
-    // Verify table contents
-    ary = psDBDumpRows(dbh, table);
-    if (ary == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL for dump rows");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 5;
-    }
-    if (ary->n != 2) {
-        psError(PS_ERR_UNKNOWN,true,"Remaining rows %d not as expected %d",
-                ary->n,2);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 6;
-    }
-    psFree(ary);
-
-    // Attempt to delete row just deleted again
-    chgRows = psDBDeleteRows(dbh,table,where,10);
-    if(chgRows != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Deleted rows %ld not as expected %ld",
-                chgRows,0);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 7;
-    }
-    // Verify table contents
-    ary = psDBDumpRows(dbh, table);
-    if (ary == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL for dump rows");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 8;
-    }
-    if (ary->n != 2) {
-        psError(PS_ERR_UNKNOWN,true,"Remaining rows %d not as expected %d",
-                ary->n,2);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 9;
-    }
-    psFree(ary);
-
-    // Attempt to delete row with NULL database
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL database");
-    chgRows = psDBDeleteRows(NULL,table,where,10);
-    if(chgRows > 0) {
-        psError(PS_ERR_UNKNOWN,true,"Deleted rows %ld not as expected %ld",
-                chgRows, -1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 10;
-    }
-
-    // Attempt to delete row with invalid table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid table");
-    chgRows = psDBDeleteRows(dbh,"table999",where,10);
-    if(chgRows > 0) {
-        psError(PS_ERR_UNKNOWN,true,"Deleted rows %ld not as expected %ld",
-                chgRows, -1);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 11;
-    }
-
-    // Attempt to delete row with NULL where - deletes all rows
-    chgRows = psDBDeleteRows(dbh,table,NULL,10);
-    if(chgRows != 2) {
-        psError(PS_ERR_UNKNOWN,true,"Deleted rows %ld not as expected %ld",
-                chgRows, 2);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 12;
-    }
-    // Verify table contents
-    ary = psDBDumpRows(dbh, table);
-    if (ary == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return NULL for dump rows");
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 13;
-    }
-    if (ary->n != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Remaining rows %d not as expected %d",
-                ary->n,0);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 14;
-    }
-    psFree(ary);
-
-    // Attempt to delete row with NULL where - deletes all rows from an empty table
-    chgRows = psDBDeleteRows(dbh,table,NULL,10);
-    if(chgRows != 0) {
-        psError(PS_ERR_UNKNOWN,true,"Deleted rows %ld not as expected %ld",
-                chgRows, 0);
-        psDBDropTable(dbh,table);
-        psDBCleanup(dbh);
-        return 15;
-    }
-
-    psFree(where);
-    psFree(rowSet);
-    psDBDropTable(dbh, table);
-
-    psFree(md);
-    psDBCleanup(dbh);
-
-    return 0;
-}
-
-//
-// Tests for psDBCreate and psDBDrop can only be executed if the user
-// has system admin privileges for the SQL server so the tests have been
-// commented out.
-//
-// Testpoint #XXX, psDBCreate shall create a new test database.
-//psS32 TPDBCreate( void )
-//{
-//    const char *test_db = "ps_test_db";
-//    psS32 failed = 0;
-//    psDB *dbh = NULL;
-//
-//    dbh = _init_psDB();
-//    if (dbh == NULL) {
-//        return 1;
-//    }
-//
-//    psLogMsg( __func__, PS_LOG_INFO, "psDBCreate shall create new new test database.\n" );
-//
-//    failed = ! psDBCreate(dbh, test_db);
-//    if (!failed) {
-//        psDBDrop(dbh, test_db);
-//    }
-//
-//    psDBCleanup(dbh);
-//
-//    return failed;
-//}
-
-// Testpoint #XXX, psDBDrop shall create a new test database.
-//psS32 TPDBDrop( void )
-//{
-//    const char *test_db = "ps_test_db";
-//    psS32 failed = 0;
-//    psDB *dbh = NULL;
-//
-//    dbh = _init_psDB();
-//    if (dbh == NULL) {
-//        return 1;
-//    }
-//
-//    psLogMsg( __func__, PS_LOG_INFO, "psDBDrop shall create/drop a new new test database.\n" );
-//
-//    failed = psDBCreate(dbh, test_db);
-//    if (!failed) {
-//        failed = ! psDBDrop(dbh, test_db);
-//    }
-//
-//    psDBCleanup(dbh);
-//
-//    return failed;
-//}
-
Index: trunk/psLib/test/dataIO/tst_psFits.c
===================================================================
--- trunk/psLib/test/dataIO/tst_psFits.c	(revision 4457)
+++ 	(revision )
@@ -1,1523 +1,0 @@
-/** @file  tst_psFits.c
-*
-*  @brief Contains the tests for psFits.[ch]
-*
-*
-*  @author Robert DeSonia, MHPCC
-*
-*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-07-06 03:04:35 $
-*
-*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
-*/
-
-#include <unistd.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.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 bool makeMulti(void);  // implicitly tests psFitsSetExtName
-static bool makeTable(void);
-const char* multiFilename = "multi.fits";
-const char* tableFilename = "table.fits";
-const int tableNumRows = 10;
-
-
-// N.B., the tests to Image read/write was liberally taken from the now
-// deprecated psImageReadSection/psImageWriteSection function tests.
-static psS32 testImageRead(void);
-static psS32 testImageWrite(void);
-
-static psS32 tst_psFitsAlloc( void );
-static psS32 tst_psFitsMoveExtName( void ); // also tests psFitsGetExtName
-static psS32 tst_psFitsMoveExtNum( void );  // also tests psFitsGetExtNum, psFitsGetSize
-static psS32 tst_psFitsReadHeader( void );
-static psS32 tst_psFitsReadHeaderSet( void );
-static psS32 tst_psFitsReadTable( void );
-static psS32 tst_psFitsReadTableColumnNum(void);
-static psS32 tst_psFitsReadTableColumn(void);
-static psS32 tst_psFitsUpdateTable(void);
-static psS32 tst_psFitsWriteHeader(void);
-
-testDescription tests[] = {
-                              {tst_psFitsAlloc, 801, "psFitsAlloc", 0, false},
-                              {tst_psFitsMoveExtName, 802, "psFitsMoveExtName", 0, false},
-                              {tst_psFitsMoveExtName, 802, "psFitsGetExtName", 0, true},
-                              {tst_psFitsMoveExtNum, 803, "psFitsMoveExtNum", 0, false},
-                              {tst_psFitsMoveExtNum, 803, "psFitsGetExtNum", 0, true},
-                              {tst_psFitsMoveExtNum, 803, "psFitsGetSize", 0, true},
-                              {tst_psFitsReadHeader, 804, "psFitsReadHeader", 0, false},
-                              {tst_psFitsReadHeaderSet,805, "psFitsReadHeaderSet", 0, false},
-                              {tst_psFitsReadTable,809, "psFitsReadTable", 0, false},
-                              {tst_psFitsReadTableColumnNum,836, "psFitsReadTableColumnNum", 0, false},
-                              {tst_psFitsReadTableColumn,839, "psFitsReadTableColumn", 0, false},
-                              {tst_psFitsUpdateTable,840, "psFitsUpdateTable", 0, false},
-                              {testImageRead,567, "psFitsReadImage", 0, false},
-                              {testImageWrite,569, "psFitsWriteImage", 0, false},
-                              {tst_psFitsWriteHeader,000,"psFitsWriteHeader",0,false},
-                              {NULL}
-                          };
-
-psS32 main( psS32 argc, char* argv[] )
-{
-    psLogSetLevel( PS_LOG_INFO );
-
-    return ( ! runTestSuite( stderr, "psImage", tests, argc, argv ) );
-}
-
-bool makeMulti(void)
-{
-
-    remove
-        (multiFilename);
-
-    psFits* fitsFile = psFitsAlloc(multiFilename);
-
-    if (fitsFile == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Could not create 'multi' FITS file.");
-        return false;
-    }
-
-    psImage* image = psImageAlloc(16,16,PS_TYPE_F32);
-
-    char extname[80];
-    for (int lcv = 0; lcv < 8; lcv++) {
-        snprintf(extname,80,"ext-%d", lcv);
-
-        psMetadata* header = psMetadataAlloc();
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYINT",
-                      PS_META_S32,
-                      "psS32 Item", (psS32)lcv);
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYFLT",
-                      PS_META_F32,
-                      "psF32 Item", (float)(1.0f/(float)(1+lcv)));
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYDBL",
-                      PS_META_F64,
-                      "psF64 Item", (double)(1.0/(double)(1+lcv)));
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYBOOL",
-                      PS_META_BOOL,
-                      "psBool Item",
-                      (lcv%2 == 0));
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYSTR",
-                      PS_META_STR,
-                      "String Item",
-                      extname);
-
-        psMetadataAdd(header,PS_LIST_TAIL, "EXTNAME",
-                      PS_META_STR,
-                      "Extension Name",
-                      extname);
-
-        // set the pixels in the image
-        psBinaryOp(image,image,"=",psScalarAlloc(lcv,PS_TYPE_F32));
-        if (! psFitsWriteImage(fitsFile,header,image,1) ) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Could not write image.");
-            return false;
-        }
-
-        psFree(header);
-    }
-    psFree(image);
-    psFree(fitsFile);
-
-    return true;
-}
-
-bool makeTable(void)
-{
-
-    remove
-        (tableFilename);
-
-    psFits* fitsFile = psFitsAlloc(tableFilename);
-
-    if (fitsFile == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Could not create 'table' FITS file.");
-        return false;
-    }
-
-    // make the PHU an image (per FITS standard, it must be)
-    psImage* image = psImageAlloc(16,16,PS_TYPE_F32);
-
-    if (! psFitsWriteImage(fitsFile,NULL,image,1) ) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Could not write PHU image.");
-        return false;
-    }
-
-    psFree(image);
-
-    // build a table structure
-    psArray* table = psArrayAlloc(tableNumRows);
-    psMetadata* header = NULL;
-    for (int row = 0; row < tableNumRows; row++) {
-        header = psMetadataAlloc();
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYINT",
-                      PS_META_S32,
-                      "psS32 Item",
-                      (psS32)row);
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYFLT",
-                      PS_META_F32,
-                      "psF32 Item",
-                      (float)(1.0f/(float)(1+row)));
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYDBL",
-                      PS_META_F64,
-                      "psF64 Item",
-                      (double)(1.0/(double)(1+row)));
-
-        psMetadataAdd(header,PS_LIST_TAIL, "MYBOOL",
-                      PS_META_BOOL,
-                      "psBool Item",
-                      (row%2 == 0));
-
-        table->data[row] = header;
-    }
-
-    psFitsWriteTable(fitsFile, NULL, table);
-
-    psFree(table);
-    psFree(fitsFile);
-
-    return ! psMemCheckLeaks(15,NULL,stderr,false);
-}
-
-psS32 tst_psFitsAlloc( void )
-{
-
-    if (! makeMulti() ) {
-        return 1;
-    }
-
-    psFits* fitsFile = psFitsAlloc(multiFilename);
-
-    if (fitsFile == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 1;
-    }
-
-    int extNum = psFitsGetExtNum(fitsFile);
-    if (extNum != 0) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc was not queued to the PHU, but to extension #%d.",
-                extNum);
-        return 2;
-    }
-
-    psFree(fitsFile);
-
-    // make sure the file doesn't already exist.
-    if (access("new.fits", F_OK) == 0) {
-        if (remove
-                ("new.fits") != 0) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Couldn't delete the new.fits file.");
-            return 3;
-        }
-    }
-
-    fitsFile = psFitsAlloc("new.fits");
-
-    if (fitsFile == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 4;
-    }
-
-    psFree(fitsFile);
-
-    // now, if psFitsAlloc actually created the file, I shouldn't error in removing it.
-    if (remove
-            ("new.fits") != 0) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc seemed to not have created a new file.");
-        return 5;
-    }
-
-    // Attempt to allocate with NULL filename
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
-    fitsFile = psFitsAlloc(NULL);
-    if(fitsFile != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"psFitsAlloc did not return NULL for NULL input");
-        return 5;
-    }
-
-    return 0;
-}
-
-psS32 tst_psFitsMoveExtName( void )
-{
-
-    if (! makeMulti() ) {
-        return 1;
-    }
-
-    psFits* fits = psFitsAlloc(multiFilename);
-
-    if (fits == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 1;
-    }
-
-    int numHDUs = psFitsGetSize(fits);
-
-    if (numHDUs < 2) {
-        psError(PS_ERR_UNKNOWN,true,
-                "The 'multi' FITS file does not have multiple HDUs.");
-        return 2;
-    }
-
-    char extName[80];
-    psRegion region = {0,0,0,0};
-
-    for (int lcv = 0; lcv < numHDUs; lcv++) {
-        snprintf(extName,80,"ext-%d",lcv);
-        // try to move to the named extension.
-        if (! psFitsMoveExtName(fits, extName) ) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to move to ext-%d.",
-                    lcv);
-            return 3;
-        }
-
-        // check to see if I can retrieve the name back from the psFits object.
-        char* nameFromFile = psFitsGetExtName(fits);
-        if (strcmp(nameFromFile,extName) != 0) { // hey, it didn't move?
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to retrieve the extension name back ('%s' vs '%s'",
-                    nameFromFile, extName);
-            return 3;
-        }
-        psFree(nameFromFile);
-
-        // check that the image is associated to the extension moved, i.e.,
-        // did we really move to the proper extension?
-        psImage* image = psFitsReadImage(NULL, fits,region,0);
-
-        if (image == NULL || abs(image->data.F32[0][0] - (float)lcv) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "The image pixel 0,0 of ext-%d was %g, expected %d.",
-                    lcv,image->data.F32[0][0],lcv);
-            return 4;
-        }
-        psFree(image);
-    }
-
-    for (int lcv = numHDUs-1; lcv >= 0; lcv--) {
-        snprintf(extName,80,"ext-%d",lcv);
-        // try to move to the named extension.
-        if (! psFitsMoveExtName(fits, extName) ) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to move to ext-%d.",
-                    lcv);
-            return 5;
-        }
-
-        // check to see if I can retrieve the name back from the psFits object.
-        char* nameFromFile = psFitsGetExtName(fits);
-        if (strcmp(nameFromFile,extName) != 0) { // hey, it didn't move?
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to retrieve the extension name back ('%s' vs '%s'",
-                    nameFromFile, extName);
-            return 5;
-        }
-        psFree(nameFromFile);
-
-        // check that the image is associated to the extension moved, i.e.,
-        // did we really move to the proper extension?
-        psImage* image = psFitsReadImage(NULL, fits,region,0);
-
-        if (abs(image->data.F32[0][0] - (float)lcv) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "The image pixel 0,0 of ext-%d was %g, expected %d.",
-                    lcv,image->data.F32[0][0],lcv);
-            return 6;
-        }
-        psFree(image);
-    }
-
-    // check to see if given a bogus extension name, it errors.
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error.");
-    if (psFitsMoveExtName(fits, "bogus") || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Moving to non-existant HDU didn't fail.");
-        return 7;
-    }
-
-    // check to see if given a NULL psFits, it errors.
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error.");
-    if (psFitsMoveExtName(NULL, "bogus") || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Operation of NULL psFits didn't fail.");
-        return 8;
-    }
-
-    // check to see if given a NULL extname, it errors.
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error.");
-    if (psFitsMoveExtName(fits, NULL) || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Operation of NULL extname didn't fail.");
-        return 9;
-    }
-
-    psFree(fits);
-
-    // Attempt to get ext name from null fits file
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for NULL fits file");
-    if(psFitsGetExtName(NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Expected NULL return from psFitsGetExtName with NULL fits file");
-        return 10;
-    }
-
-    return 0;
-}
-
-psS32 tst_psFitsMoveExtNum( void )
-{
-
-    if (! makeMulti() ) {
-        return 1;
-    }
-
-    psFits* fits = psFitsAlloc(multiFilename);
-
-    if (fits == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 1;
-    }
-
-    int numHDUs = psFitsGetSize(fits);
-
-    // as a side test, let's make sure psFitsGetSize can handle NULL.
-    psLogMsg(__func__,PS_LOG_INFO,
-             "Following should be an error.");
-    psErrorClear();
-    if (psFitsGetSize(NULL) != 0 || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN,true,
-                "The 'multi' FITS file does not have multiple HDUs.");
-        return 2;
-    }
-
-    if (numHDUs != 8) {
-        psError(PS_ERR_UNKNOWN,true,
-                "The 'multi' FITS file does not have multiple HDUs.");
-        return 2;
-    }
-
-    psRegion region = {0,0,0,0};
-
-    // test absolute positioning
-    for (int lcv = 0; lcv < numHDUs; lcv++) {
-        // try to move to the extension
-        if (! psFitsMoveExtNum(fits, lcv, false) ) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to move to extension %d.",
-                    lcv);
-            return 3;
-        }
-
-        // check to see if I can retrieve the number back from the psFits object.
-        if (psFitsGetExtNum(fits) != lcv) { // hey, it didn't move?
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to retrieve the extension number back (%d vs %d)",
-                    psFitsGetExtNum(fits), lcv);
-            return 5;
-        }
-
-        // check that the image is associated to the extension moved, i.e.,
-        // did we really move to the proper extension?
-        psImage* image = psFitsReadImage(NULL, fits,region,0);
-
-        if (image == NULL || abs(image->data.F32[0][0] - (float)lcv) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "The image pixel 0,0 of ext-%d was %g, expected %d.",
-                    lcv,image->data.F32[0][0],lcv);
-            return 4;
-        }
-        psFree(image);
-    }
-
-    for (int lcv = numHDUs-1; lcv >= 0; lcv--) {
-        // try to move to the extension
-        if (! psFitsMoveExtNum(fits, lcv, false) ) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to move to extension %d.",
-                    lcv);
-            return 5;
-        }
-
-        // check that the image is associated to the extension moved, i.e.,
-        // did we really move to the proper extension?
-        psImage* image = psFitsReadImage(NULL, fits,region,0);
-
-        if (abs(image->data.F32[0][0] - (float)lcv) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "The image pixel 0,0 of ext-%d was %g, expected %d.",
-                    lcv,image->data.F32[0][0],lcv);
-            return 6;
-        }
-        psFree(image);
-    }
-
-    // test relative positioning
-    psFitsMoveExtNum(fits,0,false);
-    for (int lcv = 1; lcv < numHDUs; lcv++) {
-        // try to move to the extension
-        if (! psFitsMoveExtNum(fits, 1, true) ) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to move to extension %d.",
-                    lcv);
-            return 13;
-        }
-
-        // check to see if I can retrieve the number back from the psFits object.
-        if (psFitsGetExtNum(fits) != lcv) { // hey, it didn't move?
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to retrieve the extension number back (%d vs %d)",
-                    psFitsGetExtNum(fits), lcv);
-            return 13;
-        }
-
-        // check that the image is associated to the extension moved, i.e.,
-        // did we really move to the proper extension?
-        psImage* image = psFitsReadImage(NULL, fits,region,0);
-
-        if (image == NULL || abs(image->data.F32[0][0] - (float)lcv) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "The image pixel 0,0 of ext-%d was %g, expected %d.",
-                    lcv,image->data.F32[0][0],lcv);
-            return 14;
-        }
-        psFree(image);
-    }
-
-    for (int lcv = numHDUs-2; lcv >= 0; lcv--) {
-        // try to move to the extension
-        if (! psFitsMoveExtNum(fits, -1, true) ) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to move to extension %d.",
-                    lcv);
-            return 15;
-        }
-
-        // check to see if I can retrieve the number back from the psFits object.
-        if (psFitsGetExtNum(fits) != lcv) { // hey, it didn't move?
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to retrieve the extension number back (%d vs %d)",
-                    psFitsGetExtNum(fits), lcv);
-            return 15;
-        }
-
-        // check that the image is associated to the extension moved, i.e.,
-        // did we really move to the proper extension?
-        psImage* image = psFitsReadImage(NULL, fits,region,0);
-
-        if (abs(image->data.F32[0][0] - (float)lcv) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "The image pixel 0,0 of ext-%d was %g, expected %d.",
-                    lcv,image->data.F32[0][0],lcv);
-            return 16;
-        }
-        psFree(image);
-    }
-
-    // check to see if given a negative extension number, it errors.
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error.");
-    psErrorClear();
-    if (psFitsMoveExtNum(fits, -1, false) || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Moving to negative HDU didn't fail.");
-        return 21;
-    }
-
-    // check to see if relative positioning beyond PHU, it errors.
-    psFitsMoveExtNum(fits,0,false);
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error.");
-    psErrorClear();
-    if (psFitsMoveExtNum(fits, -1, true) || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Moving to negative HDU didn't fail.");
-        return 22;
-    }
-
-
-    // check to see if given a extension greater than the total #HDUs, it errors.
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error.");
-    psErrorClear();
-    if (psFitsMoveExtNum(fits, numHDUs, false) || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Moving to a HDU beyond the file's contents didn't fail.");
-        return 31;
-    }
-
-    // check to see if relative positioning beyond PHU, it errors.
-    psFitsMoveExtNum(fits,numHDUs-1,false);
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error.");
-    psErrorClear();
-    if (psFitsMoveExtNum(fits, 1, true) || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Moving to negative HDU didn't fail.");
-        return 32;
-    }
-
-    // check to see if given a NULL psFits, it errors.
-    psLogMsg(__func__,PS_LOG_INFO, "Following should be an error.");
-    psErrorClear();
-    if (psFitsMoveExtNum(NULL, 0, false) || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Operation of NULL psFits didn't fail.");
-        return 40;
-    }
-
-    psFree(fits);
-
-    // Attempt to get ext name from null fits file
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for NULL fits file");
-    if(psFitsGetExtNum(NULL) != PS_FITS_TYPE_NONE) {
-        psError(PS_ERR_UNKNOWN,true,"Expected NULL return from psFitsGetExtNum with NULL fits file");
-        return 10;
-    }
-
-    return 0;
-}
-
-static psS32 tst_psFitsReadHeader( void )
-{
-    if (! makeMulti() ) {
-        return 1;
-    }
-
-    psFits* fits = psFitsAlloc(multiFilename);
-
-    if (fits == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 1;
-    }
-
-    int numHDUs = psFitsGetSize(fits);
-
-    if (numHDUs < 8) {
-        psError(PS_ERR_UNKNOWN,true,
-                "The 'multi' FITS file does not have multiple HDUs.");
-        return 2;
-    }
-
-    char extname[80];
-    for (int hdunum = 0; hdunum < numHDUs; hdunum++) {
-        snprintf(extname,80,"ext-%d",hdunum);
-
-        psFitsMoveExtNum(fits,hdunum,false);
-
-        psMetadata* header = psFitsReadHeader(NULL,fits);
-        if (header == NULL) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to read header");
-            return 3;
-        }
-
-        psMetadata* header2 = psMetadataAlloc();
-        header2 = psFitsReadHeader(header2,fits);
-        if (header2 == NULL) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "Failed to read header");
-            return 11;
-        }
-
-        if (header->list->n < 1 || header->list->n != header2->list->n) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Reading the header given a NULL input psMetadata differed "
-                    "from giving an existing psMetadata.");
-            return 12;
-        }
-
-        // check for the extra metadata items
-        psS32 intItem = psMetadataLookupS32(NULL,header, "MYINT");
-        psF32 fltItem = psMetadataLookupF32(NULL,header, "MYFLT");
-        psF64 dblItem = psMetadataLookupF64(NULL,header, "MYDBL");
-        psMetadataItem* boolItem = psMetadataLookup(header, "MYBOOL");
-        char* strItem = psMetadataLookupPtr(NULL, header, "MYSTR");
-
-        if (intItem != hdunum) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve psS32 metadata item from file.");
-            return 20;
-        }
-
-        if (fabsf(fltItem - 1.0f/(float)(1+hdunum)) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve psF32 metadata item from file.  Got %f vs %f",
-                    fltItem,1.0f/(float)(1+hdunum));
-            return 21;
-        }
-
-        if (abs(dblItem - 1.0/(double)(1+hdunum)) > DBL_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve psF64 metadata item from file.  Got %g vs %g",
-                    dblItem, 1.0/(double)(1+hdunum));
-            return 22;
-        }
-
-        if (boolItem == NULL ||
-                boolItem->type != PS_META_BOOL) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve psBool metadata item from file.");
-            return 23;
-        }
-
-        if (strItem == NULL || strncmp(strItem,extname,strlen(extname)) != 0) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve string metadata item from file.  Got '%s' vs '%s' (%d)",
-                    strItem,extname,strlen(extname));
-            return 24;
-        }
-
-        psFree(header);
-        psFree(header2);
-    }
-
-    psLogMsg(__func__,PS_LOG_INFO,"following should be an error (input psFits = NULL)");
-    psMetadata* header = psFitsReadHeader(NULL,NULL);
-
-    if (header != NULL || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psFitsReadHeader didn't error on a NULL psFits.");
-        return 30;
-    }
-
-
-    psFree(fits);
-
-    return 0;
-}
-
-static psS32 tst_psFitsReadHeaderSet( void )
-{
-    if (! makeMulti() ) {
-        return 1;
-    }
-
-    psFits* fits = psFitsAlloc(multiFilename);
-
-    if (fits == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 1;
-    }
-
-    int numHDUs = psFitsGetSize(fits);
-
-    if (numHDUs < 8) {
-        psError(PS_ERR_UNKNOWN,true,
-                "The 'multi' FITS file does not have multiple HDUs.");
-        return 2;
-    }
-
-    // move to the middle
-    psFitsMoveExtNum(fits,numHDUs/2, false);
-
-    psMetadata* headerSet = psFitsReadHeaderSet(NULL, fits);
-
-    if (headerSet == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadHeaderSet returned NULL unexpectedly.");
-        return 3;
-    }
-
-    if (psFitsGetExtNum(fits) != numHDUs/2) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadHeaderSet changed the CHU.");
-        return 4;
-    }
-
-    char extname[80];
-    for (int i = 0; i < numHDUs; i++) {
-        if (i == 0) {
-            snprintf(extname, 80, "PHU");
-        } else {
-            snprintf(extname, 80, "ext-%d", i);
-        }
-
-        psMetadata* header = psMetadataLookupPtr(NULL,headerSet, extname);
-
-        if (header == NULL) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadHeader returned NULL unexpectedly for HDU#%d.",
-                    i);
-            return 5;
-        }
-
-        psS32 intItem = psMetadataLookupS32(NULL, header, "MYINT");
-
-        if (intItem != i) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadHeader for HDU#%d had a MYINT of %d, expected %d.",
-                    intItem, i);
-            return 6;
-        }
-
-    }
-
-    psMetadata* set2 = psMetadataAlloc();
-    set2 = psFitsReadHeaderSet(set2,NULL);
-    if (set2 != NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadHeaderSet returned non-NULL given a NULL psFits.");
-        return 10;
-    }
-
-    psMetadata* set3 = psMetadataAlloc();
-    set3 = psFitsReadHeaderSet(set3,fits);
-
-    if (set3 == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadHeaderSet returned NULL unexpectedly.");
-        return 11;
-    }
-
-    for (int i = 0; i < numHDUs; i++) {
-        if (i == 0) {
-            snprintf(extname, 80, "PHU");
-        } else {
-            snprintf(extname, 80, "ext-%d", i);
-        }
-
-        psMetadata* header = psMetadataLookupPtr(NULL, set3, extname);
-
-        if (header == NULL) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadHeader returned NULL unexpectedly for HDU#%d.",
-                    i);
-            return 5;
-        }
-
-        psS32 intItem = psMetadataLookupS32(NULL, header, "MYINT");
-
-        if (intItem != i) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadHeader for HDU#%d had a MYINT of %d, expected %d.",
-                    intItem, i);
-            return 6;
-        }
-
-    }
-
-
-
-    psFree(headerSet);
-    psFree(set3);
-    // set2 should have been freed by psFitsReadHeaderSet upon an error.
-
-    psFree(fits);
-
-    return 0;
-}
-
-static psS32 tst_psFitsReadTable( void )
-{
-
-
-    if (! makeTable()) {
-        return 1;
-    }
-
-    psFits* fits = psFitsAlloc(tableFilename);
-
-    if (fits == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 1;
-    }
-
-    psFitsMoveExtNum(fits,1,false);
-
-    psArray* table = psFitsReadTable(fits);
-
-    if (table == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTable returned NULL unexpectedly.");
-        return 2;
-    }
-
-    if (table->n != tableNumRows) {
-        psError(PS_ERR_UNKNOWN, false,
-                "Expected %d rows, but read %d.",
-                tableNumRows, table->n);
-        return 3;
-    }
-
-
-    for (int row = 0; row < table->n; row++) {
-        psMetadata* rowData = table->data[row];
-
-        psS32 intItem = psMetadataLookupS32(NULL, rowData, "MYINT");
-        psF32 fltItem = psMetadataLookupF32(NULL, rowData, "MYFLT");
-        psF64 dblItem = psMetadataLookupF64(NULL, rowData, "MYDBL");
-        psBool boolItem = psMetadataLookupBool(NULL, rowData, "MYBOOL");
-
-        if (intItem != row) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve psS32 metadata item from file (row=%d).  Got %d vs %d",
-                    row, intItem, row);
-            return 20;
-        }
-
-        if (fabsf(fltItem - 1.0f/(float)(1+row)) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve psF32 metadata item from file (row=%d).  Got %f vs %f",
-                    row, fltItem,1.0f/(float)(1+row));
-            return 21;
-        }
-
-        if (abs(dblItem - 1.0/(double)(1+row)) > DBL_EPSILON) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve psF64 metadata item from file (row=%d).  Got %g vs %g",
-                    row, dblItem, 1.0/(double)(1+row));
-            return 22;
-        }
-
-        if ( boolItem != ((row&0x01) == 0)) {
-            psError(PS_ERR_UNKNOWN, true,
-                    "Failed to retrieve psBool metadata item from file (row=%d). Got %d vs %d",
-                    row, boolItem, ((row&0x01) == 0));
-            return 23;
-        }
-    }
-
-    psFree(table);
-    psFree(fits);
-
-    psArray* nullTest = psFitsReadTable(NULL);
-
-    if (nullTest != NULL || psErrorGetStackSize() != 1) {
-        psError(PS_ERR_UNKNOWN, true,
-                "psFitsReadTable returned non-NULL when given NULL.");
-        return 30;
-    }
-
-    return 0;
-}
-
-static psS32 tst_psFitsReadTableColumnNum( void )
-{
-    if (! makeTable()) {
-        return 1;
-    }
-
-    psFits* fits = psFitsAlloc(tableFilename);
-
-    if (fits == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 1;
-    }
-
-    psFitsMoveExtNum(fits,1,false);
-
-    // read the column data via number
-    psVector* colData;
-    psElemType type[4] = {PS_TYPE_S32, PS_TYPE_F32, PS_TYPE_F32, PS_TYPE_BOOL};
-    psElemType altType[4] = {PS_TYPE_S64, PS_TYPE_F64, PS_TYPE_F64, PS_TYPE_BOOL};
-    char* colname[4] = {"MYINT","MYFLT","MYDBL","MYBOOL"};
-    psF64 expectedValues[4][10] = {
-                                      {0,1,2,3,4,5,6,7,8,9},
-                                      {1.0,1.0/2.0,1.0/3.0,1.0/4.0,1.0/5.0,1.0/6.0,1.0/7.0,1.0/8.0,1.0/9.0},
-                                      {1.0,1.0/2.0,1.0/3.0,1.0/4.0,1.0/5.0,1.0/6.0,1.0/7.0,1.0/8.0,1.0/9.0},
-                                      {1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0}
-                                  };
-
-    for (int col = 0; col < 4; col++) {
-        colData = psFitsReadTableColumnNum(fits,colname[col]);
-        if (colData == NULL) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadTableColumnNum returned NULL for col=%d",
-                    col);
-            return 2;
-        }
-        if (colData->type.type != type[col] &&
-                colData->type.type != altType[col]) {
-            char* typeRead;
-            char* typeExpected;
-            PS_TYPE_NAME(typeRead, colData->type.type);
-            PS_TYPE_NAME(typeExpected, type[col]);
-
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadTableColumnNum returned different type, %s vs %s, for col=%d",
-                    typeRead, typeExpected, col);
-            return 3;
-        }
-        if (colData->n != tableNumRows) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadTableColumnNum returned different number of rows, %d vs %d, for col=%d",
-                    colData->n, tableNumRows, col);
-            return 4;
-        }
-        for (int row = 0; row < tableNumRows; row++) {
-            if (abs(p_psVectorGetElementF64(colData,row) - expectedValues[col][row]) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, false,
-                        "psFitsReadTableColumnNum returned unexpected values (%g vs %g) for col=%d",
-                        p_psVectorGetElementF64(colData,row), expectedValues[col][row], col);
-                return 5;
-            }
-        }
-        psFree(colData);
-    }
-
-    psWarning("Following should be an error.");
-    psErrorClear();
-    psVector* data = psFitsReadTableColumnNum(NULL,colname[0]);
-    psErr* err = psErrorLast();
-    if (data != NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTableColumnNum did not return NULL with NULL psFits");
-        return 6;
-    }
-    if (err->code != PS_ERR_BAD_PARAMETER_NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTableColumnNum did not error with NULL psFits");
-        return 7;
-    }
-    psFree(err);
-
-    psWarning("Following should be an error.");
-    psErrorClear();
-    data = psFitsReadTableColumnNum(fits,"BOGUS");
-    err = psErrorLast();
-    if (data != NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTableColumnNum did not return NULL with bogus column name.");
-        return 8;
-    }
-    if (err->code != PS_ERR_IO) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTableColumnNum did not error with bogus column name.");
-        return 9;
-    }
-    psFree(err);
-
-    psFree(fits);
-
-    return 0;
-}
-
-static psS32 tst_psFitsReadTableColumn( void )
-{
-    if (! makeTable()) {
-        return 1;
-    }
-
-    psFits* fits = psFitsAlloc(tableFilename);
-
-    if (fits == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 1;
-    }
-
-    psFitsMoveExtNum(fits,1,false);
-
-    // read the column data via number
-    psArray* colData;
-    char* colname[4] = {"MYINT","MYFLT","MYDBL","MYBOOL"};
-    psF64 expectedValues[4][10] = {
-                                      {0,1,2,3,4,5,6,7,8,9},
-                                      {1.0,1.0/2.0,1.0/3.0,1.0/4.0,1.0/5.0,1.0/6.0,1.0/7.0,1.0/8.0,1.0/9.0},
-                                      {1.0,1.0/2.0,1.0/3.0,1.0/4.0,1.0/5.0,1.0/6.0,1.0/7.0,1.0/8.0,1.0/9.0},
-                                      {1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0}
-                                  };
-
-    for (int col = 0; col < 4; col++) {
-        colData = psFitsReadTableColumn(fits,colname[col]);
-        if (colData == NULL) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadTableColumn returned NULL for col=%d",
-                    col);
-            return 2;
-        }
-        if (colData->n != tableNumRows) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsReadTableColumn returned different number of rows, %d vs %d, for col=%d",
-                    colData->n, tableNumRows, col);
-            return 4;
-        }
-        if (col < 3) {
-            for (int row = 0; row < tableNumRows; row++) {
-                if (abs(atof((char*)colData->data[row]) - expectedValues[col][row]) > 0.0001) {
-                    psError(PS_ERR_UNKNOWN, false,
-                            "psFitsReadTableColumn returned unexpected values (%g vs %g) for col=%d",
-                            atof((char*)colData->data[row]), expectedValues[col][row], col);
-                    return 5;
-                }
-            }
-        }
-        psFree(colData);
-    }
-
-    psWarning("Following should be an error.");
-    psErrorClear();
-    psArray* data = psFitsReadTableColumn(NULL,"MYINT");
-    psErr* err = psErrorLast();
-    if (data != NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTableColumn did not return NULL with NULL psFits");
-        return 6;
-    }
-    if (err->code != PS_ERR_BAD_PARAMETER_NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTableColumn did not error with NULL psFits");
-        return 7;
-    }
-    psFree(err);
-
-    psWarning(__func__,"Following should be an error.");
-    psErrorClear();
-    data = psFitsReadTableColumn(fits,"BOGUS");
-    err = psErrorLast();
-    if (data != NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTableColumn did not return NULL with col=\"BOGUS\"");
-        return 8;
-    }
-    if (err->code != PS_ERR_IO) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsReadTableColumn did not error with col=\"BOGUS\"");
-        return 9;
-    }
-    psFree(err);
-
-    psFree(fits);
-
-    return 0;
-}
-
-static psS32 tst_psFitsUpdateTable( void )
-{
-    psErr* err;
-
-    if (! makeTable()) {
-        return 1;
-    }
-
-    psFits* fits = psFitsAlloc(tableFilename);
-
-    if (fits == NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsAlloc returned NULL on existing file.");
-        return 2;
-    }
-
-    psFitsMoveExtNum(fits,1,false);
-
-    // change the data in the file, going past by one (implicit new row of data)
-    for (int row = 0; row < tableNumRows+1; row++) {
-        psMetadata* md = psMetadataAlloc();
-        psMetadataAddF32(md,PS_LIST_TAIL,"MYFLT","",(float)row/-10.0);
-        psMetadataAddF64(md,PS_LIST_TAIL,"MYDBL","",(double)row/-100.0);
-        psMetadataAddS32(md,PS_LIST_TAIL,"MYINT","",-row);
-
-        if (! psFitsUpdateTable(fits,md,row)) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsUpdateTable returned false, but expected true for row=%d.",
-                    row);
-            return 3;
-        }
-        psFree(md);
-    }
-
-    for (int row = 0; row < tableNumRows+1; row++) {
-        psMetadata* md = psFitsReadTableRow(fits, row);
-        if (abs(psMetadataLookupF32(NULL,md,"MYFLT") - (float)row/-10.0) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsUpdateTable did not change the float value for row=%d.",
-                    row);
-            return 4;
-        }
-        if (abs(psMetadataLookupF64(NULL,md,"MYDBL") - (float)row/-100.0) > FLT_EPSILON) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsUpdateTable did not change the double value for row=%d.",
-                    row);
-            return 5;
-        }
-        if (psMetadataLookupS32(NULL,md,"MYINT") != -row) {
-            psError(PS_ERR_UNKNOWN, false,
-                    "psFitsUpdateTable did not change the integer value for row=%d.",
-                    row);
-            return 6;
-        }
-        psFree(md);
-    }
-
-    psMetadata* md = psMetadataAlloc();
-    psMetadataAddF32(md,PS_LIST_TAIL,"BOGUS","",-1.0f);
-    psWarning("Following should be a warning.");
-    psErrorClear();
-    if (! psFitsUpdateTable(fits,md,0)) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsUpdateTable did not return false with bogus column data");
-        return 10;
-    }
-    psFree(md);
-
-    md = psMetadataAlloc();
-    psMetadataAddF32(md,PS_LIST_TAIL,"MYFLT","",-1.0f);
-    psMetadataAddF64(md,PS_LIST_TAIL,"MYDBL","",-2.0);
-    psMetadataAddS32(md,PS_LIST_TAIL,"MYINT","",-3);
-
-    psWarning("Following should be an error.");
-    psErrorClear();
-    if (psFitsUpdateTable(NULL,md,0)) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsUpdateTable did not return false with NULL psFits");
-        return 20;
-    }
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsUpdateTable did not error with NULL psFits");
-        return 21;
-    }
-    psFree(err);
-
-    psWarning("Following should be an error.");
-    psErrorClear();
-    if (psFitsUpdateTable(fits,NULL,0)) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsUpdateTable did not return false with NULL psMetadata");
-        return 22;
-    }
-    err = psErrorLast();
-    if (err->code != PS_ERR_BAD_PARAMETER_NULL) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsUpdateTable did not error with NULL psMetadata");
-        return 23;
-    }
-    psFree(err);
-
-    psWarning("Following should be an error.");
-    psErrorClear();
-    if (psFitsUpdateTable(fits,md,-1)) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsUpdateTable did not return false with row=-1");
-        return 24;
-    }
-    err = psErrorLast();
-    if (err->code != PS_ERR_IO) {
-        psError(PS_ERR_UNKNOWN, false,
-                "psFitsUpdateTable did not error with row=-1");
-        return 25;
-    }
-
-    psFree(err);
-    psFree(md);
-    psFree(fits);
-
-    return 0;
-}
-
-psS32 testImageRead(void)
-{
-    psS32 N = 256;
-    psS32 M = 128;
-
-    /*
-        This function shall open the specified FITS file, read the specified data
-        and place the data into a psImage structure. This function shall generate
-        an error message and return NULL if any of the input parameters are out of
-        range, image file doesn't exist or image is zero or one dimensional.
-
-        Verify the returned psImage structure contains expected values, if the input
-        parameter filename specifies an available FITS file with known 2dimensional
-        data, input parameters col, row, ncol, nrow, z specify data range with the
-        FITS file. Cases should include 1x1, Nx1, 1xN, NxN and MxN sub images and
-        total FITS file image. (done in macro)
-
-        Verify the returned psImage structure is equal to the input parameter
-        'output', if specified. (done in macro)
-
-        */
-
-    /* generate FITS file to read */
-
-    #define testReadTypeSize(m, n, readM0, readN0, readM, readN, TYP, filename) \
-    { \
-        psImage* img = NULL; \
-        psImage* img2 = NULL; \
-        psImage* img3 = NULL; \
-        psImage* img4 = NULL; \
-        /*        psImagimge* img_ref = NULL; */ \
-        \
-        GENIMAGE(img,m,n,TYP,row+2*col); \
-        img2 = psImageCopy(img2,img,PS_TYPE_##TYP); \
-        GENIMAGE(img3,m,n,TYP,row+2*col); \
-        psImageClip(img3,32.0,32.0,120.0,120.0); \
-        img4 = psImageCopy(img4,img3,PS_TYPE_##TYP); \
-        remove(filename); \
-        psFits* fits = psFitsAlloc(filename); \
-        psRegion region = {0,0,0,0}; \
-        if (! psFitsWriteImage(fits, NULL, img, 2)) { \
-            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
-            return 1; \
-        } \
-        if (! psFitsUpdateImage(fits,img3, region, 1)) { \
-            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
-            return 2; \
-        } \
-        if (! psFitsWriteImage(fits,NULL, img3, 2)) { \
-            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
-            return 3; \
-        } \
-        if (! psFitsUpdateImage(fits,img,region, 1)) { \
-            psError(PS_ERR_UNKNOWN, true,"Failed to write test image %s",filename); \
-            return 4; \
-        } \
-        psFree(img); \
-        psFree(fits); \
-        img = NULL; \
-        psFree(img3); \
-        img3 = NULL; \
-        fits = psFitsAlloc(filename); \
-        psRegion reg = {readM0, readM, readN0, readN}; \
-        img = psFitsReadImage(img, fits, reg, 0); \
-        img3 = psFitsReadImage(img3, fits, reg, 1); \
-        if (img3 == NULL) { \
-            psError(PS_ERR_UNKNOWN, true,"Failed to read test image %s",filename); \
-            return 6; \
-        } \
-        for (psU32 row = readN0; row < readN; row++) { \
-            ps##TYP* imgRow = img->data.TYP[row-readN0]; \
-            ps##TYP* img2Row = img2->data.TYP[row]; \
-            ps##TYP* img3Row = img3->data.TYP[row-readN0]; \
-            ps##TYP* img4Row = img4->data.TYP[row]; \
-            for (psU32 col = readM0; col < readM; col++) { \
-                if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \
-                    psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
-                            col,row,(psF32)imgRow[col-readM0],(psF32)img2Row[col],filename); \
-                    return 7; \
-                } \
-                if (fabsf(img3Row[col-readM0]-img4Row[col]) > FLT_EPSILON) { \
-                    psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \
-                            col,row,(psF32)img3Row[col-readM0],(psF32)img4Row[col],filename); \
-                    return 8; \
-                } \
-            } \
-        } \
-        psFree(img); \
-        img = NULL; \
-        psFree(img3); \
-        img3 = NULL; \
-        psFitsMoveExtNum(fits,1, false); \
-        img3 = psFitsReadImage(img3, fits, reg, 0); \
-        img = psFitsReadImage(img, fits, reg, 1); \
-        if (img == NULL) { \
-            psError(PS_ERR_UNKNOWN, true,"Failed to read test image %s",filename); \
-            return 9; \
-        } \
-        for (psU32 row = readN0; row < readN; row++) { \
-            ps##TYP* imgRow = img->data.TYP[row-readN0]; \
-            ps##TYP* img2Row = img2->data.TYP[row]; \
-            ps##TYP* img3Row = img3->data.TYP[row-readN0]; \
-            ps##TYP* img4Row = img4->data.TYP[row]; \
-            for (psU32 col = readM0; col < readM; col++) { \
-                if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \
-                    psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
-                            col,row,(psF32)imgRow[col-readM0],(psF32)img2Row[col],filename); \
-                    return 10; \
-                } \
-                if (fabsf(img3Row[col-readM0]-img4Row[col]) > FLT_EPSILON) { \
-                    psError(PS_ERR_UNKNOWN, true,"Image changed in I/O operation at %d,%d,1 (%.2f vs %.2f) for %s", \
-                            col,row,(psF32)img3Row[col-readM0],(psF32)img4Row[col],filename); \
-                    return 11; \
-                } \
-            } \
-        } \
-        psFree(img); \
-        psFree(img2); \
-        psFree(img3); \
-        psFree(img4); \
-        psFree(fits); \
-    }
-
-    #define testReadType(TYP,filename) \
-    testReadTypeSize(1,1,0,0,0,0,TYP,"tmpImages/1x1_" filename); \
-    testReadTypeSize(M,1,M/4,0,M*3/4,0,TYP,"tmpImages/Mx1_" filename); \
-    testReadTypeSize(1,N,0,N/4,0,N*3/4,TYP,"tmpImages/1xN_" filename); \
-    testReadTypeSize(M,N,M/4,N/4,M*3/4,N*3/4,TYP,"tmpImages/MxN_" filename);
-
-    mkdir("tmpImages",0777);
-
-    testReadTypeSize(1,1,0,0,0,0,U8,"tmpImages/1x1_" "U8.fits");
-    testReadTypeSize(M,1,M/4,0,M*3/4,0,U8,"tmpImages/Mx1_" "U8.fits");
-    testReadTypeSize(1,N,0,N/4,0,N*3/4,U8,"tmpImages/1xN_" "U8.fits");
-    testReadTypeSize(M,N,M/4,N/4,M*3/4,N*3/4,U8,"tmpImages/MxN_" "U8.fits");
-
-
-    testReadType(U8,"U8.fits");
-    testReadType(S8,"S8.fits");   // Not a requirement
-    testReadType(S16,"S16.fits");
-    testReadType(U16,"U16.fits"); // Not a requirement
-    testReadType(S32,"S32.fits");
-    testReadType(U32,"U32.fits"); // Not a requirement
-    testReadType(F32,"F32.fits");
-    testReadType(F64,"F64.fits");
-
-    // Attempt to read from NULL fits object
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL psFits");
-    psRegion region = {
-                          0,0,0,0
-                      };
-    if(psFitsReadImage(NULL,NULL,region,0) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for NULL psFits");
-        return 100;
-    }
-
-    return 0;
-}
-
-psS32 testImageWrite(void)
-{
-    psImage* img = NULL;
-    psImage* img2 = NULL;
-    psS32 m = 64;
-    psS32 n = 96;
-
-    /*
-    This function shall write the specified section within a psImage structure
-    to a FITS file. If the specifiedfile exists, then data should overwrite the
-    section to write. If the specified file doesn't exist, it shall be created.
-    If an extenstion is specified, then a basic primary header data unit shall
-    be created.
-    */
-
-    /*
-    Verify a FITS file named filename is generated and contains expected
-    values, if the input parameter input contains known data values, input
-    parameters col, row, ncol, nrow specify a valid data region within psImage
-    structure.
-
-    Verify a FITS file named filename is generated and contains a primary
-    header data unit with extension with expected values, if the input
-    parameter input contains known data values, input parameters col, row,
-    ncol, nrow specify a valid data region within psImage structure and
-    extname and/or extnum specify an extenstion to write.
-
-    N.B. : these are done in testImageRead tests, see above.
-    */
-
-    /*
-    Verify a FITS file named filename is overwritten and contains
-    expected values, if the input parameter input contains known data values,
-    input parameters col, row, ncol, nrow specify a valid data region within
-    psImage structure.
-    */
-
-    GENIMAGE(img,m,n,F32,0);
-    GENIMAGE(img2,m,n,F32,row+2*col);
-    mkdir("tmpImages",0777);
-    remove
-        ("tmpImages/writeTest.fits");
-    psRegion region = {
-                          0,0,0,0
-                      };
-    psFits* fits = psFitsAlloc("tmpImages/writeTest.fits");
-
-    if (! psFitsWriteImage(fits, NULL, img,1)) {
-        psError(PS_ERR_UNKNOWN, true,"Couldn't write writeTest.fits.");
-        return 14;
-    }
-    if (! psFitsUpdateImage(fits, img2, region, 0)) {
-        psError(PS_ERR_UNKNOWN, true,"Couldn't update writeTest.fits.");
-        return 15;
-    }
-    psFree(img);
-    psFree(img2);
-
-    // Did it really overwrite the pixel values?  Let's read it in and see.
-    psFree(fits);
-    fits = psFitsAlloc("tmpImages/writeTest.fits");
-    img = psFitsReadImage(NULL, fits, region, 0);
-    if (img == NULL) {
-        psError(PS_ERR_UNKNOWN, true,"Could not read in writeTest.fits.");
-        return 16;
-    }
-    for (psU32 row=0;row<n;row++) {
-        psF32* imgRow = img->data.F32[row];
-        for (psU32 col=0;col<m;col++) {
-            if (fabsf(imgRow[col] - (row+2*col)) > FLT_EPSILON) {
-                psError(PS_ERR_UNKNOWN, true,"The image values were not overwritten at %d,%d (%.2f vs %.2f)",
-                        col,row,imgRow[col],(row+2*col));
-                return 17;
-            }
-        }
-    }
-
-    psFree(img);
-
-    /*
-    Verify false is returned and program execution is not stopped, if the input image
-    is null.
-    */
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message because input image is null.");
-    if ( psFitsWriteImage(fits,NULL,NULL, 1) ) {
-        psError(PS_ERR_UNKNOWN, true,"psImageWriteSection did not return false when input image is NULL.");
-        return 20;
-    }
-
-    psFree(fits);
-
-    return 0;
-}
-
-psS32 tst_psFitsWriteHeader(void)
-{
-    if (! makeMulti() ) {
-        return 1;
-    }
-
-    psMetadata* header   = psMetadataAlloc();
-    psFits*     fitsFile = psFitsAlloc(multiFilename);
-
-    // Test psFitsReadWrite generates files from psFitsWriteImage which calls psFitsWriteHeader
-    // so these additional tests check for error conditions
-    // Attempt call function with NULL metadata
-    if(psFitsWriteHeader(NULL,fitsFile)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of true for NULL metadata pointer");
-        return 2;
-    }
-
-    psFree(fitsFile);
-
-    // Attempt to call function with NULL fits
-    if(psFitsWriteHeader(header,NULL)) {
-        psError(PS_ERR_UNKNOWN,true,"Did not expect return of true for NULL fits file pointer");
-        return 3;
-    }
-    psFree(header);
-
-    return 0;
-}
-
Index: trunk/psLib/test/dataIO/tst_psLookupTable_01.c
===================================================================
--- trunk/psLib/test/dataIO/tst_psLookupTable_01.c	(revision 4457)
+++ 	(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.16 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-06-23 03:19:29 $
-*
-*  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/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/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/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,999,"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/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/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/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("verified/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/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/dataIO/verified/tst_psDB.stderr
===================================================================
--- trunk/psLib/test/dataIO/verified/tst_psDB.stderr	(revision 4457)
+++ 	(revision )
@@ -1,321 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbInit}                                               *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBInit
-    Following should generate error message for invalid host
-<DATE><TIME>|<HOST>|E|psDBInit (FILE:LINENO)
-    Failed to connect to database.  Error: Unknown MySQL server host 'xxx' (NUM)
-<DATE><TIME>|<HOST>|I|TPDBInit
-    Following should generate error message for NULL database objec
-<DATE><TIME>|<HOST>|E|psDBCleanup (FILE:LINENO)
-    Invalid psDB has been specified.
-
----> TESTPOINT PASSED (psDB{dbInit} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbChange}                                             *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBChange
-    Following should generate error message for invalid database
-<DATE><TIME>|<HOST>|E|psDBChange (FILE:LINENO)
-    Failed to change database.  Error: Access denied for user ''@'localhost' to database 'abc'
-<DATE><TIME>|<HOST>|I|TPDBChange
-    Following should generate error message for null database object
-<DATE><TIME>|<HOST>|E|psDBChange (FILE:LINENO)
-    Invalid psDB has been specified.
-
----> TESTPOINT PASSED (psDB{dbChange} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbCreateTable}                                        *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBCreateTable
-    Following should generate an error message for NULL parameter
-<DATE><TIME>|<HOST>|E|psDBGenerateCreateTableSQL (FILE:LINENO)
-    Create table parameters may not be NULL.
-<DATE><TIME>|<HOST>|E|psDBCreateTable (FILE:LINENO)
-    Query generation failed.
-<DATE><TIME>|<HOST>|I|TPDBCreateTable
-    Following should generate an error message for NULL parameter
-<DATE><TIME>|<HOST>|E|psDBCreateTable (FILE:LINENO)
-    Invalid psDB has been specified.
-
----> TESTPOINT PASSED (psDB{dbCreateTable} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbDropTable}                                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBDropTable
-    psDBDropTable: insert should fail here...
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Failed to prepare query.  Error: Table 'test.table2' doesn't exist
-<DATE><TIME>|<HOST>|E|psDBInsertOneRow (FILE:LINENO)
-    Failed to insert row.
-<DATE><TIME>|<HOST>|I|TPDBDropTable
-    Following should generate an error message for NULL database object
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|E|psDBDropTable (FILE:LINENO)
-    Failed to drop table.
-<DATE><TIME>|<HOST>|I|TPDBDropTable
-    Following should generate an error message for invalid table
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: Unknown table 'table99'
-<DATE><TIME>|<HOST>|E|psDBDropTable (FILE:LINENO)
-    Failed to drop table.
-<DATE><TIME>|<HOST>|I|TPDBDropTable
-    Following should generate an error message for NULL table
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(null)' at line 1
-<DATE><TIME>|<HOST>|E|psDBDropTable (FILE:LINENO)
-    Failed to drop table.
-
----> TESTPOINT PASSED (psDB{dbDropTable} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbSelectColumn}                                       *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBSelectColumn
-    Following should generate error message for NULL database
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|E|psDBSelectColumn (FILE:LINENO)
-    Failed to select column.
-<DATE><TIME>|<HOST>|I|TPDBSelectColumn
-    Following should generate error message for NULL table
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) LIMIT 10' at line 1
-<DATE><TIME>|<HOST>|E|psDBSelectColumn (FILE:LINENO)
-    Failed to select column.
-<DATE><TIME>|<HOST>|I|TPDBSelectColumn
-    Following should generate error message for invalid table
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: Table 'test.table99' doesn't exist
-<DATE><TIME>|<HOST>|E|psDBSelectColumn (FILE:LINENO)
-    Failed to select column.
-<DATE><TIME>|<HOST>|I|TPDBSelectColumn
-    Following should generate error message for invalid column
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: Unknown column 'key_null' in 'field list'
-<DATE><TIME>|<HOST>|E|psDBSelectColumn (FILE:LINENO)
-    Failed to select column.
-
----> TESTPOINT PASSED (psDB{dbSelectColumn} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbSelectColumnNum}                                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBSelectColumnNum
-    Following should generate an error for NULL database object
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|E|psDBSelectColumn (FILE:LINENO)
-    Failed to select column.
-<DATE><TIME>|<HOST>|I|TPDBSelectColumnNum
-    Following should generate an error for NULL table
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) LIMIT 10' at line 1
-<DATE><TIME>|<HOST>|E|psDBSelectColumn (FILE:LINENO)
-    Failed to select column.
-<DATE><TIME>|<HOST>|I|TPDBSelectColumnNum
-    Following should generate an error for invalid column
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: Unknown column 'key_999' in 'field list'
-<DATE><TIME>|<HOST>|E|psDBSelectColumn (FILE:LINENO)
-    Failed to select column.
-<DATE><TIME>|<HOST>|I|TPDBSelectColumnNum
-    Following should generate an error for invalid type
-<DATE><TIME>|<HOST>|E|psVectorAlloc (FILE:LINENO)
-    Input psVector is an unsupported type (0x0).
-
----> TESTPOINT PASSED (psDB{dbSelectColumnNum} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbSelectRows}                                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: Unknown table 'table5'
-<DATE><TIME>|<HOST>|E|psDBDropTable (FILE:LINENO)
-    Failed to drop table.
-<DATE><TIME>|<HOST>|I|TPDBSelectRows
-    Following should generate an error message for NULL database object
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|E|psDBSelectRows (FILE:LINENO)
-    Query execution failed.
-<DATE><TIME>|<HOST>|I|TPDBSelectRows
-    Following should generate an error message for invalid table
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null)' at line 1
-<DATE><TIME>|<HOST>|E|psDBSelectRows (FILE:LINENO)
-    Query execution failed.
-
----> TESTPOINT PASSED (psDB{dbSelectRows} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbInsertOneRow}                                       *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBInsertOneRow
-    Following should generate error message for NULL database
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|E|psDBInsertOneRow (FILE:LINENO)
-    Failed to insert row.
-<DATE><TIME>|<HOST>|I|TPDBInsertOneRow
-    Following should generate error message for invalid column item
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Failed to prepare query.  Error: Unknown column 'key_999' in 'field list'
-<DATE><TIME>|<HOST>|E|psDBInsertOneRow (FILE:LINENO)
-    Failed to insert row.
-<DATE><TIME>|<HOST>|I|TPDBInsertOneRow
-    Following should generate error message for invalid table
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Failed to prepare query.  Error: Table 'test.table999' doesn't exist
-<DATE><TIME>|<HOST>|E|psDBInsertOneRow (FILE:LINENO)
-    Failed to insert row.
-<DATE><TIME>|<HOST>|I|TPDBInsertOneRow
-    Following should generate error message for NULL row
-<DATE><TIME>|<HOST>|E|psDBInsertOneRow (FILE:LINENO)
-    Failed to insert row.
-
----> TESTPOINT PASSED (psDB{dbInsertOneRow} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbInsertRows}                                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBInsertRows
-    Following should generate an error message for NULL database
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|I|TPDBInsertRows
-    Following should generate an error message for NULL table
-<DATE><TIME>|<HOST>|E|psDBGenerateInsertRowSQL (FILE:LINENO)
-    Query generation failed.
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Query generation failed.
-<DATE><TIME>|<HOST>|I|TPDBInsertRows
-    Following should generate an error message for invalid table
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Failed to prepare query.  Error: Table 'test.table999' doesn't exist
-<DATE><TIME>|<HOST>|I|TPDBInsertRows
-    Following should generate an error message for NULL row array
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Failed to insert row.
-<DATE><TIME>|<HOST>|I|TPDBInsertRows
-    Following should generate error message for invalid column item
-<DATE><TIME>|<HOST>|E|psDBInsertRows (FILE:LINENO)
-    Failed to prepare query.  Error: Unknown column 'key_999' in 'field list'
-
----> TESTPOINT PASSED (psDB{dbInsertRows} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbDumpRows}                                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBDumpRows
-    Following should generate error message for NULL database
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|E|psDBSelectRows (FILE:LINENO)
-    Query execution failed.
-<DATE><TIME>|<HOST>|I|TPDBDumpRows
-    Following should generate error message for NULL table
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null)' at line 1
-<DATE><TIME>|<HOST>|E|psDBSelectRows (FILE:LINENO)
-    Query execution failed.
-
----> TESTPOINT PASSED (psDB{dbDumpRows} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbDumpCols}                                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBDumpCols
-    Following should generate an error message for NULL database
-<DATE><TIME>|<HOST>|E|psDBDumpCols (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|I|TPDBDumpCols
-    Following should generate an error message for NULL table
-<DATE><TIME>|<HOST>|E|psDBDumpCols (FILE:LINENO)
-    NULL table specified.
-
----> TESTPOINT PASSED (psDB{dbDumpCols} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbUpdateRows}                                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBUpdateRows
-    Following should generate an error message for NULL database
-<DATE><TIME>|<HOST>|E|psDBUpdateRows (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|I|TPDBUpdateRows
-    Following should generate an error message for invalid table
-<DATE><TIME>|<HOST>|E|psDBUpdateRows (FILE:LINENO)
-    Failed to prepare query.  Error: Table 'test.table999' doesn't exist
-<DATE><TIME>|<HOST>|I|TPDBUpdateRows
-    Following should generate an error message for NULL updates
-<DATE><TIME>|<HOST>|E|psDBGenerateUpdateRowSQL (FILE:LINENO)
-    Update row SQL generate fail: values and where params may not be NULL.
-<DATE><TIME>|<HOST>|E|psDBUpdateRows (FILE:LINENO)
-    Query generation failed.
-<DATE><TIME>|<HOST>|I|TPDBUpdateRows
-    Following should generate an error message for invalid where
-<DATE><TIME>|<HOST>|E|psDBUpdateRows (FILE:LINENO)
-    Failed to prepare query.  Error: Unknown column 'col999' in 'where clause'
-
----> TESTPOINT PASSED (psDB{dbUpdateRows} | tst_psDB.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psDB.c                                                 *
-*            TestPoint: psDB{dbDeleteRows}                                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|TPDBDeleteRows
-    Following should generate error message for NULL database
-<DATE><TIME>|<HOST>|E|psDBDeleteRows (FILE:LINENO)
-    Invalid psDB has been specified.
-<DATE><TIME>|<HOST>|I|TPDBDeleteRows
-    Following should generate error message for invalid table
-<DATE><TIME>|<HOST>|E|p_psDBRunQuery (FILE:LINENO)
-    Failed to execute SQL query.  Error: Table 'test.table999' doesn't exist
-<DATE><TIME>|<HOST>|E|psDBDeleteRows (FILE:LINENO)
-    Delete failed.
-
----> TESTPOINT PASSED (psDB{dbDeleteRows} | tst_psDB.c)
-
Index: trunk/psLib/test/dataIO/verified/tst_psFits.stderr
===================================================================
--- trunk/psLib/test/dataIO/verified/tst_psFits.stderr	(revision 4457)
+++ 	(revision )
@@ -1,216 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsAlloc}                                       *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|tst_psFitsAlloc
-    Following should generate an error message
-<DATE><TIME>|<HOST>|E|psFitsAlloc (FILE:LINENO)
-    Specified filename can not be NULL.
-
----> TESTPOINT PASSED (psImage{psFitsAlloc} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsMoveExtName}                                 *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtName
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsMoveExtName (FILE:LINENO)
-    Could not find HDU 'bogus' in file multi.fits.
-    CFITSIO Error: illegal HDU number
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtName
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsMoveExtName (FILE:LINENO)
-    The input psFits object can not NULL.
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtName
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsMoveExtName (FILE:LINENO)
-    Specified extension name can not be NULL.
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtName
-    Following should generate an error for NULL fits file
-<DATE><TIME>|<HOST>|E|psFitsGetExtName (FILE:LINENO)
-    The input psFits object can not NULL.
-
----> TESTPOINT PASSED (psImage{psFitsMoveExtName} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsMoveExtNum}                                  *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsGetSize (FILE:LINENO)
-    The input psFits object can not NULL.
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    Could not move to specified HDU #-1 in file multi.fits.
-    CFITSIO Error: illegal HDU number
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    Could not move -1 HDUs from current position in file multi.fits.
-    CFITSIO Error: illegal HDU number
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    Could not move to specified HDU #8 in file multi.fits.
-    CFITSIO Error: tried to move past end of file
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    Could not move 1 HDUs from current position in file multi.fits.
-    CFITSIO Error: tried to move past end of file
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsMoveExtNum (FILE:LINENO)
-    The input psFits object can not NULL.
-<DATE><TIME>|<HOST>|I|tst_psFitsMoveExtNum
-    Following should generate an error for NULL fits file
-<DATE><TIME>|<HOST>|E|psFitsGetExtNum (FILE:LINENO)
-    The input psFits object can not NULL.
-
----> TESTPOINT PASSED (psImage{psFitsMoveExtNum} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsReadHeader}                                  *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|tst_psFitsReadHeader
-    following should be an error (input psFits = NULL)
-<DATE><TIME>|<HOST>|E|psFitsReadHeader (FILE:LINENO)
-    The input psFits object can not NULL.
-
----> TESTPOINT PASSED (psImage{psFitsReadHeader} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsReadHeaderSet}                               *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|E|psFitsReadHeaderSet (FILE:LINENO)
-    The input psFits object can not NULL.
-
----> TESTPOINT PASSED (psImage{psFitsReadHeaderSet} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsReadTable}                                   *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|E|psFitsReadTable (FILE:LINENO)
-    The input psFits object can not NULL.
-
----> TESTPOINT PASSED (psImage{psFitsReadTable} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsReadTableColumnNum}                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|W|tst_psFitsReadTableColumnNum (FILE:LINENO)
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsReadTableColumnNum (FILE:LINENO)
-    The input psFits object can not NULL.
-<DATE><TIME>|<HOST>|W|tst_psFitsReadTableColumnNum (FILE:LINENO)
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsReadTableColumnNum (FILE:LINENO)
-    Specified column, BOGUS, was not found.
-    CFITSIO Error: named column not found
-
----> TESTPOINT PASSED (psImage{psFitsReadTableColumnNum} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsReadTableColumn}                             *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|W|tst_psFitsReadTableColumn (FILE:LINENO)
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsReadTableColumn (FILE:LINENO)
-    The input psFits object can not NULL.
-<DATE><TIME>|<HOST>|W|tst_psFitsReadTableColumn (FILE:LINENO)
-    tst_psFitsReadTableColumn
-<DATE><TIME>|<HOST>|E|psFitsReadTableColumn (FILE:LINENO)
-    Specified column, BOGUS, was not found.
-    CFITSIO Error: named column not found
-
----> TESTPOINT PASSED (psImage{psFitsReadTableColumn} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsUpdateTable}                                 *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|W|tst_psFitsUpdateTable (FILE:LINENO)
-    Following should be a warning.
-<DATE><TIME>|<HOST>|W|psFitsUpdateTable (FILE:LINENO)
-    No column with the name 'BOGUS' exists in the table.
-<DATE><TIME>|<HOST>|W|tst_psFitsUpdateTable (FILE:LINENO)
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsUpdateTable (FILE:LINENO)
-    The input psFits object can not NULL.
-<DATE><TIME>|<HOST>|W|tst_psFitsUpdateTable (FILE:LINENO)
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsUpdateTable (FILE:LINENO)
-    The input psImage was NULL.  Need a non-NULL psImage for operation to be performed.
-<DATE><TIME>|<HOST>|W|tst_psFitsUpdateTable (FILE:LINENO)
-    Following should be an error.
-<DATE><TIME>|<HOST>|E|psFitsUpdateTable (FILE:LINENO)
-    Could not write data to file,'table.fits'.
-    CFITSIO Error: bad first row number
-
----> TESTPOINT PASSED (psImage{psFitsUpdateTable} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsReadImage}                                   *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testImageRead
-    Following should generate error message for NULL psFits
-<DATE><TIME>|<HOST>|E|psFitsReadImage (FILE:LINENO)
-    The input psFits object can not NULL.
-
----> TESTPOINT PASSED (psImage{psFitsReadImage} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsWriteImage}                                  *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testImageWrite
-    Following should generate an error message because input image is null.
-<DATE><TIME>|<HOST>|E|psFitsWriteImage (FILE:LINENO)
-    The input psImage was NULL.  Need a non-NULL psImage for operation to be performed.
-
----> TESTPOINT PASSED (psImage{psFitsWriteImage} | tst_psFits.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psFits.c                                               *
-*            TestPoint: psImage{psFitsWriteHeader}                                 *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|E|psFitsWriteHeader (FILE:LINENO)
-    The input psMetadata was NULL.  Need a non-NULL psMetadata for operation to be performed.
-<DATE><TIME>|<HOST>|E|psFitsWriteHeader (FILE:LINENO)
-    The input psFits object can not NULL.
-
----> TESTPOINT PASSED (psImage{psFitsWriteHeader} | tst_psFits.c)
-
Index: trunk/psLib/test/dataIO/verified/tst_psLookupTable_01.stderr
===================================================================
--- trunk/psLib/test/dataIO/verified/tst_psLookupTable_01.stderr	(revision 4457)
+++ 	(revision )
@@ -1,116 +1,0 @@
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psLookupTable_01.c                                     *
-*            TestPoint: psLookupTable{psLookupTableAlloc}                          *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testLookupTableAlloc
-    Following should generate error message for invalid file name
-<DATE><TIME>|<HOST>|E|psLookupTableAlloc (FILE:LINENO)
-    Unallowable operation: fileName is NULL.
-<DATE><TIME>|<HOST>|I|testLookupTableAlloc
-    Following should generate error message for invalid format string
-<DATE><TIME>|<HOST>|E|psLookupTableAlloc (FILE:LINENO)
-    Unallowable operation: format is NULL.
-
----> TESTPOINT PASSED (psLookupTable{psLookupTableAlloc} | tst_psLookupTable_01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psLookupTable_01.c                                     *
-*            TestPoint: psLookupTable{psVectorsReadFromFile}                       *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testVectorsReadFromFile
-    Following should generate error message for NULL format
-<DATE><TIME>|<HOST>|E|psVectorsReadFromFile (FILE:LINENO)
-    Unallowable operation: format is NULL.
-<DATE><TIME>|<HOST>|I|testVectorsReadFromFile
-    Following should generate error message for NULL filename
-<DATE><TIME>|<HOST>|E|psVectorsReadFromFile (FILE:LINENO)
-    Unallowable operation: filename is NULL.
-<DATE><TIME>|<HOST>|I|testVectorsReadFromFile
-    Following should generate error message for invalid format specifier
-<DATE><TIME>|<HOST>|E|psVectorsReadFromFile (FILE:LINENO)
-    Invalid format specifier
-<DATE><TIME>|<HOST>|E|psVectorsReadFromFile (FILE:LINENO)
-    Format string was not parsed sucessfully
-<DATE><TIME>|<HOST>|I|testVectorsReadFromFile
-    Following should generate error message for non-existant file
-<DATE><TIME>|<HOST>|E|psVectorsReadFromFile (FILE:LINENO)
-    Failed to open file verified/nonexistant.dat.
-<DATE><TIME>|<HOST>|I|testVectorsReadFromFile
-    Following should generate error message for error is file
-<DATE><TIME>|<HOST>|E|psVectorsReadFromFile (FILE:LINENO)
-    Parsing text file failed.
-
----> TESTPOINT PASSED (psLookupTable{psVectorsReadFromFile} | tst_psLookupTable_01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psLookupTable_01.c                                     *
-*            TestPoint: psLookupTable{psLookupTableImport}                         *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testLookupTableImport
-    Following should generate error message for NULL table argument
-<DATE><TIME>|<HOST>|E|psLookupTableImport (FILE:LINENO)
-    Unallowable operation: table is NULL.
-<DATE><TIME>|<HOST>|I|testLookupTableImport
-    Following should generate error message for NULL vectors
-<DATE><TIME>|<HOST>|E|psLookupTableImport (FILE:LINENO)
-    Unallowable operation: vectors is NULL.
-<DATE><TIME>|<HOST>|I|testLookupTableImport
-    Following should generate error message for invalid index column
-<DATE><TIME>|<HOST>|E|psLookupTableImport (FILE:LINENO)
-    Index column cannot be less than zero
-
----> TESTPOINT PASSED (psLookupTable{psLookupTableImport} | tst_psLookupTable_01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psLookupTable_01.c                                     *
-*            TestPoint: psLookupTable{psLookupTableRead}                           *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testLookupTableRead
-    Following should generate an error message for NULL table
-<DATE><TIME>|<HOST>|E|psLookupTableRead (FILE:LINENO)
-    Unallowable operation: table is NULL.
-<DATE><TIME>|<HOST>|I|testLookupTableRead
-    Following should generate error message invalid table indexCol
-<DATE><TIME>|<HOST>|E|psLookupTableImport (FILE:LINENO)
-    Index column cannot be less than zero
-
----> TESTPOINT PASSED (psLookupTable{psLookupTableRead} | tst_psLookupTable_01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psLookupTable_01.c                                     *
-*            TestPoint: psLookupTable{psLookupTableInterpolate}                    *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testLookupTableInterpolate
-    Following should generate error message for invalid table
-<DATE><TIME>|<HOST>|E|psLookupTableInterpolate (FILE:LINENO)
-    Unallowable operation: table is NULL.
-<DATE><TIME>|<HOST>|I|testLookupTableInterpolate
-    Following should generate error out of range.
-<DATE><TIME>|<HOST>|E|psLookupTableInterpolate (FILE:LINENO)
-    Error: column, 100, is out of range.  Must be between 0 and 9.
-
----> TESTPOINT PASSED (psLookupTable{psLookupTableInterpolate} | tst_psLookupTable_01.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psLookupTable_01.c                                     *
-*            TestPoint: psLookupTable{psLookupTableInterpolateAll}                 *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-<DATE><TIME>|<HOST>|I|testLookupTableInterpolateAll
-    Following should generate an error message for NULL table
-<DATE><TIME>|<HOST>|E|psLookupTableInterpolateAll (FILE:LINENO)
-    Unallowable operation: table is NULL.
-
----> TESTPOINT PASSED (psLookupTable{psLookupTableInterpolateAll} | tst_psLookupTable_01.c)
-
