Index: /trunk/psLib/test/dataIO/tst_psLookupTable_01.c
===================================================================
--- /trunk/psLib/test/dataIO/tst_psLookupTable_01.c	(revision 4053)
+++ /trunk/psLib/test/dataIO/tst_psLookupTable_01.c	(revision 4054)
@@ -12,6 +12,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-04-07 20:27:42 $
+*  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-05-31 21:52:49 $
 *
 *  Copyright 2004-5 Maui High Performance Computing Center, University of Hawaii
@@ -24,4 +24,6 @@
 
 static psS32 testLookupTableAlloc(void);
+static psS32 testVectorsReadFromFile(void);
+static psS32 testLookupTableImport(void);
 static psS32 testLookupTableRead(void);
 static psS32 testLookupTableInterpolate(void);
@@ -32,4 +34,7 @@
 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[] =
     {
@@ -71,46 +76,84 @@
     {
         -1.5,-1.0,-0.25,1.75
-    };
-
-const psF64 tableS32_validFrom = -1;
-const psF64 tableS32_validTo = 33;
-const psS32 tableS32_size = 4;
-const psS32 tableS32_index[] =
-    {
-        -1,11,22,33
     };
 
 const psF64 tableF32_validFrom = -10.05;
 const psF64 tableF32_validTo = 3500.67;
-const psF64 tableF32_size = 4;
+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 psU8  table10_index[]   =
+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 psU16 table10_val1[]    =
+const psS32 table10_val1[]    =
     {
         4,   6,    8,  10,   12,   14,   16,   18,   20,   22
     };
-const psU32 table10_val2[]    =
+const psS32 table10_val2[]    =
     {
         8,  12,   16,  20,   24,   28,   32,   36,   40,   44
     };
-const psU64 table10_val3[]    =
+const psS64 table10_val3[]    =
     {
         16,  24,   32,  64,  128,  256,  512, 1024, 2048, 4096
     };
-const psS8  table10_val4[]    =
+const psS32  table10_val4[]    =
     {
         -1,  -2,   -3,  -4,   -5,   -6,   -7,   -8,   -9,  -10
     };
-const psS16 table10_val5[]    =
+const psS32 table10_val5[]    =
     {
         -4,  -6,   -8, -10,  -12,  -14,  -16,  -18,  -20,  -22
@@ -134,9 +177,9 @@
 const psF64 interpolVal1[]    =
     {
-        12.5, 25, 160, -5.25, -12.5, -25, -160, 0.9375, 11.4825
+        5.25, 12.5, 25, 160, -5.25, -12.5, -25, -160, 0.9375, 11.4825
     };
 const psF64 interpolVal2[]    =
     {
-        12, 24, 128, -5, -12, -24, -128, 0.75, 10.65
+        5, 12, 24, 128, -5, -12, -24, -128, 0.75, 10.65
     };
 const psF64 interpolVal3[]    =
@@ -146,5 +189,7 @@
 
 testDescription tests[] = {
-                              {testLookupTableAlloc,999,"psLookupTableAlloc",0,false},
+                              {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},
@@ -168,17 +213,19 @@
 
     // Allocate lookup table with valid parameters
-    table1 = psLookupTableAlloc("tableF32.dat", tableF32_validFrom, tableF32_validTo);
+    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) {
+    if(strcmp(table1->filename,"tableF32.dat") != 0) {
         psError(PS_ERR_UNKNOWN,true,"File name not properly stored in psLookupTable structure.");
         return 2;
     }
-
-    if( (fabs(table1->validFrom - tableF32_validFrom) > FLT_EPSILON)  ||
-            (fabs(table1->validTo-tableF32_validTo) > FLT_EPSILON) ) {
-        psError(PS_ERR_UNKNOWN,true,"Members validTo or validFrom not set properly");
+    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;
     }
@@ -187,5 +234,5 @@
     // Allocate lookup table with invalid filename
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for invalid file name");
-    table1 = psLookupTableAlloc(NULL,0,3);
+    table1 = psLookupTableAlloc(NULL,"\%d",3);
     if(table1 != NULL) {
         psError(PS_ERR_UNKNOWN,true,"Null file name accepted by psLookupTableAlloc");
@@ -193,264 +240,508 @@
     }
 
+    // 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;
-
-    // Allocate table using table with psU8 index and valid types and index-values
-    table1 = psLookupTableAlloc("tableU8.dat", 0, 100.5);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to allocate table with tableU8.dat");
+    psLookupTable*  table1  = NULL;
+    psS32           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;
     }
-    // Read table with index U8
-    table1 = psLookupTableRead(table1);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to read table from file tableU8.dat");
+
+    // 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;
     }
-    // Verify the validFrom and validTo are updated properly
-    if( (fabs(table1->validFrom - tableU8_validFrom) > FLT_EPSILON) ||
-            (fabs(table1->validTo - tableU8_validTo) > FLT_EPSILON) ) {
-        psError(PS_ERR_UNKNOWN,true,"ValidFrom or validTo not set properly");
+    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;
     }
-    // Verify index and all values in table read properly
-    for(psS32 i=0; i < tableU8_size; i++) {
-        if(table1->index->data.U8[i] != tableU8_index[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Index values do not match: index[%d]=%d  expected %d",i,
-                    table1->index->data.U8[i], tableU8_index[i]);
-            return 3*i;
-        }
-        if(((psVector*)table1->values->data[0])->data.U16[i] != tableU8_val1[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 1 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[0])->data.U16[i], tableU8_val1[i]);
-            return 3*i+1;
-        }
-        if(((psVector*)table1->values->data[1])->data.U32[i] != tableU8_val2[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 2 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[1])->data.U32[i], tableU8_val2[i]);
-            return 3*i+2;
-        }
-        if(((psVector*)table1->values->data[2])->data.U64[i] != tableU8_val3[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 3 do not match: value[%d]=%lld expected %lld",i,
-                    ((psVector*)table1->values->data[2])->data.U64[i], tableU8_val3[i]);
-            return 3*i+3;
-        }
-        if(((psVector*)table1->values->data[3])->data.S8[i] != tableU8_val4[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 4 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[3])->data.S8[i], tableU8_val4[i]);
-            return 3*i+4;
-        }
-        if(((psVector*)table1->values->data[4])->data.S16[i] != tableU8_val5[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 5 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[4])->data.S16[i], tableU8_val5[i]);
-            return 3*i+5;
-        }
-        if(((psVector*)table1->values->data[5])->data.S32[i] != tableU8_val6[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 6 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[5])->data.S32[i], tableU8_val6[i]);
-            return 3*i+6;
-        }
-        if(((psVector*)table1->values->data[6])->data.S64[i] != tableU8_val7[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 7 do not match: value[%d]=%lld expected %lld",i,
-                    ((psVector*)table1->values->data[6])->data.S64[i], tableU8_val7[i]);
-            return 3*i+7;
-        }
-        if(fabs(((psVector*)table1->values->data[7])->data.F32[i] - tableU8_val8[i]) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 8 do not match: value[%d]=%g expected %g",i,
-                    ((psVector*)table1->values->data[7])->data.F32[i], tableU8_val8[i]);
-            return 3*i+8;
-        }
-        if(fabs(((psVector*)table1->values->data[8])->data.F64[i] - tableU8_val9[i]) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 9 do not match: value[%d]=%g expected %g",i,
-                    ((psVector*)table1->values->data[8])->data.F32[i], tableU8_val9[i]);
-            return 3*i+9;
+    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);
 
