Index: trunk/psLib/test/math/tap_psSpline1D.c
===================================================================
--- trunk/psLib/test/math/tap_psSpline1D.c	(revision 13124)
+++ trunk/psLib/test/math/tap_psSpline1D.c	(revision 42336)
@@ -1,10 +1,10 @@
-/* @file  tst_psImageManip.c
-*
-*  @brief This file will contain tests for all of the public psLib functions
+/* @file  tap_psImageManip.c
+*
+*  @brief This file contains tests for all of the public psLib functions
 *         that implement 1-D spline functionality:
 * psSpline1DAlloc()
 * psSpline1DEval()
 * psSpline1DEvalVector()
-* psVectorFitSpline1D()
+* psSpline1DFitVector()
 *
 *         This file is composed of the tests formerly in tst_psFunc02.c,
@@ -35,4 +35,6 @@
     psF32 expect)
 {
+    // NOTE: this returns NAN if 'expect' == 0.0
+    // NOTE 2: this is not testing a percent, but fractional error
     if ((fabs(actual - expect) / fabs(expect)) > ERROR_TOLERANCE_PERCENT) {
         return(true);
@@ -83,9 +85,16 @@
 typedef psF64 (*mappingFuncF64)(psF64 x);
 
+/* EAM 2023.01.22 : these tests are not well considered.  They generate a set of N+1 points 
+   to use as knots at integer values from 0 to N, then evaluate the spline half-way between
+   the knots.   the function above is a cubic, so a cubic spline should fit it perfectly, which 
+   is fine.  Perhaps this test suite should use a pre-defined collection of data points?
+ */
+
 bool genericF32Test(psS32 NumSplines, mappingFuncF32 func, bool xNull)
 {
-    // We test the psVectorFitSpline1D, psSpline1DEval() functions.  F32 version.
+    // We test the psSpline1DFitVector, psSpline1DEval() functions.  F32 version.
     bool testStatus = true;
     {
+	// Generate the vector data
         psMemId id = psMemGetId();
         psVector *xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
@@ -98,32 +107,33 @@
         psSpline1D *tmpSpline = NULL;
         if (!xNull) {
-            tmpSpline = psVectorFitSpline1D(xF32, yF32);
+            tmpSpline = psSpline1DFitVector(xF32, yF32);
         } else {
-            tmpSpline = psVectorFitSpline1D(NULL, yF32);
-        }
+            tmpSpline = psSpline1DFitVector(NULL, yF32);
+        }
+
         if(tmpSpline == NULL) {
-            diag("psVectorFitSpline1D() returned NULL");
+            diag("psSpline1DFitVector() returned NULL");
             testStatus = false;
         } else {
             if (tmpSpline->n != NumSplines) {
-                diag("psVectorFitSpline1D() did not properly set the psSpline1D->n member");
+                diag("psSpline1DFitVector() did not properly set the psSpline1D->n member");
                 testStatus = false;
             }
             if(tmpSpline->spline == NULL) {
-                diag("psVectorFitSpline1D() returned a NULL psSpline1D->spline member.");
+                diag("psSpline1DFitVector() returned a NULL psSpline1D->spline member.");
                 testStatus = false;
             }
             for (psS32 i = 0 ; i < NumSplines ; i++) {
                 if (tmpSpline->spline[i] == NULL) {
-                    diag("psVectorFitSpline1D() returned a NULL psSpline1D->spline[%d] member.", i);
+                    diag("psSpline1DFitVector() returned a NULL psSpline1D->spline[%d] member.", i);
                     testStatus = false;
                 }
             }
             if (tmpSpline->knots == NULL) {
-                diag("psVectorFitSpline1D() returned a NULL psSpline1D->knots member");
+                diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member");
                 testStatus = false;
             }
             if (tmpSpline->p_psDeriv2 == NULL) {
-                diag("psVectorFitSpline1D()returned a NULL psSpline1D->p_psDeriv2 member");
+                diag("psSpline1DFitVector()returned a NULL psSpline1D->p_psDeriv2 member");
                 testStatus = false;
             }
@@ -136,4 +146,5 @@
                     testStatus = false;
                     diag("TEST ERROR: f(%f) is %f, should be %f", x, y, myFunc00(x));
+		    // XXX EAM : the truth value above should be 'func' not myFunc00
                 }
             }
