+Fri Apr 9 20:04:49 2004 Ben Pfaff <blp@gnu.org>
+
+ * descript.c (calc_descriptives): Fix assert failure when only
+ MOMENT_MEAN is needed.
+
2004-04-09 Michael Kiefte <mkiefte@dal.ca>
* descript.c:
continue;
}
- if (dv->moments != NULL)
- moments_pass_one (dv->moments, x, weight);
+ if (dv->moments != NULL)
+ {
+ if (dsc->max_moment > MOMENT_MEAN)
+ moments_pass_one (dv->moments, x, weight);
+ else
+ moments_pass_two (dv->moments, x, weight);
+ }
+
if (x < dv->min)
dv->min = x;
if (x > dv->max)
+Fri Apr 9 20:03:33 2004 Ben Pfaff <blp@gnu.org>
+
+ * Makefile.am: (TESTS) Add stats/descript-mean-bug.sh.
+
+ * stats/descript-mean-bug.sh: Add test for a bug where
+ DESCRIPTIVES asking only for the mean assert-failed.
+
Sat Apr 3 11:42:31 2004 Ben Pfaff <blp@gnu.org>
* Makefile.am: (TESTS) Add bugs/comment-at-eof.sh. Alphabetize
xforms/expressions.sh \
stats/descript-basic.sh \
stats/descript-missing.sh \
+ stats/descript-mean-bug.sh \
stats/moments.sh \
stats/percentiles-compatible.sh \
stats/percentiles-enhanced.sh
--- /dev/null
+#!/bin/sh
+
+# This program tests that DESCRIPTIVES asking for a mean only works,
+# which didn't at one point.
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+activity="create program"
+cat > $TEMPDIR/descript.stat <<EOF
+data list notable / x 1.
+begin data.
+0
+1
+2
+3
+4
+5
+end data.
+
+descript all/stat=mean.
+
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+activity="run program"
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/descript.stat
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="compare output"
+diff -B -b $TEMPDIR/pspp.list - <<EOF
+1.1 DESCRIPTIVES. Valid cases = 6; cases with missing value(s) = 0.
++--------#-+-----+
+|Variable#N| Mean|
+#========#=#=====#
+|X #6|2.500|
++--------#-+-----+
+EOF
+if [ $? -ne 0 ] ; then fail ; fi
+
+
+pass