IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 1, 2007, 6:20:06 PM (19 years ago)
Author:
gusciora
Message:

Added tabular file of all psLib functions in Chapter 6 of the SDRS (Data
Manipulation). Most of the test file changes in this check-in are fairly
cosmetic.

File:
1 edited

Legend:

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

    r10945 r13124  
    1313*  @author GLG, MHPCC
    1414*
    15 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    16 *  @date $Date: 2007-01-06 00:48:54 $
     15*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     16*  @date $Date: 2007-05-02 04:20:06 $
    1717*
    1818*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    257257    psLogSetFormat("HLNM");
    258258    psLogSetLevel( PS_LOG_INFO );
    259 
    260     plan_tests(24);
     259    plan_tests(28);
     260
    261261    // psSplineAllocTest()
    262262    {
     
    270270        ok(tmpSpline->p_psDeriv2 == NULL, "psSpline1DAlloc() properly set the psSpline1D->p_psDeriv2 member");
    271271        psFree(tmpSpline);
    272 
    273272        skip_end();
    274273        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     
    282281        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    283282    }
     283
     284    // Verify psSpline1DEval() for NULL input
     285    // Verify with spline->n==0, and spline->knots PS_TYPE_F64
     286    {
     287        psMemId id = psMemGetId();
     288        float y = psSpline1DEval(NULL, 0.0);
     289        ok(isnan(y), "psSpline1DEval() returned NAN will NULL input spline");
     290        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     291    }
     292
     293
     294    // Verify psSpline1DEvalVector() for NULL input spline
     295    {
     296        psMemId id = psMemGetId();
     297        psVector *x = psVectorAlloc(10, PS_TYPE_F32);
     298        psVector *y = psSpline1DEvalVector(NULL, x);
     299        ok(y == NULL, "psSpline1DEvalVector() returned NAN will NULL input spline");
     300        psFree(x);
     301        psFree(y);
     302        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     303    }
     304
     305
     306    // Verify psSpline1DEvalVector() for NULL input vector
     307    // XXX: Move this where we have a good spline.  It currently fails because
     308    // were calling it with an un-fully-allocated one.
     309    if (0) {
     310        psMemId id = psMemGetId();
     311        psSpline1D *tmpSpline = psSpline1DAlloc();
     312        psVector *y = psSpline1DEvalVector(tmpSpline, NULL);
     313        ok(y == NULL, "psSpline1DEvalVector() returned NAN will NULL input vector");
     314        psFree(tmpSpline);
     315        psFree(y);
     316        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     317    }
     318
    284319
    285320    ok(genericF32Test(1, myFunc00, false), "Generic, simple mapping, F32 test. 1 spline");
Note: See TracChangeset for help on using the changeset viewer.