#include "libpspp/misc.h"
#include "libpspp/hmap.h"
#include "data/value.h"
+#include "data/val-type.h"
#include <gl/xalloc.h>
#include <assert.h>
double numerator = 0.0;
double nn = 0.0;
- if ( nl->pass == 3 )
- {
- nl->pass = 4;
- }
- assert (nl->pass == 4);
+ /* The Levene calculation requires three passes.
+ Normally this should have been done prior to calling this function.
+ However, in abnormal circumstances (eg. the dataset is empty) there
+ will have been no passes.
+ */
+ assert (nl->pass == 0 || nl->pass == 3);
+
+ if ( nl->pass == 0 )
+ return SYSMIS;
nl->denominator *= hmap_count (&nl->hmap) - 1;
])
AT_CLEANUP
+
+
+dnl Tests for a bug assert failed when the group variables were not of either class
+AT_SETUP([T-TEST wrong group])
+AT_DATA([t-test-crs.sps], [dnl
+data list list /x * g *.
+begin data.
+1 2
+2 2
+3 2
+4 2
+5 2
+end data.
+
+t-test /variables = x group=g(1,3).
+])
+
+AT_CHECK([pspp t-test-crs.sps], [0],[ignore], [ignore])
+
+AT_CLEANUP