IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 29, 2007, 2:11:31 PM (19 years ago)
Author:
gusciora
Message:

Improved skip macro placement for the PolyEval files.

Fist version of tap_psMatrixVectorArithmetic01.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/math/tap_psPolynomialEval2D.c

    r10848 r11397  
    44*  ORD and CHEB type polynomials.
    55*
    6 *  @version  $Revision: 1.2 $  $Name: not supported by cvs2svn $
    7 *  @date  $Date: 2006-12-29 04:38:42 $
     6*  @version  $Revision: 1.3 $  $Name: not supported by cvs2svn $
     7*  @date  $Date: 2007-01-30 00:11:31 $
    88*
    99* Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    101101        }
    102102        ok(!errorFlag, "psPolynomial2DEval() successful (Ordinary)");
    103 
     103        skip_end();
    104104        psFree(polyOrd);
    105         skip_end();
    106105        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    107106    }
     
    137136        }
    138137        ok(!errorFlag, "psPolynomial2DEval() successful (Chebyshev)");
    139 
     138        skip_end();
    140139        psFree(polyCheb);
    141         skip_end();
    142140        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    143141    }
     
    148146        psMemId id = psMemGetId();
    149147        psPolynomial2D* polyOrd = psPolynomial2DAlloc(99, TERMS-1, TERMS-1);
    150         ok(polyOrd == NULL, "Ordinary polynomial allocation successful");
     148        ok(polyOrd != NULL, "Ordinary polynomial allocation successful");
    151149        skip_start(polyOrd == NULL, 1, "Skipping tests because psPolynomial2DAlloc() failed");
    152 
    153         // Attempt to evaluation invalid polynomial type
     150        // Attempt to evaluate invalid polynomial type
    154151        psF64 result = psPolynomial2DEval(polyOrd,0.0, 0.0);
    155152        ok(isnan(result), "psPolynomial2DEval() did not return NAN, as expected");
    156 
    157153        skip_end();
    158154        psFree(polyOrd);
    159 
    160155        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    161156    }
     
    165160    {
    166161        psMemId id = psMemGetId();
    167         psPolynomial2D* polyOrd = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, TERMS-1, TERMS-1);
    168         ok(polyOrd != NULL, "Ordinary polynomial allocation successful");
    169         skip_start(polyOrd == NULL, 8, "Skipping tests because psPolynomial2DAlloc() failed");
    170 
    171         // Set polynomial members
    172         for(psS32 i = 0; i < TERMS; i++)
    173         {
    174             for(psS32 j = 0; j < TERMS; j++) {
    175                 polyOrd->coeff[i][j] = poly2DCoeff[i][j];
    176                 polyOrd->mask[i][j]  = poly2DMask[i][j];
    177             }
    178         }
    179 
    180162        // Create input vectors
    181163        psVector* inputOrdX  = psVectorAlloc(TESTPOINTS, PS_TYPE_F64);
     
    189171        }
    190172
     173        psPolynomial2D* polyOrd = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, TERMS-1, TERMS-1);
     174        ok(polyOrd != NULL, "Ordinary polynomial allocation successful");
     175        skip_start(polyOrd == NULL, 8, "Skipping tests because psPolynomial2DAlloc() failed");
     176        // Set polynomial members
     177        for(psS32 i = 0; i < TERMS; i++)
     178        {
     179            for(psS32 j = 0; j < TERMS; j++) {
     180                polyOrd->coeff[i][j] = poly2DCoeff[i][j];
     181                polyOrd->mask[i][j]  = poly2DMask[i][j];
     182            }
     183        }
     184
    191185        // Evaluate the vectors
    192186        psVector* outputOrd = psPolynomial2DEvalVector(polyOrd, inputOrdX, inputOrdY);
     
    223217        inputOrdY->type.type = PS_TYPE_U8;
    224218        ok(psPolynomial2DEvalVector(polyOrd,inputOrdX, inputOrdY) == NULL, "psPolynomial2DEvalVector() produced NULL when called with non F64 input vector");
    225 
     219        psFree(outputOrd);
     220        skip_end();
    226221        psFree(inputOrdX);
    227222        psFree(inputOrdY);
    228         psFree(outputOrd);
    229223        psFree(polyOrd);
    230 
    231         skip_end();
    232224        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    233225
     
    241233    {
    242234        psMemId id = psMemGetId();
    243         psPolynomial2D* polyCheb = psPolynomial2DAlloc(PS_POLYNOMIAL_CHEB, TERMS-1, TERMS-1);
    244         ok(polyCheb != NULL, "Cheby polynomial allocation successful");
    245         skip_start(polyCheb == NULL, 8, "Skipping tests because psPolynomial2DAlloc() failed");
    246 
    247         // Set polynomial members
    248         for(psS32 i = 0; i < TERMS; i++)
    249         {
    250             for(psS32 j = 0; j < TERMS; j++) {
    251                 polyCheb->coeff[i][j] = 1.0;
    252                 polyCheb->mask[i][j]  = poly2DMask[i][j];
    253             }
    254         }
    255 
    256235        // Create input vectors
    257236        psVector* inputChebX = psVectorAlloc(TESTPOINTS, PS_TYPE_F64);
     
    265244        }
    266245
     246        psPolynomial2D* polyCheb = psPolynomial2DAlloc(PS_POLYNOMIAL_CHEB, TERMS-1, TERMS-1);
     247        ok(polyCheb != NULL, "Cheby polynomial allocation successful");
     248        skip_start(polyCheb == NULL, 8, "Skipping tests because psPolynomial2DAlloc() failed");
     249        // Set polynomial members
     250        for(psS32 i = 0; i < TERMS; i++)
     251        {
     252            for(psS32 j = 0; j < TERMS; j++) {
     253                polyCheb->coeff[i][j] = 1.0;
     254                polyCheb->mask[i][j]  = poly2DMask[i][j];
     255            }
     256        }
     257
    267258        // Evaluate the vectors
    268259        psVector* outputCheb = psPolynomial2DEvalVector(polyCheb, inputChebX, inputChebY);
     
    300291        inputChebY->type.type = PS_TYPE_U8;
    301292        ok(psPolynomial2DEvalVector(polyCheb,inputChebX, inputChebY) == NULL, "psPolynomial2DEvalVector() produced NULL when called with non F64 input vector");
    302 
     293        psFree(outputCheb);
     294        skip_end();
    303295        psFree(inputChebX);
    304296        psFree(inputChebY);
    305         psFree(outputCheb);
    306297        psFree(polyCheb);
    307 
    308         skip_end();
    309298        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    310299    }
Note: See TracChangeset for help on using the changeset viewer.