Index: trunk/psLib/test/math/tap_psStats00.c
===================================================================
--- trunk/psLib/test/math/tap_psStats00.c	(revision 11656)
+++ trunk/psLib/test/math/tap_psStats00.c	(revision 12242)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-02-06 00:50:03 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-03-05 23:23:38 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
@@ -54,8 +54,8 @@
 static psF64 expectedMeanRangeNoMaskF32         =  0.137500;
 static psF64 expectedMeanRangeWithMaskF32       = -0.366667;
-static psF64 expectedWeightMeanNoMaskF32        =  1.807210;
-static psF64 expectedWeightMeanWithMaskF32      =  1.890217;
-static psF64 expectedWeightMeanNoMaskRangeF32   =  0.640952;
-static psF64 expectedWeightMeanWithMaskRangeF32 =  0.046574;
+static psF64 expectedWeightMeanNoMaskF32        =  2.020035;
+static psF64 expectedWeightMeanWithMaskF32      =  2.036018;
+static psF64 expectedWeightMeanNoMaskRangeF32   = -0.650684;
+static psF64 expectedWeightMeanWithMaskRangeF32 = -1.046423;
 
 #include <unistd.h>
@@ -69,9 +69,6 @@
     psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
     psVector *myVector = psVectorAlloc(N, PS_TYPE_F32);
-    myVector->n = N;
     psVector *myErrors = psVectorAlloc(N, PS_TYPE_F32);
-    myErrors->n = N;
     psVector *maskVector = psVectorAlloc(N, PS_TYPE_U8);
-    maskVector->n = N;
     // Set the appropriate values for the vector data.
     for (long i = 0; i < N; i++) {
@@ -85,9 +82,41 @@
     }
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
     // Call psVectorStats() with no vector mask.
     {
         psMemId id = psMemGetId();
         bool result = psVectorStats(myStats, myVector, NULL, NULL, 0);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32: no mask vector, no error vector)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4,
@@ -100,5 +129,5 @@
         psMemId id = psMemGetId();
         bool result = psVectorStats(myStats, myVector, myErrors, NULL, 0);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32: no mask vector, with error vector)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskF32);
@@ -113,5 +142,5 @@
         myStats->max =   8.0;
         bool result = psVectorStats(myStats, myVector, NULL, NULL, 0);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32, no mask, no errors, with data range)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanRangeNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeNoMaskF32);
@@ -125,5 +154,5 @@
         myStats->options = PS_STAT_SAMPLE_MEAN | PS_STAT_USE_RANGE;
         bool result = psVectorStats(myStats, myVector, myErrors, NULL, 0);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32, no mask, with errors and data range)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedWeightMeanNoMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanNoMaskRangeF32);
@@ -136,5 +165,5 @@
         myStats->options = PS_STAT_SAMPLE_MEAN;
         bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32, with mask, no errors)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32);
@@ -146,5 +175,5 @@
         psMemId id = psMemGetId();
         bool result = psVectorStats(myStats, myVector, myErrors, maskVector, 1);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32, with mask and errors)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskF32);
@@ -157,5 +186,5 @@
         myStats->options = PS_STAT_SAMPLE_MEAN | PS_STAT_USE_RANGE;
         bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32, with mask and data range)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanRangeWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanRangeWithMaskF32);
@@ -167,5 +196,5 @@
         psMemId id = psMemGetId();
         bool result = psVectorStats(myStats, myVector, myErrors, maskVector, 1);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32, withmask, errors, and data range)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedWeightMeanWithMaskRangeF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedWeightMeanWithMaskRangeF32);
@@ -183,5 +212,5 @@
         }
         bool result = psVectorStats(myStats, myVector, NULL, maskVector, 2);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32, with mask = 2, no errors)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanWithMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanWithMaskF32);
@@ -199,5 +228,5 @@
         }
         bool result = psVectorStats(myStats, myVector, NULL, maskVector, 4);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F32, with mask = 3, no errors)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF32, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF32);
@@ -205,5 +234,5 @@
     }
 
-    // Mask all values and verify return is NAN
+    // Mask all values and verify return is FALSE
     {
         psMemId id = psMemGetId();
@@ -213,5 +242,5 @@
         }
         bool result = psVectorStats(myStats, myVector, NULL, maskVector, 1);
-        ok(result, "psVectorStats suceeded");
+        ok(result == false, "psVectorStats suceeded (All values masked)");
         ok(isnan(myStats->sampleMean), "psVectorStats() returned NAN");
         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
@@ -245,5 +274,5 @@
 
         bool result = psVectorStats(myStats, myVector, NULL, NULL, 0);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (S8, no mask, no errors)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanNoMaskS8, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskS8);
@@ -266,5 +295,5 @@
 
         bool result = psVectorStats(myStats, myVector, NULL, NULL, 0);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (U16, no mask, no errors)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanNoMaskU16, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskU16);
@@ -286,5 +315,5 @@
 
         bool result = psVectorStats(myStats, myVector, NULL, NULL, 0);
-        ok(result, "psVectorStats suceeded");
+        ok(result, "psVectorStats suceeded (F64, no mask, no errors)");
         ok(!isnan(myStats->sampleMean), "psVectorStats() returned non-NAN");
         ok_float_tol(myStats->sampleMean, expectedMeanNoMaskF64, 1e-4, "The mean was %f, should be %f", myStats->sampleMean, expectedMeanNoMaskF64);
