IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.