Index: /trunk/psLib/src/types/psLookupTable.c
===================================================================
--- /trunk/psLib/src/types/psLookupTable.c	(revision 9671)
+++ /trunk/psLib/src/types/psLookupTable.c	(revision 9672)
@@ -7,6 +7,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-10-13 21:13:48 $
+*  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-20 02:36:51 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
@@ -156,8 +156,9 @@
     if(*end != '\0' && !isspace(*end)) {
         *status = PS_PARSE_ERROR_VALUE;
-    } else if(inString==end) {
-        *status = PS_PARSE_ERROR_VALUE;
-    }
-
+    }
+    /*    else if(inString==end) {
+            *status = PS_PARSE_ERROR_VALUE;
+        }
+    */
     return value;
 }
@@ -173,8 +174,9 @@
     if(*end != '\0' && !isspace(*end)) {
         *status = PS_PARSE_ERROR_VALUE;
-    } else if(inString==end) {
-        *status = PS_PARSE_ERROR_VALUE;
-    }
-
+    }
+    /*    else if(inString==end) {
+            *status = PS_PARSE_ERROR_VALUE;
+        }
+    */
     return value;
 }
@@ -190,8 +192,9 @@
     if(*end != '\0' && !isspace(*end)) {
         *status = PS_PARSE_ERROR_VALUE;
-    } else if(inString==end) {
-        *status = PS_PARSE_ERROR_VALUE;
-    }
-
+    }
+    /*    else if(inString==end) {
+            *status = PS_PARSE_ERROR_VALUE;
+        }
+    */
     return value;
 }
@@ -207,8 +210,9 @@
     if(*end != '\0' && !isspace(*end)) {
         *status = PS_PARSE_ERROR_VALUE;
-    } else if(inString==end) {
-        *status = PS_PARSE_ERROR_VALUE;
-    }
-
+    }
+    /*    else if(inString==end) {
+            *status = PS_PARSE_ERROR_VALUE;
+        }
+    */
     return value;
 }
@@ -224,9 +228,9 @@
 
 
-    if(vec == NULL) {
-        *status = 1;
-        return;
-    }
-
+    /*    if(vec == NULL) {
+            *status = 1;
+            return;
+        }
+    */
     type = vec->type.type;
 
@@ -242,8 +246,9 @@
         break;
     case PS_TYPE_F64:
+    default:
         vec->data.F64[index] = parseF64(strValue, status);
         break;
-    default:
-        *status = PS_PARSE_ERROR_TYPE;
+        //    default:
+        //        *status = PS_PARSE_ERROR_TYPE;
     }
 
Index: /trunk/psLib/test/types/tableF32.dat
===================================================================
--- /trunk/psLib/test/types/tableF32.dat	(revision 9672)
+++ /trunk/psLib/test/types/tableF32.dat	(revision 9672)
@@ -0,0 +1,9 @@
+#  Table with valid types and index-values
+#
+#psF32     psU16    psU32     psU64    psS8    psS16    psS32    psS64    psU8   psF64
+-10.05    2        4         8        0       -2       -4       -8       5      -1.5
+ 1.009     4        8         16       -1      -4       -8       -16      0      -1.0
+23.45     6        12        24       -2      -6       -12      -24      5      -0.25
+3500.67   8        16        32       -3      -8       -16      -32      75     1.75
+   
+#
Index: /trunk/psLib/test/types/tap_psLookupTable_all.c
===================================================================
--- /trunk/psLib/test/types/tap_psLookupTable_all.c	(revision 9671)
+++ /trunk/psLib/test/types/tap_psLookupTable_all.c	(revision 9672)
@@ -24,5 +24,5 @@
 int main(void)
 {
-    plan_tests(5);
+    plan_tests(13);
 
     diag("Tests for psLookupTable Functions");
@@ -46,5 +46,5 @@
         lt = psLookupTableAlloc(NULL, "\%f \%lf \%d \%ld", 10);
         ok( lt == NULL,
-            "psLookupTableAlloc:     return NULL for NULL filename input.");
+            "psLookupTableAlloc:            return NULL for NULL filename input.");
     }
     //Return NULL for NULL format input
