IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 3, 2004, 3:05:00 PM (22 years ago)
Author:
desonia
Message:

changed the psError signature to match SDRS. Also made misc. cleanups as
I was combing the files.

Location:
trunk/psLib/test/dataManip
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/dataManip/tst_psFunc02.c

    r2204 r2273  
    6464    }
    6565
    66     p_psSpline1DFree(tmpSpline);
     66    psFree(tmpSpline);
    6767    psMemCheckCorruption(1);
    6868    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
     
    9090    }
    9191
    92     p_psSpline1DFree(tmpSpline);
     92    psFree(tmpSpline);
    9393    psMemCheckCorruption(1);
    9494    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
     
    144144    }
    145145
    146     p_psSpline1DFree(tmpSpline);
     146    psFree(tmpSpline);
    147147    psMemCheckCorruption(1);
    148148    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
     
    198198    }
    199199
    200     p_psSpline1DFree(tmpSpline);
     200    psFree(tmpSpline);
    201201    psMemCheckCorruption(1);
    202202    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
     
    224224    }
    225225
    226     p_psSpline1DFree(tmpSpline);
     226    psFree(tmpSpline);
    227227    psMemCheckCorruption(1);
    228228    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
     
    278278    }
    279279
    280     p_psSpline1DFree(tmpSpline);
     280    psFree(tmpSpline);
    281281    psMemCheckCorruption(1);
    282282    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
  • trunk/psLib/test/dataManip/tst_psFunc03.c

    r2204 r2273  
    7272    }
    7373
    74     p_psSpline1DFree(tmpSpline);
     74    psFree(tmpSpline);
    7575    psFree(bounds);
    7676    psMemCheckCorruption(1);
     
    132132    }
    133133
    134     p_psSpline1DFree(tmpSpline);
     134    psFree(tmpSpline);
    135135    psFree(bounds);
    136136    psMemCheckCorruption(1);
  • trunk/psLib/test/dataManip/tst_psFunc04.c

    r2204 r2273  
    5353    }
    5454
    55     p_psSpline1DFree(tmpSpline);
     55    psFree(tmpSpline);
    5656    psMemCheckCorruption(1);
    5757    psFree(data);
     
    105105    }
    106106
    107     p_psSpline1DFree(tmpSpline);
     107    psFree(tmpSpline);
    108108    psMemCheckCorruption(1);
    109109    psFree(data);
  • trunk/psLib/test/dataManip/tst_psFunc05.c

    r2204 r2273  
    5959    }
    6060
    61     p_psSpline1DFree(tmpSpline);
     61    psFree(tmpSpline);
    6262
    6363    psFree(x);
  • trunk/psLib/test/dataManip/tst_psFunc07.c

    r2223 r2273  
    8383    psFree(newX);
    8484    psFree(y);
    85     p_psSpline1DFree(tmpSpline);
     85    psFree(tmpSpline);
    8686    psFree(newY);
    8787
     
    152152    psFree(newX);
    153153    psFree(y);
    154     p_psSpline1DFree(tmpSpline);
     154    psFree(tmpSpline);
    155155    psFree(newY);
    156156
  • trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c

    r2204 r2273  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-10-27 00:57:33 $
     12 *  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-11-04 01:05:00 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8383#define CHECK_MEMORY \
    8484if( psMemCheckLeaks(0, NULL, stdout) != 0 ) {  \
    85     psError(__func__,"Memory leaks detected."); \
     85    psError(PS_ERR_UNKNOWN, true,"Memory leaks detected."); \
    8686    return 50; \
    8787} \
    8888psS32 nBad = psMemCheckCorruption(0); \
    8989if(nBad) { \
    90     psError(__func__,"ERROR: Found %d bad memory blocks\n", nBad); \
     90    psError(PS_ERR_UNKNOWN, true,"ERROR: Found %d bad memory blocks\n", nBad); \
    9191    return 51; \
    9292}
  • trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c

    r2204 r2273  
    1515 *  @author  Ross Harman, MHPCC
    1616 *
    17  *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
    18  *  @date  $Date: 2004-10-27 00:57:33 $
     17 *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
     18 *  @date  $Date: 2004-11-04 01:05:00 $
    1919 *
    2020 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    221221    CREATE_AND_SET_VECTOR(vector6,F64,0,3);
    222222    if ( psBinaryOp(vector6,vector4,"+",NULL) != NULL ) {
    223         psError(__func__,"psBinaryOp should return null when out and in1 valid but in2 null.");
     223        psError(PS_ERR_UNKNOWN, true,"psBinaryOp should return null when out and in1 valid but in2 null.");
    224224        return 10;
    225225    }
     
    228228    vector4->type.dimen = PS_DIMEN_OTHER;
    229229    if ( psBinaryOp(NULL,vector4,"+",vector5) != NULL) {
    230         psError(__func__,"psBinaryOp should return null when input dimen PS_DIMEN_OTHER.");
     230        psError(PS_ERR_UNKNOWN, true,"psBinaryOp should return null when input dimen PS_DIMEN_OTHER.");
    231231        return 11;
    232232    }
     
    236236    CREATE_AND_SET_IMAGE(image10,F64,0,3,3);
    237237    if ( psBinaryOp(image10,inScalar,"+",vector4) == NULL ) {
    238         psError(__func__,"psBinaryOp should not return null when input/out dimension don't match.");
     238        psError(PS_ERR_UNKNOWN, true,"psBinaryOp should not return null when input/out dimension don't match.");
    239239        return 12;
    240240    }
  • trunk/psLib/test/dataManip/tst_psMinimize04.c

    r2204 r2273  
    237237    myPoly = psVectorFitPolynomial1D(NULL, NULL, NULL, NULL);
    238238    if ( myPoly != NULL ) {
    239         psError(__func__,"A null polynomial should have returned a null pointer.");
     239        psError(PS_ERR_UNKNOWN, true,"A null polynomial should have returned a null pointer.");
    240240        testStatus = false;
    241241    }
  • trunk/psLib/test/dataManip/tst_psMinimize04b.c

    r2204 r2273  
    4747        yErr->data.F64[i] = 1.0;
    4848    }
    49     p_psNormalizeVectorF64(x);
     49    psNormalizeVectorRange(x,0.0,1.0);
    5050
    5151    printPositiveTestHeader(stdout,
     
    113113        y->data.F64[i] = setData(x->data.F64[i]);
    114114    }
    115     p_psNormalizeVectorF64(x);
     115    psNormalizeVectorRange(x,0.0,1.0);
    116116
    117117    printPositiveTestHeader(stdout,
     
    173173        y->data.F64[i] = setData(x->data.F64[i]);
    174174    }
    175     p_psNormalizeVectorF64(x);
     175    psNormalizeVectorRange(x,0.0,1.0);
    176176
    177177    printPositiveTestHeader(stdout,
  • trunk/psLib/test/dataManip/tst_psMinimize04b_F32.c

    r2204 r2273  
    4747        yErr->data.F32[i] = 1.0;
    4848    }
    49     p_psNormalizeVector(x);
     49    psNormalizeVectorRange(x,0.0f,1.0f);
    5050
    5151    printPositiveTestHeader(stdout,
     
    113113        y->data.F32[i] = setData(x->data.F32[i]);
    114114    }
    115     p_psNormalizeVector(x);
     115    psNormalizeVectorRange(x,0.0f,1.0f);
    116116
    117117    printPositiveTestHeader(stdout,
     
    173173        y->data.F32[i] = setData(x->data.F32[i]);
    174174    }
    175     p_psNormalizeVector(x);
     175    psNormalizeVectorRange(x,0.0,1.0);
    176176
    177177    printPositiveTestHeader(stdout,
  • trunk/psLib/test/dataManip/tst_psMinimize06.c

    r2204 r2273  
    3535    if (myDeriv == NULL) {
    3636        myDeriv = psImageAlloc(myParams->n, myCoords->n, PS_TYPE_F32);
    37         psError(__func__, "myDeriv is NULL.\n");
     37        psError(PS_ERR_UNKNOWN, true, "myDeriv is NULL.\n");
    3838    }
    3939
  • trunk/psLib/test/dataManip/tst_psVectorFFT.c

    r2204 r2273  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2004-10-27 00:57:33 $
     8*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2004-11-04 01:05:00 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8585    vec2 = psVectorFFT( NULL, vec, PS_FFT_FORWARD );
    8686    if ( vec2->type.type != PS_TYPE_C32 ) {
    87         psError( __func__, "FFT didn't produce complex values?" );
     87        psError(PS_ERR_UNKNOWN,true, "FFT didn't produce complex values?" );
    8888        return 1;
    8989    }
     
    9494        if ( n == 1 || n == 99 ) {
    9595            if ( fabsf( cabsf( vec2->data.C32[ n ] ) - 50.0f ) > 0.1f ) {
    96                 psError( __func__, "FFT didn't work for vector (n=%d)", n );
     96                psError(PS_ERR_UNKNOWN,true, "FFT didn't work for vector (n=%d)", n );
    9797                return 2;
    9898            }
    9999        } else {
    100100            if ( fabsf( cabsf( vec2->data.C32[ n ] ) ) > 0.1f ) {
    101                 psError( __func__, "FFT didn't work for vector (n=%d)", n );
     101                psError(PS_ERR_UNKNOWN,true, "FFT didn't work for vector (n=%d)", n );
    102102                return 3;
    103103            }
     
    108108    vec3 = psVectorFFT( NULL, vec2, PS_FFT_REVERSE );
    109109    if ( vec3->type.type != PS_TYPE_C32 ) {
    110         psError( __func__, "FFT didn't produce complex values?" );
     110        psError(PS_ERR_UNKNOWN,true, "FFT didn't produce complex values?" );
    111111        return 4;
    112112    }
     
    115115        psF32 vecVal = crealf( vec3->data.C32[ n ] ) / 100;
    116116        if ( fabsf( vecVal - val ) > 0.1f ) {
    117             psError( __func__, "Reverse FFT didn't give me the original vector back (n=%d) (%.2f vs %.2f)",
    118                      n, vecVal, val );
     117            psError(PS_ERR_UNKNOWN,true, "Reverse FFT didn't give me the original vector back (n=%d) (%.2f vs %.2f)",
     118                    n, vecVal, val );
    119119            return 5;
    120120        }
     
    150150    vec2 = psVectorReal( vec2, vec );
    151151    if ( vec2 == NULL ) {
    152         psError( __func__, "psVectorReal returned a NULL?" );
     152        psError(PS_ERR_UNKNOWN,true, "psVectorReal returned a NULL?" );
    153153        return 1;
    154154    }
    155155    if ( vec2->type.type != PS_TYPE_F32 ) {
    156         psError( __func__, "psVectorReal returned a wrong type (%d)?",
    157                  vec2->type.type );
     156        psError(PS_ERR_UNKNOWN,true, "psVectorReal returned a wrong type (%d)?",
     157                vec2->type.type );
    158158        return 2;
    159159    }
     
    161161    vec3 = psVectorImaginary( vec3, vec );
    162162    if ( vec3 == NULL ) {
    163         psError( __func__, "psVectorImaginary returned a NULL?" );
     163        psError(PS_ERR_UNKNOWN,true, "psVectorImaginary returned a NULL?" );
    164164        return 3;
    165165    }
    166166    if ( vec3->type.type != PS_TYPE_F32 ) {
    167         psError( __func__, "psVectorImaginary returned a wrong type (%d)?",
    168                  vec3->type.type );
     167        psError(PS_ERR_UNKNOWN,true, "psVectorImaginary returned a wrong type (%d)?",
     168                vec3->type.type );
    169169        return 4;
    170170    }
     
    175175        psF32 i = ( n * 2 );
    176176        if ( fabsf( vec2->data.F32[ n ] - r ) > FLT_EPSILON ) {
    177             psError( __func__, "psVectorReal didn't return the real portion at n=%d",
    178                      n );
     177            psError(PS_ERR_UNKNOWN,true, "psVectorReal didn't return the real portion at n=%d",
     178                    n );
    179179            return 5;
    180180        }
    181181        if ( fabsf( vec3->data.F32[ n ] - i ) > FLT_EPSILON ) {
    182             psError( __func__, "psVectorImaginary didn't return the real portion at n=%d",
    183                      n );
     182            psError(PS_ERR_UNKNOWN,true, "psVectorImaginary didn't return the real portion at n=%d",
     183                    n );
    184184            return 6;
    185185        }
     
    230230    // 3. verify that the result is a psC32
    231231    if ( vec3->type.type != PS_TYPE_C32 ) {
    232         psError( __func__, "Vector Type from psVectorComplex is not complex? (%d)",
    233                  vec3->type.type );
     232        psError(PS_ERR_UNKNOWN,true, "Vector Type from psVectorComplex is not complex? (%d)",
     233                vec3->type.type );
    234234        return 1;
    235235    }
     
    240240        if ( fabsf( crealf( vec3->data.C32[ n ] ) - n ) > FLT_EPSILON ||
    241241                fabsf( cimagf( vec3->data.C32[ n ] ) - ( n * 2 ) ) > FLT_EPSILON ) {
    242             psError( __func__, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)",
    243                      n, crealf( vec3->data.C32[ n ] ), cimagf( vec3->data.C32[ n ] ) );
     242            psError(PS_ERR_UNKNOWN,true, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)",
     243                    n, crealf( vec3->data.C32[ n ] ), cimagf( vec3->data.C32[ n ] ) );
    244244            return 2;
    245245        };
     
    251251
    252252    // 7. call psVectorComplex
    253     psLogMsg( __func__, PS_LOG_INFO, "Following should be an error (type mismatch)." );
     253    psLogMsg(__func__, PS_LOG_INFO, "Following should be an error (type mismatch)." );
    254254    vec3 = psVectorComplex( vec3, vec, vec2 );
    255255    // 8. verify that an appropriate error occurred. (this partially has to be done via inspection)
    256256    if ( vec3 != NULL ) {
    257         psError( __func__, "psVectorComplex returned a vector though input types mismatched." );
     257        psError(PS_ERR_UNKNOWN,true, "psVectorComplex returned a vector though input types mismatched." );
    258258        return 3;
    259259    }
     
    267267    // 11. verify thet an appropriate error occurred. (actually, it isn't an error...)
    268268    if ( vec3->n != 100 ) {
    269         psError( __func__, "psVectorComplex returned a larger vector than the input supported (%d).", vec3->n );
     269        psError(PS_ERR_UNKNOWN,true, "psVectorComplex returned a larger vector than the input supported (%d).", vec3->n );
    270270        return 4;
    271271    }
     
    302302    // 3. verify result is psC32
    303303    if ( vec2->type.type != PS_TYPE_C32 ) {
    304         psError( __func__, "the psVectorConjugate didn't return a C32 vector" );
     304        psError(PS_ERR_UNKNOWN,true, "the psVectorConjugate didn't return a C32 vector" );
    305305        return 1;
    306306    }
     
    310310        if ( fabsf( crealf( vec->data.C32[ n ] ) - crealf( vec2->data.C32[ n ] ) ) > FLT_EPSILON ||
    311311                fabsf( cimagf( vec->data.C32[ n ] ) + cimagf( vec2->data.C32[ n ] ) ) > FLT_EPSILON ) {
    312             psError( __func__, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)",
    313                      n, crealf( vec2->data.C32[ n ] ), cimagf( vec2->data.C32[ n ] ) );
     312            psError(PS_ERR_UNKNOWN,true, "psVectorComplex result is invalid (n=%d, %.2f+%.2fi)",
     313                    n, crealf( vec2->data.C32[ n ] ), cimagf( vec2->data.C32[ n ] ) );
    314314            return 2;
    315315        };
     
    347347    // 3. verify result is psF32
    348348    if ( vec2->type.type != PS_TYPE_F32 ) {
    349         psError( __func__, "the type was not PS_TYPE_F32." );
     349        psError(PS_ERR_UNKNOWN,true, "the type was not PS_TYPE_F32." );
    350350        return 1;
    351351    }
     
    360360    val = cabsf( vec->data.C32[ 0 ] ) * cabsf( vec->data.C32[ 0 ] ) / 100 / 100;
    361361    if ( fabsf( vec2->data.F32[ 0 ] - val ) > FLT_EPSILON ) {
    362         psError( __func__, "psVectorPowerSpectrum result is invalid (n=0, %.2f %.2f)",
    363                  vec2->data.F32[ 0 ], val );
     362        psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=0, %.2f %.2f)",
     363                vec2->data.F32[ 0 ], val );
    364364        return 2;
    365365    };
     
    370370
    371371        if ( fabsf( val - vec2->data.F32[ n ] ) > FLT_EPSILON ) {
    372             psError( __func__, "psVectorPowerSpectrum result is invalid (n=%d, %.2f %.2f)",
    373                      n, vec2->data.F32[ n ], val );
     372            psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=%d, %.2f %.2f)",
     373                    n, vec2->data.F32[ n ], val );
    374374            return 2;
    375375        };
     
    378378    val = cabsf( vec->data.C32[ 50 ] ) * cabsf( vec->data.C32[ 50 ] ) / 100 / 100;
    379379    if ( fabsf( vec2->data.F32[ 50 ] - val ) > FLT_EPSILON ) {
    380         psError( __func__, "psVectorPowerSpectrum result is invalid (n=50, %.2f %.2f)",
    381                  vec2->data.F32[ 0 ], val );
     380        psError(PS_ERR_UNKNOWN,true, "psVectorPowerSpectrum result is invalid (n=50, %.2f %.2f)",
     381                vec2->data.F32[ 0 ], val );
    382382        return 2;
    383383    };
Note: See TracChangeset for help on using the changeset viewer.