@@ -150,4 +161,5 @@
                         diag("TEST ERROR: f(%f) is %f, should be %f", xF32->data.F32[i],
                              yF32Test->data.F32[i], myFunc00(xF32->data.F32[i]));
+		    // XXX EAM : the truth value above should be 'func' not myFunc00
                     }
                 }
@@ -171,5 +183,5 @@
 bool genericF64Test(psS32 NumSplines, mappingFuncF64 func, bool xNull)
 {
-    // We test the psVectorFitSpline1D, psSpline1DEval() functions.  F64 version.
+    // We test the psSpline1DFitVector, psSpline1DEval() functions.  F64 version.
     bool testStatus = true;
     {
@@ -184,32 +196,32 @@
         psSpline1D *tmpSpline = NULL;
         if (!xNull) {
-            tmpSpline = psVectorFitSpline1D(xF64, yF64);
+            tmpSpline = psSpline1DFitVector(xF64, yF64);
         } else {
-            tmpSpline = psVectorFitSpline1D(NULL, yF64);
+            tmpSpline = psSpline1DFitVector(NULL, yF64);
         }
         if(tmpSpline == NULL) {
-            diag("psVectorFitSpline1D() returned NULL");
+            diag("psSpline1DFitVector() returned NULL");
             testStatus = false;
         } else {
             if (tmpSpline->n != NumSplines) {
-                diag("psVectorFitSpline1D() did not properly set the psSpline1D->n member");
+                diag("psSpline1DFitVector() did not properly set the psSpline1D->n member");
                 testStatus = false;
             }
             if(tmpSpline->spline == NULL) {
-                diag("psVectorFitSpline1D() returned a NULL psSpline1D->spline member.");
+                diag("psSpline1DFitVector() returned a NULL psSpline1D->spline member.");
                 testStatus = false;
             }
             for (psS32 i = 0 ; i < NumSplines ; i++) {
                 if (tmpSpline->spline[i] == NULL) {
-                    diag("psVectorFitSpline1D() returned a NULL psSpline1D->spline[%d] member.", i);
+                    diag("psSpline1DFitVector() returned a NULL psSpline1D->spline[%d] member.", i);
                     testStatus = false;
                 }
             }
             if (tmpSpline->knots == NULL) {
-                diag("psVectorFitSpline1D() returned a NULL psSpline1D->knots member");
+                diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member");
                 testStatus = false;
             }
             if (tmpSpline->p_psDeriv2 == NULL) {
-                diag("psVectorFitSpline1D()returned a NULL psSpline1D->p_psDeriv2 member");
+                diag("psSpline1DFitVector()returned a NULL psSpline1D->p_psDeriv2 member");
                 testStatus = false;
             }
@@ -274,9 +286,9 @@
     }
 
-    // psSplineEvalTest_sub(): Call psVectorFitSpline1D with NULL arguments.
-    {
-        psMemId id = psMemGetId();
-        psSpline1D *tmpSpline = psVectorFitSpline1D(NULL, NULL);
-        ok(tmpSpline == NULL, "psVectorFitSpline1D() returns NULL with NULL arguments");
+    // psSplineEvalTest_sub(): Call psSpline1DFitVector with NULL arguments.
+    {
+        psMemId id = psMemGetId();
+        psSpline1D *tmpSpline = psSpline1DFitVector(NULL, NULL);
+        ok(tmpSpline == NULL, "psSpline1DFitVector() returns NULL with NULL arguments");
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -287,5 +299,5 @@
         psMemId id = psMemGetId();
         float y = psSpline1DEval(NULL, 0.0);
-        ok(isnan(y), "psSpline1DEval() returned NAN will NULL input spline");
+        ok(isnan(y), "psSpline1DEval() returned NAN with NULL input spline");
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
@@ -297,5 +309,5 @@
         psVector *x = psVectorAlloc(10, PS_TYPE_F32);
         psVector *y = psSpline1DEvalVector(NULL, x);
-        ok(y == NULL, "psSpline1DEvalVector() returned NAN will NULL input spline");
+        ok(y == NULL, "psSpline1DEvalVector() returned NULL with NULL input spline");
         psFree(x);
         psFree(y);
@@ -316,5 +328,4 @@
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
-
 
     ok(genericF32Test(1, myFunc00, false), "Generic, simple mapping, F32 test. 1 spline");
