IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5546 for trunk/psLib/test/math


Ignore:
Timestamp:
Nov 18, 2005, 10:04:38 AM (20 years ago)
Author:
gusciora
Message:

stdout/stderr data.

File:
1 edited

Legend:

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

    r5183 r5546  
    1313*  @author GLG, MHPCC
    1414*
    15 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    16 *  @date $Date: 2005-09-29 20:25:54 $
     15*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     16*  @date $Date: 2005-11-18 20:04:38 $
    1717*
    1818*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    126126
    127127/*********************************************************************************
    128 psSplineEvalTest_sub00(): We test the psVectorFitSpline1D, psSpline1DEval() functions with a very
    129 simple x->y mapping (defined by myFunc00() below).  We do this for both F32
    130 and F64 versions of the input x and y vectors.
     128psSplineEvalTest_sub(): We psVectorFitSpline1D with NULL arguments. psSpline1DEval()
     129 ********************************************************************************/
     130psS32 psSplineEvalTest_sub(psS32 NumSplines)
     131{
     132    psS32 testStatus = true;
     133    psS32 memLeaks=0;
     134    psS32  currentId = psMemGetId();
     135
     136    printf("\n");
     137    printf("Calling psVectorFitSpline1D() with NULL y-vector.  Should generate error.\n");
     138    psSpline1D *tmpSpline = psVectorFitSpline1D(NULL, NULL);
     139    if (tmpSpline != NULL) {
     140        printf("TEST ERROR: psVectorFitSpline1D() did not return NULL.\n");
     141        testStatus = false;
     142        psFree(tmpSpline);
     143    }
     144
     145    psMemCheckCorruption(1);
     146    memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false);
     147    if (0 != memLeaks) {
     148        psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
     149    }
     150
     151    return (testStatus);
     152}
     153
     154
     155/*********************************************************************************
     156psSplineEvalTest_sub00(): We test the psVectorFitSpline1D, psSpline1DEval()
     157functions with a very simple x->y mapping (defined by myFunc00() below).  We
     158do this for both F32 and F64 versions of the input x and y vectors.
    131159 ********************************************************************************/
    132160psF32 myFunc00(psF32 x)
     
    149177
    150178    printf("\n");
    151     printf("Calling psVectorFitSpline1D() with NULL y-vector.  Should generate error.\n");
    152     tmpSpline = psVectorFitSpline1D(NULL, NULL);
    153     if (tmpSpline != NULL) {
    154         printf("TEST ERROR: psVectorFitSpline1D() did not return NULL.\n");
    155         testStatus = false;
    156         psFree(tmpSpline);
    157     }
    158 
    159     printf("\n");
    160179    printf("psSplineEvalTest_sub00(): We test the psVectorFitSpline1D, psSpline1DEval() functions with a very\n");
    161180    printf("simple x->y mapping (defined by myFunc00()).  We do this for both F32\n");
    162181    printf("and F64 versions of the input x and y vectors.\n");
     182    printf("    Number of splines: %d\n", NumSplines);
    163183    /****************************************************************************/
    164184    /*    PS_TYPE_F32, PS_TYPE_F32 test          */
    165185    /****************************************************************************/
     186    printf("Performing the F32 test....\n");
    166187    xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    167188    xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64);
     
    239260    /*    PS_TYPE_F64, PS_TYPE_F64 test          */
    240261    /****************************************************************************/
     262    printf("Performing the F64 test....\n");
    241263    xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    242264    xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64);
     
    314336
    315337/*********************************************************************************
    316 psSplineEvalTest_sub00b(): We test the psVectorFitSpline1D, psSpline1DEval() functions with a
    317 more complicated x->y mapping (defined by myFunc00b() below).  We do this for
    318 both F32 and F64 versions of the input x and y vectors.
     338psSplineEvalTest_sub00b(): We test the psVectorFitSpline1D, psSpline1DEval()
     339functions with a more complicated x->y mapping (defined by myFunc00b() below).
     340We do this for both F32 and F64 versions of the input x and y vectors.
    319341 ********************************************************************************/
    320342#define A 4.0
     
    333355    printf("more complicated x->y mapping (defined by myFunc00b()).  We do this for\n");
    334356    printf("both F32 and F64 versions of the input x and y vectors.\n");
     357    printf("    Number of splines: %d\n", NumSplines);
    335358    psS32 testStatus = true;
    336359    psS32 memLeaks=0;
     
    347370    /*    PS_TYPE_F32, PS_TYPE_F32 test          */
    348371    /****************************************************************************/
     372    printf("Performing the F32 test....\n");
    349373    xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    350374    xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64);
     
    421445    /*    PS_TYPE_F64, PS_TYPE_F64 test          */
    422446    /****************************************************************************/
     447    printf("Performing the F64 test....\n");
    423448    xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    424449    xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64);
     
    496521
    497522
     523/*********************************************************************************
     524psSplineEvalTest_sub00b():  This is similar to psSplineEvalTest_sub00b()
     525except that the x vector is NULL.
     526 ********************************************************************************/
    498527psS32 psSplineEvalTest_sub00c(psS32 NumSplines)
    499528{
     
    501530    printf("psSplineEvalTest_sub00c(): This is similar to psSplineEvalTest_sub00b()\n");
    502531    printf("except that the x vector is NULL.\n");
     532    printf("    Number of splines: %d\n", NumSplines);
    503533    psS32 testStatus = true;
    504534    psS32 memLeaks=0;
     
    515545    /*    PS_TYPE_F32, PS_TYPE_F32 test          */
    516546    /****************************************************************************/
     547    printf("Performing the F32 test....\n");
    517548    xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    518549    xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64);
     
    589620    /*    PS_TYPE_F64, PS_TYPE_F64 test          */
    590621    /****************************************************************************/
     622    printf("Performing the F64 test....\n");
    591623    xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    592624    xF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64);
     
    678710    psTraceSetLevel("psSpline1DEvalVector", 0);
    679711
    680     return(psSplineEvalTest_sub00(95) & psSplineEvalTest_sub00b(95) & psSplineEvalTest_sub00c(95));
     712    psS32 testStatus = psSplineEvalTest_sub(10);
     713
     714    // HEY
     715    testStatus |= psSplineEvalTest_sub00(0);
     716    testStatus |= psSplineEvalTest_sub00b(0);
     717    testStatus |= psSplineEvalTest_sub00c(0);
     718
     719    testStatus |= psSplineEvalTest_sub00(1);
     720    testStatus |= psSplineEvalTest_sub00b(1);
     721    testStatus |= psSplineEvalTest_sub00c(1);
     722
     723    testStatus |= psSplineEvalTest_sub00(95);
     724    testStatus |= psSplineEvalTest_sub00b(95);
     725    testStatus |= psSplineEvalTest_sub00c(95);
     726
     727    return(testStatus);
    681728}
    682729
     
    695742    /*    PS_TYPE_F32, PS_TYPE_F32 test          */
    696743    /****************************************************************************/
     744    printf("Performing the F32 test....\n");
    697745    xF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    698746    yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
     
    806854
    807855
     856// This code will
Note: See TracChangeset for help on using the changeset viewer.