Index: trunk/psLib/test/math/tap_psPolynomial.c
===================================================================
--- trunk/psLib/test/math/tap_psPolynomial.c	(revision 13084)
+++ trunk/psLib/test/math/tap_psPolynomial.c	(revision 13305)
@@ -16,6 +16,6 @@
 *    XXX: Compare to FLT_EPSILON
 * 
-*    @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
-*    @date $Date: 2007-05-01 00:08:52 $
+*    @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+*    @date $Date: 2007-05-08 06:21:16 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
@@ -35,6 +35,5 @@
     psLogSetFormat("HLNM");
     psLogSetLevel(PS_LOG_INFO);
-
-    plan_tests(26);
+    plan_tests(51);
 
     // This test will allocate a 1D polynomial and verify the structure allocated
@@ -75,11 +74,27 @@
 
 
-    if (0) {
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, -1) != NULL) {
-            diag("psPolynomial1DAlloc() Returned structure but expected NULL");
-        }
-    }
+    // This test will allocate a Chebyshev 1D polynomial and verify the structure allocated
+    {
+        psMemId id = psMemGetId();
+        psPolynomial1D* my1DPoly  = NULL;
+        my1DPoly = psPolynomial1DAlloc(PS_POLYNOMIAL_CHEB, ORDER);
+        ok(my1DPoly != NULL, "Chebyshev 1D polynomial allocated successfully");
+        skip_start(my1DPoly == NULL, 1, "Skipping tests because psPolynomial1DAlloc() failed");
+        ok(my1DPoly->type == PS_POLYNOMIAL_CHEB, "psPolynomial1DAlloc(): Chebyshev  type set correctly");
+        skip_end();
+        psFree(my1DPoly);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Attempt to allocate with negative order
+    // Following should generate error msg for negative terms
+    if (1) {
+        psMemId id = psMemGetId();
+        ok(psPolynomial1DAlloc(PS_POLYNOMIAL_ORD, -1) == NULL,
+          "psPolynomial1DAlloc() returned NULL with negative polynomial order");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
 
     // This test will allocate a 2D polynomial and verify the structure allocated
@@ -122,16 +137,29 @@
     }
 
-    if (0) {
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, -1, 1) != NULL) {
-            diag("psPolynomial2DAlloc() returned structure but expected NULL");
-        }
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 1, -1) != NULL) {
-            diag("psPolynomial2DAlloc() returned structure but expected NULL");
-        }
-    }
+
+    // This test will allocate a Chebyshev 2D polynomial and verify the structure allocated
+    {
+        psMemId id = psMemGetId();
+        psPolynomial2D* my2DPoly = NULL;
+        my2DPoly = psPolynomial2DAlloc(PS_POLYNOMIAL_CHEB, ORDER,ORDER+1);
+        ok(my2DPoly != NULL, "Chebyshev 2D polynomial allocated successfully");
+        skip_start(my2DPoly == NULL, 1, "Skipping tests because psPolynomial2DAlloc() failed");
+        skip_end();
+        psFree(my2DPoly);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Attempt to allocate with negative order
+    // Following should generate error msg for negative terms
+    if (1) {
+        psMemId id = psMemGetId();
+        ok(psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, -1, 1) == NULL, 
+          "psPolynomial2DAlloc() returned NULL with negative polynomial order");
+        ok(psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 1, -1) == NULL,
+          "psPolynomial2DAlloc() returned NULL with negative polynomial order");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
 
     // This test will allocate a 3D polynomial and verify the structure allocated
