Index: /trunk/psLib/test/dataManip/tst_psFunc02.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psFunc02.c	(revision 2716)
+++ /trunk/psLib/test/dataManip/tst_psFunc02.c	(revision 2717)
@@ -21,4 +21,5 @@
     psS32  currentId = psMemGetId();
     psSpline1D *tmpSpline;
+    psVector* bounds;
 
     /****************************************************************************/
@@ -83,4 +84,5 @@
                             "psSpline1DAlloc(): linear, min/max are equal");
 
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
     tmpSpline = psSpline1DAlloc(N, LINEAR, 1.0, 1.0);
 
@@ -217,4 +219,5 @@
                             "psSpline1DAlloc(): cubic, min/max are equal");
 
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
     tmpSpline = psSpline1DAlloc(N, CUBIC, 1.0, 1.0);
 
@@ -290,4 +293,145 @@
                 testStatus);
 
+    /****************************************************************************/
+    /****************************************************************************/
+    testStatus = true;
+    printPositiveTestHeader(stdout,
+                            "psFunction functions",
+                            "psSpline1DAllocGeneric(): linear, normal");
+
+    bounds = psVectorAlloc(5,PS_TYPE_F32);
+    bounds->n = bounds->nalloc;
+    for(psU32 n = 0; n < 5; n++ ) {
+        bounds->data.F32[n] = (n+1) * 2;
+    }
+    tmpSpline = psSpline1DAllocGeneric(bounds, LINEAR);
+    if (tmpSpline == NULL) {
+        printf("ERROR: Could not allocate psSpline1D data structure\n");
+        testStatus = false;
+    }
+    if (tmpSpline->spline == NULL) {
+        printf("ERROR: Could not allocate psSpline1D->spline data structure\n");
+        testStatus = false;
+    }
+
+    if (tmpSpline->n != N) {
+        printf("ERROR: spline->n set incorrectly (%d)\n", tmpSpline->n);
+        testStatus = false;
+    }
+
+    for (i=0;i<N;i++) {
+        if (tmpSpline->spline[i] == NULL) {
+            printf("ERROR: Could not allocate spline %d\n", i);
+            testStatus = false;
+        }
+        if ((tmpSpline->spline[i])->n != LINEAR+1) {
+            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->n);
+            testStatus = false;
+        }
+    }
+
+    if (tmpSpline->domains == NULL) {
+        printf("ERROR: Could not allocate psSpline1D->domains data structure\n");
+        testStatus = false;
+    }
+
+    for (i=0;i<N+1;i++) {
+        printf("psSpline1D->domains[%d] is %f\n", i, tmpSpline->domains[i]);
+    }
+    psFree(bounds);
+    psFree(tmpSpline);
+    psMemCheckCorruption(1);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
+    if (0 != memLeaks) {
+        psError(PS_ERR_UNKNOWN,true,"Memory Leaks! (%d leaks)", memLeaks);
+        testStatus = false;
+    }
+    printFooter(stdout,
+                "psFunctions functions",
+                "psSpline1DAllocGeneric(): linear, normal",
+                testStatus);
+
+    /****************************************************************************/
+    /****************************************************************************/
+    testStatus = true;
+    printPositiveTestHeader(stdout,
+                            "psFunction functions",
+                            "psSpline1DAllocGeneric(): negative order");
+
+    bounds = psVectorAlloc(5,PS_TYPE_F32);
+    bounds->n = bounds->nalloc;
+    for(psU32 n = 0; n < 5; n++ ) {
+        bounds->data.F32[n] = (n+1) * 2;
+    }
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
+    tmpSpline = psSpline1DAllocGeneric(bounds, -1);
+    if (tmpSpline != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return null for negative order");
+        return 10;
+    }
+    psFree(bounds);
+    psMemCheckCorruption(1);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
+    if (0 != memLeaks) {
+        psError(PS_ERR_UNKNOWN,true,"Memory Leaks! (%d leaks)", memLeaks);
+        testStatus = false;
+    }
+    printFooter(stdout,
+                "psFunctions functions",
+                "psSpline1DAllocGeneric(): negative order",
+                testStatus);
+
+    /****************************************************************************/
+    /****************************************************************************/
+    testStatus = true;
+    printPositiveTestHeader(stdout,
+                            "psFunction functions",
+                            "psSpline1DAllocGeneric(): bound equal to NULL");
+
+    bounds = NULL;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
+    tmpSpline = psSpline1DAllocGeneric(bounds, LINEAR);
+    if (tmpSpline != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return null for bounds equal to NULL");
+        return 20;
+    }
+    psMemCheckCorruption(1);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
+    if (0 != memLeaks) {
+        psError(PS_ERR_UNKNOWN,true,"Memory Leaks! (%d leaks)", memLeaks);
+        testStatus = false;
+    }
+    printFooter(stdout,
+                "psFunctions functions",
+                "psSpline1DAllocGeneric(): bound equal to NULL",
+                testStatus);
+
+    /****************************************************************************/
+    /****************************************************************************/
+    testStatus = true;
+    printPositiveTestHeader(stdout,
+                            "psFunction functions",
+                            "psSpline1DAllocGeneric(): bounds with zero elements");
+
+    bounds = psVectorAlloc(5,PS_TYPE_F32);
+    bounds->n = 0;
+    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
+    tmpSpline = psSpline1DAllocGeneric(bounds, LINEAR);
+    if (tmpSpline != NULL) {
+        psError(PS_ERR_UNKNOWN,true,"Did not return null for negative order");
+        return 30;
+    }
+    psFree(bounds);
+    psMemCheckCorruption(1);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
+    if (0 != memLeaks) {
+        psError(PS_ERR_UNKNOWN,true,"Memory Leaks! (%d leaks)", memLeaks);
+        testStatus = false;
+    }
+    printFooter(stdout,
+                "psFunctions functions",
+                "psSpline1DAllocGeneric(): bounds with zero elements",
+                testStatus);
+
     return (!testStatus);
 }
