Changeset 678 for trunk/psLib/test/dataManip/tst_psStats00.c
- Timestamp:
- May 13, 2004, 3:12:32 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/dataManip/tst_psStats00.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psStats00.c
r660 r678 14 14 int testStatus = true; 15 15 int i = 0; 16 psType dummyFloatType;17 psType dummyIntType;18 16 psVector *myVector = NULL; 19 17 psVector *maskVector= NULL; … … 25 23 printPositiveTestHeader(stdout, 26 24 "psStats functions", 27 " hmmm");25 "PS_STAT_SAMPLE_MEAN"); 28 26 29 27 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); 35 29 myVector->n = N; 36 maskVector = psVectorAlloc( dummyIntType, N);30 maskVector = psVectorAlloc(PS_TYPE_UINT8, N); 37 31 maskVector->n = N; 38 32 … … 42 36 myVector->vec.f[i] = (float) i; 43 37 if (i < (N/2)) { 44 maskVector->vec. i[i] = 0;38 maskVector->vec.ui8[i] = 0; 45 39 realMean2+= myVector->vec.f[i]; 46 40 count++; 47 41 } else { 48 42 printf("Masking element %d\n", i); 49 maskVector->vec. i[i] = 1;43 maskVector->vec.ui8[i] = 1; 50 44 } 51 45 realMean1+= myVector->vec.f[i]; … … 69 63 printf("Called psArrayStats() on a vector with last N/2 elements masked.\n"); 70 64 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 } 71 70 72 71 printFooter(stdout,
Note:
See TracChangeset
for help on using the changeset viewer.