-    // Allocate table using table with psS32 index and valid types and index-values
-    table1 = psLookupTableAlloc("tableS32.dat", -110, 1000.5);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to allocate table with tableS32.dat");
-        return 1;
-    }
-    table1 = psLookupTableRead(table1);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to read table from file tableS32.dat");
-        return 2;
-    }
-    if( (fabs(table1->validFrom - tableS32_validFrom) > FLT_EPSILON) ||
-            (fabs(table1->validTo - tableS32_validTo) > FLT_EPSILON) ) {
-        psError(PS_ERR_UNKNOWN,true,"ValidFrom or validTo not set properly");
-        return 3;
-    }
-    for(psS32 i=0; i < tableS32_size; i++) {
-        if(table1->index->data.S32[i] != tableS32_index[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Index values do not match: index[%d]=%d  expected %d",i,
-                    table1->index->data.S32[i], tableS32_index[i]);
-            return 4*i;
-        }
+    // 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);
-
-    // Allocate table using table with psF32 index and valid types and index-values
-    table1 = psLookupTableAlloc("tableF32.dat", -1100, 5500.5);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to allocate table with tableF32.dat");
-        return 1;
-    }
-    table1 = psLookupTableRead(table1);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to read table from file tableF32.dat");
-        return 2;
-    }
-    if( (fabs(table1->validFrom - tableF32_validFrom) > errorTol_psF64) ||
-            (fabs(table1->validTo - tableF32_validTo) > errorTol_psF64) ) {
-        psError(PS_ERR_UNKNOWN,true,"ValidFrom or validTo not set properly");
-        return 3;
-    }
-    for(psS32 i=0; i < tableS32_size; i++) {
-        if(fabsf(table1->index->data.F32[i] - tableF32_index[i]) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true,"Index values do not match: index[%d]=%d  expected %d",i,
-                    table1->index->data.F32[i], tableF32_index[i]);
-            return 4*i;
-        }
-    }
-    psFree(table1);
-
-    // Allocate table using psU8 index but with unsorted rows and verify the list is
-    // sorted properly after being read
-    table1 = psLookupTableAlloc("table10.dat",1,2);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to allocate table with table10.dat");
-        return 1;
-    }
-    table1 = psLookupTableRead(table1);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to read table with table10.dat");
-        return 2;
-    }
-    // Verify the validFrom and validTo are updated properly
-    if( (fabs(table1->validFrom - table10_validFrom) > FLT_EPSILON) ||
-            (fabs(table1->validTo - table10_validTo) > FLT_EPSILON) ) {
-        psError(PS_ERR_UNKNOWN,true,"ValidFrom or validTo not set properly");
-        return 3;
-    }
-    // Verify index and all values in table read properly
-    for(psS32 i=0; i < table10_size; i++) {
-        if(table1->index->data.U8[i] != table10_index[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Index values do not match: index[%d]=%d  expected %d",i,
-                    table1->index->data.U8[i], table10_index[i]);
-            return 3*i;
-        }
-        if(((psVector*)table1->values->data[0])->data.U16[i] != table10_val1[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 1 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[0])->data.U16[i], table10_val1[i]);
-            return 3*i+1;
-        }
-        if(((psVector*)table1->values->data[1])->data.U32[i] != table10_val2[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 2 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[1])->data.U32[i], table10_val2[i]);
-            return 3*i+2;
-        }
-        if(((psVector*)table1->values->data[2])->data.U64[i] != table10_val3[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 3 do not match: value[%d]=%lld expected %lld",i,
-                    ((psVector*)table1->values->data[2])->data.U64[i], table10_val3[i]);
-            return 3*i+3;
-        }
-        if(((psVector*)table1->values->data[3])->data.S8[i] != table10_val4[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 4 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[3])->data.S8[i], table10_val4[i]);
-            return 3*i+4;
-        }
-        if(((psVector*)table1->values->data[4])->data.S16[i] != table10_val5[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 5 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[4])->data.S16[i], table10_val5[i]);
-            return 3*i+5;
-        }
-        if(((psVector*)table1->values->data[5])->data.S32[i] != table10_val6[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 6 do not match: value[%d]=%d expected %d",i,
-                    ((psVector*)table1->values->data[5])->data.S32[i], table10_val6[i]);
-            return 3*i+6;
-        }
-        if(((psVector*)table1->values->data[6])->data.S64[i] != table10_val7[i]) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 7 do not match: value[%d]=%lld expected %lld",i,
-                    ((psVector*)table1->values->data[6])->data.S64[i], table10_val7[i]);
-            return 3*i+7;
-        }
-        if(fabs(((psVector*)table1->values->data[7])->data.F32[i] - table10_val8[i]) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 8 do not match: value[%d]=%g expected %g",i,
-                    ((psVector*)table1->values->data[7])->data.F32[i], table10_val8[i]);
-            return 3*i+8;
-        }
-        if(fabs(((psVector*)table1->values->data[8])->data.F64[i] - table10_val9[i]) > FLT_EPSILON ) {
-            psError(PS_ERR_UNKNOWN,true,"Value in column 9 do not match: value[%d]=%g expected %g",i,
-                    ((psVector*)table1->values->data[8])->data.F32[i], table10_val9[i]);
-            return 3*i+9;
-        }
-    }
-    psFree(table1);
-
-    // Allocate table using table with invalid type in type row but valid index-values
-    table1 = psLookupTableAlloc("table2.dat",0,99.99);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to allocate table with table2.dat");
-        return 3;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message about invalid type");
-    table1 = psLookupTableRead(table1);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to read table from file table2.dat");
-        return 4;
-    }
-    psFree(table1);
-
-    // Allocate table using table with invalid value
-    table1 = psLookupTableAlloc("table3.dat",0,75.0);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to allocate table with table3.dat");
-        return 5;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message about invalid value");
-    table1 = psLookupTableRead(table1);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to read table from file table3.dat");
-        return 6;
-    }
-    psFree(table1);
-
-    // Attempt to read for non-existant file
-    table1 = psLookupTableAlloc("nonexistantFile.dat",0,100);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unable to allocate table with non-existant file");
-        return 3;
-    }
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error msg about opening file");
-    table1 = psLookupTableRead(table1);
-    if(table1 == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Returned NULL when table should have been returned");
-        return 4;
-    }
-
-    // Attempt to read table with NULL specified file
-    psFree((char*)table1->fileName);
-    table1->fileName = NULL;
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error msg about NULL file name");
-    if(psLookupTableRead(table1) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with table specifying NULL file name");
-        return 5;
-    }
-    psFree(table1);
-
-    // Attempt to read table with NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error msg about NULL table");
-    if(psLookupTableRead(NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with NULL table.");
-        return 6;
-    }
 
     return 0;
@@ -459,13 +750,24 @@
 psS32 testLookupTableInterpolate(void)
 {
-    psLookupStatusType status = 0;
     psLookupTable*  table1 = NULL;
-    psF64            out1 = 0;
+    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.dat",0,20);
-    table1 = psLookupTableRead(table1);
-    for(psS32 i = 0; i < table1->numRows-1; i++ ) {
-        out1 = psLookupTableInterpolate(table1, 5.25, i, &status);
+    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]);
@@ -473,6 +775,6 @@
         }
     }