Index: /trunk/psLib/test/dataManip/verified/tst_psFunc02.stderr
===================================================================
--- /trunk/psLib/test/dataManip/verified/tst_psFunc02.stderr	(revision 2717)
+++ /trunk/psLib/test/dataManip/verified/tst_psFunc02.stderr	(revision 2717)
@@ -0,0 +1,20 @@
+<DATE><TIME>|<HOST>|I|main
+    Following should generate an error message.
+<DATE><TIME>|<HOST>|E|psSpline1DAlloc (psFunctions.c:<LINENO>)
+    Error: max and min are equal.
+<DATE><TIME>|<HOST>|I|main
+    Following should generate an error message
+<DATE><TIME>|<HOST>|E|psSpline1DAlloc (psFunctions.c:<LINENO>)
+    Error: max and min are equal.
+<DATE><TIME>|<HOST>|I|main
+    Following should generate an error message.
+<DATE><TIME>|<HOST>|E|psSpline1DAllocGeneric (psFunctions.c:<LINENO>)
+    Error: order is less than 0.
+<DATE><TIME>|<HOST>|I|main
+    Following should generate an error message.
+<DATE><TIME>|<HOST>|E|psSpline1DAllocGeneric (psFunctions.c:<LINENO>)
+    Unallowable operation: psVector bounds or its data is NULL.
+<DATE><TIME>|<HOST>|I|main
+    Following should generate an error message.
+<DATE><TIME>|<HOST>|E|psSpline1DAllocGeneric (psFunctions.c:<LINENO>)
+    Unallowable operation: psVector bounds has no elements.
Index: /trunk/psLib/test/dataManip/verified/tst_psFunc02.stdout
===================================================================
--- /trunk/psLib/test/dataManip/verified/tst_psFunc02.stdout	(revision 2717)
+++ /trunk/psLib/test/dataManip/verified/tst_psFunc02.stdout	(revision 2717)
@@ -0,0 +1,115 @@
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAlloc(): linear, normal}    *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+psSpline1D->domains[0] is 1.000000
+psSpline1D->domains[1] is 3.250000
+psSpline1D->domains[2] is 5.500000
+psSpline1D->domains[3] is 7.750000
+psSpline1D->domains[4] is 10.000000
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAlloc(): linear, normal} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAlloc(): linear, min/max are equal} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAlloc(): linear, min/max are equal} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAlloc(): linear, min > max.} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+psSpline1D->domains[0] is 1.000000
+psSpline1D->domains[1] is 0.500000
+psSpline1D->domains[2] is 0.000000
+psSpline1D->domains[3] is -0.500000
+psSpline1D->domains[4] is -1.000000
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAlloc(): linear, min > max.} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAlloc(), cubic, normal}     *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+psSpline1D->domains[0] is 1.000000
+psSpline1D->domains[1] is 3.250000
+psSpline1D->domains[2] is 5.500000
+psSpline1D->domains[3] is 7.750000
+psSpline1D->domains[4] is 10.000000
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAlloc(): cubic, normal} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAlloc(): cubic, min/max are equal} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAlloc(): cubic, min/max are equal} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAlloc(): cubic, min > max.} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+psSpline1D->domains[0] is 1.000000
+psSpline1D->domains[1] is 0.500000
+psSpline1D->domains[2] is 0.000000
+psSpline1D->domains[3] is -0.500000
+psSpline1D->domains[4] is -1.000000
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAlloc(): cubic, min > max.} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAllocGeneric(): linear, normal} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+psSpline1D->domains[0] is 2.000000
+psSpline1D->domains[1] is 4.000000
+psSpline1D->domains[2] is 6.000000
+psSpline1D->domains[3] is 8.000000
+psSpline1D->domains[4] is 10.000000
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAllocGeneric(): linear, normal} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAllocGeneric(): negative order} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAllocGeneric(): negative order} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAllocGeneric(): bound equal to NULL} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAllocGeneric(): bound equal to NULL} | tst_psFunc02.c)
+
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psFunc02.c                                             *
+*            TestPoint: psFunction functions{psSpline1DAllocGeneric(): bounds with zero elements} *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psFunctions functions{psSpline1DAllocGeneric(): bounds with zero elements} | tst_psFunc02.c)
+
