IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 23, 2005, 2:19:51 PM (21 years ago)
Author:
desonia
Message:

changed psMatrix tests so that functions return NULL on error.

File:
1 edited

Legend:

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

    r3264 r3313  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    16  *  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-02-17 19:26:25 $
     16 *  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2005-02-24 00:19:51 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    148148    printFooter(stdout, "psMatrix", "Calculate LU matrix", true);
    149149
    150 
    151150    // Test C - Determine solution to matrix equation
    152151    printPositiveTestHeader(stdout, "psMatrix", "Determine solution to matrix equation");
     
    208207    psVector *vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
    209208    psVector *permBad = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
     209    imageTest = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64);
    210210    psMatrixLUSolve(vectorBadOut, imageTest, vectorBad, permBad);
    211211    printFooter(stdout, "psMatrix", "Attempt to use null input vector argument", true);
     
    215215    printNegativeTestHeader(stdout,"psMatrix", "Attempt to use null LU image argument",
    216216                            "Invalid operation: inImage or its data is NULL.", 0);
     217    vectorBadOut = (psVector*)psVectorAlloc(3, PS_TYPE_F64);
    217218    psMatrixLUSolve(vectorBadOut, NULL, vectorBad, permBad);
    218219    printFooter(stdout, "psMatrix", "Attempt to use null LU image argument", true);
    219220
     221    psFree(permBad);
     222    psFree(imageTest);
     223
     224    if( psMemCheckLeaks(0, NULL, stdout, false) ) {
     225        psError(PS_ERR_UNKNOWN,true,"Memory leaks detected");
     226        return 10;
     227    }
     228    nBad = psMemCheckCorruption(0);
     229    if(nBad) {
     230        printf("ERROR: Found %d bad memory blocks\n", nBad);
     231    }
     232
    220233    return 0;
    221234}
Note: See TracChangeset for help on using the changeset viewer.