{
char buf[100];
if ( !ch )
- return ;
+ return ;
pl_savestate_r(ch->lp);
struct chart *ch;
- bins = gsl_histogram_bins(hist);
-
ch = chart_create();
chart_write_title(ch, _("HISTOGRAM"));
chart_write_ylabel(ch, _("Frequency"));
chart_write_xlabel(ch, factorname);
+ if ( ! hist ) /* If this happens, probably all values are SYSMIS */
+ {
+ chart_submit(ch);
+ return ;
+ }
+ else
+ {
+ bins = gsl_histogram_bins(hist);
+ }
+
chart_write_yscale(ch, 0, gsl_histogram_max_val(hist), 5);
for ( i = 0 ; i < bins ; ++i )
bugs/double-frequency.sh \
bugs/get.sh \
bugs/examine-1sample.sh \
+ bugs/examine-missing.sh \
bugs/get-no-file.sh \
bugs/html-frequency.sh \
bugs/if_crash.sh \
--- /dev/null
+#!/bin/sh
+
+# This program tests for a bug which caused EXAMINE to
+# crash if all its values were SYSMIS
+
+
+TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+STAT_CONFIG_PATH=$top_srcdir/config
+export STAT_CONFIG_PATH
+
+
+cleanup()
+{
+ cd /
+ 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 > $TESTFILE <<EOF
+DATA LIST LIST /x *.
+BEGIN DATA.
+.
+.
+.
+.
+END DATA.
+
+EXAMINE /x PLOT=HISTOGRAM.
+
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="run program"
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE > /dev/null
+if [ $? -ne 0 ] ; then fail ; fi
+
+pass;