IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 678 for trunk/psLib


Ignore:
Timestamp:
May 13, 2004, 3:12:32 PM (22 years ago)
Author:
gusciora
Message:

...

Location:
trunk/psLib/test/dataManip
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/dataManip/Makefile

    r657 r678  
    33##  Makefile:   test/sysUtils
    44##
    5 ##  $Revision: 1.2 $  $Name: not supported by cvs2svn $
    6 ##  $Date: 2004-05-13 06:06:34 $
     5##  $Revision: 1.3 $  $Name: not supported by cvs2svn $
     6##  $Date: 2004-05-14 01:12:32 $
    77##
    88##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1616PSLIB_LIB_DIR = ../../lib
    1717
    18 TARGET = tst_psStats00
     18TARGET = tst_psStats00 \
     19         tst_psStats01 \
     20         tst_psStats02
    1921
    2022all: $(TARGET)
    2123
    2224tst_psStats00:          tst_psStats00.o
     25tst_psStats01:          tst_psStats01.o
     26tst_psStats02:          tst_psStats02.o
    2327
    2428clean:
  • trunk/psLib/test/dataManip/tst_psStats00.c

    r660 r678  
    1414    int testStatus      = true;
    1515    int i               = 0;
    16     psType dummyFloatType;
    17     psType dummyIntType;
    1816    psVector *myVector  = NULL;
    1917    psVector *maskVector= NULL;
     
    2523    printPositiveTestHeader(stdout,
    2624                            "psStats functions",
    27                             "hmmm");
     25                            "PS_STAT_SAMPLE_MEAN");
    2826
    2927    myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
    30     dummyFloatType.type = PS_TYPE_FLOAT;
    31     dummyFloatType.dimen = PS_DIMEN_VECTOR;
    32     dummyIntType.type = PS_TYPE_INT;
    33     dummyIntType.dimen = PS_DIMEN_VECTOR;
    34     myVector = psVectorAlloc(dummyFloatType, N);
     28    myVector = psVectorAlloc(PS_TYPE_FLOAT, N);
    3529    myVector->n = N;
    36     maskVector = psVectorAlloc(dummyIntType, N);
     30    maskVector = psVectorAlloc(PS_TYPE_UINT8, N);
    3731    maskVector->n = N;
    3832
     
    4236        myVector->vec.f[i] = (float) i;
    4337        if (i < (N/2)) {
    44             maskVector->vec.i[i] = 0;
     38            maskVector->vec.ui8[i] = 0;
    4539            realMean2+= myVector->vec.f[i];
    4640            count++;
    4741        } else {
    4842            printf("Masking element %d\n", i);
    49             maskVector->vec.i[i] = 1;
     43            maskVector->vec.ui8[i] = 1;
    5044        }
    5145        realMean1+= myVector->vec.f[i];
     
    6963    printf("Called psArrayStats() on a vector with last N/2 elements masked.\n");
    7064    printf("The expected mean was %f; the calculated mean was %f\n", realMean2, mean);
     65    if (mean == realMean2) {
     66        testStatus = true;
     67    } else {
     68        testStatus = false;
     69    }
    7170
    7271    printFooter(stdout,
Note: See TracChangeset for help on using the changeset viewer.