-    for(psS32 i = 0; i < table1->numRows-1; i++ ) {
-        out1 = psLookupTableInterpolate(table1, 5.0, i, &status);
+    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]);
@@ -482,57 +784,24 @@
 
     // Interpolate value just below the lowest index value
-    out1 = psLookupTableInterpolate(table1,0,0, &status);
+    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;
     }
-    if ( status != PS_LOOKUP_PAST_TOP) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return status PAST TOP");
-        return 6;
-    }
 
     // Interpolate value just above the highest index value
-    out1 = psLookupTableInterpolate(table1,11,0, &status);
+    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;
     }
-    if ( status != PS_LOOKUP_PAST_BOTTOM) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return status PAST BOTTOM");
-        return 8;
-    }
 
     // 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, &status);
+    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;
     }
-    if ( status != PS_LOOKUP_ERROR ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return status LOOKUP ERROR");
-        return 10;
-    }
-
-    // Interpolate with NULL table
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error NULL table");
-    out1 = psLookupTableInterpolate(NULL,5,0,&status);
-    if( fabs(out1-NAN) > FLT_EPSILON ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN returned %lf",out1);
-        return 11;
-    }
-    if ( status != PS_LOOKUP_ERROR ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return status LOOKUP ERROR");
-        return 12;
-    }
-
-    // Interpolate with status NULL
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error NULL status");
-    out1 = psLookupTableInterpolate(table1,5,0,NULL);
-    if ( fabs(out1-NAN) > FLT_EPSILON ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN returned %lf",out1);
-        return 13;
-    }
-
     psFree(table1);
 
