IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2005, 11:37:21 AM (21 years ago)
Author:
drobbin
Message:

Updated/added psTimer fxns and psVectorCreate (and tests)

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

Legend:

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

    r4887 r5087  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    16  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-08-26 23:01:17 $
     16 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2005-09-21 21:37:21 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828static psS32 testVectorExtend(void);
    2929static psS32 testVectorInit(void);
     30static psS32 testVectorCreate(void);
    3031
    3132testDescription tests[] = {
     
    3435                              {testVectorExtend,-3,"psVectorExtend",0,false},
    3536                              {testVectorInit,-4,"psVectorInit",0,false},
     37                              {testVectorCreate,-5,"psVectorCreate",0,false},
    3638                              {NULL}
    3739                          };
     
    357359    return 0;
    358360}
     361
     362psS32 testVectorCreate(void)
     363{
     364    psVector *test = NULL;
     365    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);
     369
     370    for (int i = 0; i < 10; i++) {
     371        if (test->data.S32[i] != i) {
     372            fprintf(stderr, "Vector data does not match. i = %d, data=%d\n", i, test->data.S32[i]);
     373            return 1;
     374        }
     375        if (test2->data.F32[i] != i*0.5) {
     376            fprintf(stderr, "Vector data does not match. i = %d, data=%f\n", i, test->data.F32[i]);
     377            return 1;
     378        }
     379    }
     380    psFree(test);
     381    psFree(test2);
     382    return 0;
     383}
     384
  • trunk/psLib/test/mathtypes/verified/tst_psVector.stderr

    r4887 r5087  
    4949---> TESTPOINT PASSED (psVector{psVectorInit} | tst_psVector.c)
    5050
     51/***************************** TESTPOINT ******************************************\
     52*             TestFile: tst_psVector.c                                             *
     53*            TestPoint: psVector{psVectorCreate}                                   *
     54*             TestType: Positive                                                   *
     55\**********************************************************************************/
     56
     57
     58---> TESTPOINT PASSED (psVector{psVectorCreate} | tst_psVector.c)
     59
Note: See TracChangeset for help on using the changeset viewer.