IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2005, 4:32:00 PM (21 years ago)
Author:
drobbin
Message:

Added psVectorGet/Set and tests. Added prototype for psImageCountPixelMask.

Location:
trunk/psLib/test/mathtypes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/mathtypes/tst_psVector.c

    r5087 r5089  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    16  *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-09-21 21:37:21 $
     16 *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2005-09-22 02:32:00 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2929static psS32 testVectorInit(void);
    3030static psS32 testVectorCreate(void);
     31static psS32 testVectorGetSet(void);
    3132
    3233testDescription tests[] = {
     
    3637                              {testVectorInit,-4,"psVectorInit",0,false},
    3738                              {testVectorCreate,-5,"psVectorCreate",0,false},
     39                              {testVectorGetSet,-6,"psVectorGet/Set",0,false},
    3840                              {NULL}
    3941                          };
     
    364366    psVector *test = NULL;
    365367    psVector *test2 = NULL;
    366 
    367     test = psVectorCreate(0.0, 10.0, 1.0, PS_TYPE_S32);
    368     test2 = psVectorCreate(0.0, 5.0, 0.5, PS_TYPE_F32);
     368    psVector *input = NULL;
     369    psVector *input2 = psVectorAlloc(5, PS_TYPE_F64);
     370
     371    test = psVectorCreate(input, 0.0, 10.0, 1.0, PS_TYPE_S32);
     372    test2 = psVectorCreate(input2, 0.0, 5.0, 0.5, PS_TYPE_F32);
    369373
    370374    for (int i = 0; i < 10; i++) {
     
    383387}
    384388
     389psS32 testVectorGetSet(void)
     390{
     391    psVector *vec = NULL;
     392    vec = psVectorAlloc(5, PS_TYPE_S32);
     393
     394    if ( !psVectorSet(vec, 0, 10) )
     395        fprintf(stderr, "VectorSet failed to set S32 at position 0\n");
     396    if ( psVectorSet(vec, 10, 10) )
     397        fprintf(stderr, "VectorSet Improperly set S32 at out of range position\n");
     398    if ( !psVectorSet(vec, -1, 4) )
     399        fprintf(stderr, "VectorSet Failed to set S32 at position 4\n");
     400    if ( (psS32)psVectorGet(vec, 0) != 10 )
     401        fprintf(stderr, "VectorGet Failed to return the correct S32 from position 0\n");
     402    if ( (psS32)psVectorGet(vec, -1) != 4 )
     403        fprintf(stderr, "VectorGet Failed to return the correct S32 from tail using -1\n");
     404
     405    psFree(vec);
     406    return 0;
     407}
     408
     409
     410
  • trunk/psLib/test/mathtypes/verified/tst_psVector.stderr

    r5087 r5089  
    5858---> TESTPOINT PASSED (psVector{psVectorCreate} | tst_psVector.c)
    5959
     60/***************************** TESTPOINT ******************************************\
     61*             TestFile: tst_psVector.c                                             *
     62*            TestPoint: psVector{psVectorGet/Set}                                  *
     63*             TestType: Positive                                                   *
     64\**********************************************************************************/
     65
     66
     67---> TESTPOINT PASSED (psVector{psVectorGet/Set} | tst_psVector.c)
     68
Note: See TracChangeset for help on using the changeset viewer.