@@ -52,5 +52,5 @@
         lt = psLookupTableAlloc("tableF32.dat", NULL, 10);
         ok( lt == NULL,
-            "psLookupTableAlloc:     return NULL for NULL format input.");
+            "psLookupTableAlloc:            return NULL for NULL format input.");
     }
     //Return properly allocated lookupTable for valid inputs
@@ -58,5 +58,6 @@
         lt = psLookupTableAlloc("tableF32.dat", "\%f \%lf \%d \%ld", 10);
         ok( lt != NULL && psMemCheckLookupTable(lt),
-            "psLookupTableAlloc:     return properly allocated lookupTable for valid inputs.");
+            "psLookupTableAlloc:            "
+            "return properly allocated lookupTable for valid inputs.");
     }
 
@@ -66,5 +67,5 @@
         int j = 2;
         ok( !psMemCheckLookupTable(&j),
-            "psMemCheckLookupTable:  return false for non-LookupTable input.");
+            "psMemCheckLookupTable:         return false for non-LookupTable input.");
     }
 
@@ -80,12 +81,198 @@
 {
     diag("  >>>Test 2:  psVectorsReadFromFile, psLookupTableImport, psLookupTableRead Fxns");
-
-
+    psArray *outVec = NULL;
+    psLookupTable*  table1  = NULL;
+    long           numRows = 0;
+    char filename[30];
+    strcpy(filename, "tableF32.dat");
+
+    //Tests for psVectorReadFromFile
+    // Attempt to read from NULL filename input
+    {
+        outVec = psVectorsReadFromFile(NULL,
+                                       "\%f \%d \%d \%ld \%d \%d \%d \%ld \%*d \%lf");
+        ok( outVec == NULL,
+            "psVectorsReadFromFile:         return NULL for NULL filename input.");
+    }
+    // Attempt to read from NULL format input
+    {
+        outVec = psVectorsReadFromFile(filename, NULL);
+        ok( outVec == NULL,
+            "psVectorsReadFromFile:         return NULL for NULL format input.");
+    }
+    // Attempt to read from invalid filename input
+    {
+        outVec = psVectorsReadFromFile("tableS32.dat",
+                                       "\%f \%d \%d \%ld \%d \%d \%d \%ld \%*d \%lf");
+        ok( outVec == NULL,
+            "psVectorsReadFromFile:         return NULL for invalid filename input.");
+    }
+    // Attempt to read from invalid format input
+    {
+        outVec = psVectorsReadFromFile(filename, "\%s");
+        ok( outVec == NULL,
+            "psVectorsReadFromFile:         return NULL for invalid format input.");
+    }
+
+    // Attempt to read from table containing missing entry
+    {
+        outVec = psVectorsReadFromFile("tableF32_err.dat",
+                                       "\%f \%d \%d \%ld \%d \%d \%d \%ld \%*d \%lf");
+        ok( outVec == NULL,
+            "psVectorsReadFromFile:         return NULL for table containing invalid entry.");
+    }
+    // Attempt to read from table containing missing entry
+    {
+        outVec = psVectorsReadFromFile("tableF32_2.dat",
+                                       "\%f \%d \%d \%ld \%d \%d \%d \%ld \%*d \%lf");
+        ok( outVec == NULL,
+            "psVectorsReadFromFile:         return NULL for table containing invalid entry.");
+    }
+
+    //Attempt to read with valid inputs
+    {
+        outVec = psVectorsReadFromFile("tableF32.dat",
+                                       "\%f \%d \%d \%ld \%d \%d \%d \%ld \%*d \%lf");
+        ok( outVec != NULL,
+            "psVectorsReadFromFile:        return non-NULL array for valid format input.");
+    }
 
     //Tests for psListToArray
+    //    psLookupTable *lt = NULL;
+
+
+    // Attempt to read table with NULL input table specified
+    numRows = psLookupTableRead(table1);
+    {
+        ok( numRows == 0,
+            "psLookupTableRead:            return NULL for NULL filename input.");
+    }
+    /*
+    psS32 testLookupTableRead(void)
+    {
+
+    // 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;
+    }
+    */
+
 
     //Check for Memory leaks
     {
-
+        psFree(outVec);
+        psFree(table1);
         checkMem();
     }
