IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 12, 2004, 9:18:20 AM (22 years ago)
Author:
evanalst
Message:

Add addtional test cases to psBinaryOp.

File:
1 edited

Legend:

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

    r2021 r2053  
    1515 *  @author  Ross Harman, MHPCC
    1616 *
    17  *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
    18  *  @date  $Date: 2004-10-08 02:48:01 $
     17 *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
     18 *  @date  $Date: 2004-10-12 19:18:20 $
    1919 *
    2020 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    214214    printFooter(stdout, "psMatrixVectorArithmetic", "Invalid operation", true);
    215215
     216    // Invalid parameter in2
     217    printNegativeTestHeader(stdout,"psMatrixVectorArithmetic","Invalid input",
     218                            "Invalid operation", 0);
     219    CREATE_AND_SET_VECTOR(vector4,F64,0,3);
     220    CREATE_AND_SET_VECTOR(vector5,F64,0,3);
     221    CREATE_AND_SET_VECTOR(vector6,F64,0,3);
     222    if ( psBinaryOp(vector6,vector4,"+",NULL) != NULL ) {
     223        psError(__func__,"psBinaryOp should return null when out and in1 valid but in2 null.");
     224        return 10;
     225    }
     226    printFooter(stdout, "psMatrixVectorArithmetic", "Invalid input", true);
     227
     228    vector4->type.dimen = PS_DIMEN_OTHER;
     229    if ( psBinaryOp(NULL,vector4,"+",vector5) != NULL) {
     230        psError(__func__,"psBinaryOp should return null when input dimen PS_DIMEN_OTHER.");
     231        return 11;
     232    }
     233    vector4->type.dimen = PS_DIMEN_VECTOR;
     234
     235    psScalar* inScalar = psScalarAlloc(0,PS_TYPE_F64);
     236    CREATE_AND_SET_IMAGE(image10,F64,0,3,3);
     237    if ( psBinaryOp(image10,inScalar,"+",vector4) == NULL ) {
     238        psError(__func__,"psBinaryOp should not return null when input/out dimension don't match.");
     239        return 12;
     240    }
     241
     242    psFree(vector4);
     243    psFree(vector5);
     244
    216245    return 0;
    217246}
Note: See TracChangeset for help on using the changeset viewer.