@@ -179,21 +207,33 @@
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     }
-    if (0) {
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial3DAlloc(PS_POLYNOMIAL_ORD, -1, 1, 1) != NULL) {
-            diag("psPolynomial3DAlloc(): returned structure but expected NULL");
-        }
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial3DAlloc(PS_POLYNOMIAL_ORD, 1, -1, 1) != NULL) {
-            diag("psPolynomial3DAlloc() returned structure but expected NULL");
-        }
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial3DAlloc(PS_POLYNOMIAL_ORD, 1, 1, -1) != NULL) {
-            diag("psPolynomial3DAlloc(): returned structure but expected NULL");
-        }
-    }
+
+
+    // This test will allocate a Chebyshev 3D polynomial and verify the structure allocated
+    {
+        psMemId id = psMemGetId();
+        psPolynomial3D* my3DPoly = NULL;
+        my3DPoly = psPolynomial3DAlloc(PS_POLYNOMIAL_CHEB, ORDER, ORDER+1, ORDER+2);
+        ok(my3DPoly != NULL, "Chebyshev 3D polynomial allocated successfully");
+        skip_start(my3DPoly == NULL, 1, "Skipping tests because psPolynomial2DAlloc() failed");
+        ok(my3DPoly->type == PS_POLYNOMIAL_CHEB, "psPolynomial3DAlloc(): Chebyshev type set correctly");
+        skip_end();
+        psFree(my3DPoly);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Attempt to allocate with negative order
+    // Following should generate error msg for negative terms
+    if (1) {
+        psMemId id = psMemGetId();
+        ok(psPolynomial3DAlloc(PS_POLYNOMIAL_ORD, -1, 1, 1) == NULL, 
+          "psPolynomial3DAlloc() returned NULL with negative polynomial order");
+        ok(psPolynomial3DAlloc(PS_POLYNOMIAL_ORD, 1, -1, 1) == NULL, 
+          "psPolynomial3DAlloc() returned NULL with negative polynomial order");
+        ok(psPolynomial3DAlloc(PS_POLYNOMIAL_ORD, 1, 1, -1) == NULL,
+          "psPolynomial3DAlloc() returned NULL with negative polynomial order");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
 
     // This test will allocate a 4D polynomial and verify the structure allocated
@@ -245,28 +285,35 @@
     }
 
-    if (0) {
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, -1, 1, 1, 1) != NULL) {
-            diag("psPolynomial4DAlloc(): returned structure but expected NULL");
-        }
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, 1, -1, 1, 1) != NULL) {
-            diag("psPolynomial4DAlloc(): returned structure but expected NULL");
-            psError(PS_ERR_UNKNOWN,true,"Returned structure but expected NULL");
-        }
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, 1, 1, -1, 1) != NULL) {
-            diag("psPolynomial4DAlloc(): returned structure but expected NULL");
-            psError(PS_ERR_UNKNOWN,true,"Returned structure but expected NULL");
-        }
-        // Attempt to allocate with negative order
-        // Following should generate error msg for negative terms
-        if (psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, 1, 1, 1, -1) != NULL) {
-            diag("psPolynomial4DAlloc(): returned structure but expected NULL");
-        }
-    }
+
+    // This test will allocate a Chebyshev 4D polynomial and verify the structure allocated
+    {
+        psMemId id = psMemGetId();
+        psPolynomial4D* my4DPoly = NULL;
+        my4DPoly = psPolynomial4DAlloc(PS_POLYNOMIAL_CHEB, ORDER,ORDER+1,ORDER+2,ORDER+3);
+        ok(my4DPoly != NULL, "Chebyshev 4D polynomial allocated successfully");
+        skip_start(my4DPoly == NULL, 1, "Skipping tests because psPolynomial4DAlloc() failed");
+        ok(my4DPoly->type == PS_POLYNOMIAL_CHEB, "psPolynomial4DAlloc(): Chebyshev type set correctly");
+        skip_end();
+        psFree(my4DPoly);
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
+    // Attempt to allocate with negative order
+    // Following should generate error msg for negative terms
+    if (1) {
+        psMemId id = psMemGetId();
+        ok(psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, -1, 1, 1, 1) == NULL, 
+          "psPolynomial4DAlloc() returned NULL with negative polynomial order");
+        ok(psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, 1, -1, 1, 1) == NULL, 
+          "psPolynomial4DAlloc() returned NULL with negative polynomial order");
+        ok(psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, 1, 1, -1, 1) == NULL,
+          "psPolynomial4DAlloc() returned NULL with negative polynomial order");
+        ok(psPolynomial4DAlloc(PS_POLYNOMIAL_ORD, 1, 1, 1, -1) == NULL,
+          "psPolynomial4DAlloc() returned NULL with negative polynomial order");
+        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
+    }
+
+
 }
 