@@ -544,16 +813,26 @@
     psLookupTable*  table1 = NULL;
     psVector*        interpValues;
-    psVector*        statusVector;
+
+    // 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.dat",0,20);
-    table1 = psLookupTableRead(table1);
-    statusVector = psVectorAlloc(table1->numCols,PS_TYPE_U32);
-    interpValues = psLookupTableInterpolateAll(table1,5.25, statusVector);
+    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->numRows-1; i++ ) {
+    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",
@@ -562,57 +841,12 @@
         }
     }
-    for(psS32 j = 0; j < table1->numCols; j++) {
-        if(statusVector->data.U32[j] != PS_LOOKUP_SUCCESS) {
-            psError(PS_ERR_UNKNOWN,true,"Return status not success for col=%d status=%d",
-                    j,statusVector->data.U32[j]);
-            return 3*j;
-        }
-    }
-    psFree(statusVector);
     psFree(interpValues);
 
     // Interpolate values with index outside table
-    statusVector = psVectorAlloc(table1->numCols,PS_TYPE_U32);
-    interpValues = psLookupTableInterpolateAll(table1,0,statusVector);
-    if(interpValues == NULL) {
+    interpValues = psLookupTableInterpolateAll(table1,0);
+    if(interpValues != NULL) {
         psError(PS_ERR_UNKNOWN,true,"Did return NULL");
         return 4;
     }
-
-    for(psS32 i = 0; i < table1->numRows-1; i++ ) {
-        if( fabs(interpValues->data.F64[i]-interpolVal3[i]) > errorTol_psF64) {
-            psError(PS_ERR_UNKNOWN,true,"Did not return expected value. %lg expected %lg",
-                    interpValues->data.F64[i],interpolVal3[i]);
-            return 2*i;
-        }
-    }
-
-    for(psS32 j = 0; j < table1->numCols; j++) {
-        if(statusVector->data.S32[j] != PS_LOOKUP_PAST_TOP) {
-            psError(PS_ERR_UNKNOWN,true,"Return status did not indicate passed top  for col=%d status=%d",
-                    j,statusVector->data.U32[j]);
-            return 3*j;
-        }
-    }
-    psFree(interpValues);
-    psFree(statusVector);
-
-    // Interpolate values with NULL table
-    statusVector = psVectorAlloc(table1->numCols,PS_TYPE_S32);
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL table");
-    interpValues = psLookupTableInterpolateAll(NULL,5,statusVector);
-    if(interpValues != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for NULL table");
-        return 5;
-    }
-    psFree(statusVector);
-
-    // Interpolate values with NULL status vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL status vector");
-    interpValues = psLookupTableInterpolateAll(table1,5,NULL);
-    if(interpValues != NULL ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NULL for NULL status vector");
-        return 6;
-    }
     psFree(table1);
 
Index: /trunk/psLib/test/dataIO/verified/tst_psLookupTable_01.stderr
===================================================================
--- /trunk/psLib/test/dataIO/verified/tst_psLookupTable_01.stderr	(revision 4053)
+++ /trunk/psLib/test/dataIO/verified/tst_psLookupTable_01.stderr	(revision 4054)
@@ -9,6 +9,62 @@
 <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 ******************************************\
@@ -19,45 +75,11 @@
 
 <DATE><TIME>|<HOST>|I|testLookupTableRead
-    Following should generate an error message about invalid type
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse type, (null) on line 3.
-<DATE><TIME>|<HOST>|E|psLookupTableRead (FILE:LINENO)
-    Lookup table is invalid.
-<DATE><TIME>|<HOST>|I|testLookupTableRead
-    Following should generate an error message about invalid value
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, 1) on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, 4= on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, 8; on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, 1(6 on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, -1_ on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, -4$ on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, -8@ on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, -16{ on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, 0.0[ on line 5.
-<DATE><TIME>|<HOST>|E|printError (FILE:LINENO)
-    Unable to parse string, -1.0] on line 5.
-<DATE><TIME>|<HOST>|E|psLookupTableRead (FILE:LINENO)
-    Lookup table is invalid.
-<DATE><TIME>|<HOST>|I|testLookupTableRead
-    Following should generate error msg about opening file
-<DATE><TIME>|<HOST>|E|psLookupTableRead (FILE:LINENO)
-    Failed to open file nonexistantFile.dat.
-<DATE><TIME>|<HOST>|I|testLookupTableRead
-    Following should generate error msg about NULL file name
-<DATE><TIME>|<HOST>|E|psLookupTableRead (FILE:LINENO)
-    Unallowable operation: table->fileName is NULL.
-<DATE><TIME>|<HOST>|I|testLookupTableRead
-    Following should generate error msg about NULL table
+    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)
@@ -70,15 +92,11 @@
 
 <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 8.
-<DATE><TIME>|<HOST>|I|testLookupTableInterpolate
-    Following should generate error NULL table
+    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 an error NULL status
+    Following should generate error out of range.
 <DATE><TIME>|<HOST>|E|psLookupTableInterpolate (FILE:LINENO)
-    Unallowable operation: status is NULL.
+    Error: column, 100, is out of range.  Must be between 0 and 9.
 
 ---> TESTPOINT PASSED (psLookupTable{psLookupTableInterpolate} | tst_psLookupTable_01.c)
@@ -94,8 +112,4 @@
 <DATE><TIME>|<HOST>|E|psLookupTableInterpolateAll (FILE:LINENO)
     Unallowable operation: table is NULL.
-<DATE><TIME>|<HOST>|I|testLookupTableInterpolateAll
-    Following should generate an error message for NULL status vector
-<DATE><TIME>|<HOST>|E|psLookupTableInterpolateAll (FILE:LINENO)
-    Unallowable operation: stats is NULL.
 
 ---> TESTPOINT PASSED (psLookupTable{psLookupTableInterpolateAll} | tst_psLookupTable_01.c)
