Changeset 678 for trunk/psLib
- Timestamp:
- May 13, 2004, 3:12:32 PM (22 years ago)
- Location:
- trunk/psLib/test/dataManip
- Files:
-
- 2 added
- 2 edited
-
Makefile (modified) (2 diffs)
-
tst_psStats00.c (modified) (4 diffs)
-
tst_psStats01.c (added)
-
tst_psStats02.c (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/Makefile
r657 r678 3 3 ## Makefile: test/sysUtils 4 4 ## 5 ## $Revision: 1. 2$ $Name: not supported by cvs2svn $6 ## $Date: 2004-05-1 3 06:06:34$5 ## $Revision: 1.3 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-05-14 01:12:32 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 16 16 PSLIB_LIB_DIR = ../../lib 17 17 18 TARGET = tst_psStats00 18 TARGET = tst_psStats00 \ 19 tst_psStats01 \ 20 tst_psStats02 19 21 20 22 all: $(TARGET) 21 23 22 24 tst_psStats00: tst_psStats00.o 25 tst_psStats01: tst_psStats01.o 26 tst_psStats02: tst_psStats02.o 23 27 24 28 clean: -
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.
