+Mon May 9 07:14:29 WST 2005 John Darrington <john@darrington.wattle.id.au>
+
+ * sysfile-info.c: Fixed bug [# 13024 ]
+
Sun May 8 13:52:12 2005 Ben Pfaff <blp@gnu.org>
"Fix" PR 13021 by disabling FILE TYPE. Eventually, we should
AS_VECTOR
};
-int describe_variable (struct variable *v, struct tab_table *t, int r, int as);
+static int describe_variable (struct variable *v, struct tab_table *t, int r, int as);
/* Sets the widths of all the columns and heights of all the rows in
table T for driver D. */
tab_submit (t);
nr = 1 + 2 * dict_get_var_cnt (d);
+
t = tab_create (4, nr, 1);
tab_dim (t, sysfile_info_dim);
tab_headers (t, 0, 0, 1, 0);
for (r = 1, i = 0; i < dict_get_var_cnt (d); i++)
{
struct variable *v = dict_get_var (d, i);
- int nvl = val_labs_count (v->val_labs);
+ const int nvl = val_labs_count (v->val_labs);
if (r + 10 + nvl > nr)
{
r = describe_variable (v, t, r, AS_DICTIONARY);
}
+
tab_box (t, TAL_1, TAL_1, -1, -1, 0, 0, 3, r);
- tab_vline (t, TAL_1, 0, 0, r);
tab_vline (t, TAL_1, 1, 0, r);
tab_vline (t, TAL_1, 3, 0, r);
+
tab_resize (t, -1, r);
tab_flags (t, SOMF_NO_TITLE);
tab_submit (t);
/* Puts a description of variable V into table T starting at row R.
The variable will be described in the format AS. Returns the next
row available for use in the table. */
-int
+static int
describe_variable (struct variable *v, struct tab_table *t, int r, int as)
{
/* Put the name, var label, and position into the first row. */
free (vl);
}
+
+
+
+
+
+
+
+
+
+
+
command/sort.sh \
command/sysfiles.sh \
command/sysfiles-old.sh \
+ command/sysfile-info.sh \
command/split-file.sh \
command/t-test-1-indep-val.sh \
command/t-test-1-sample-missing-anal.sh \
--- /dev/null
+#!/bin/sh
+
+# This program tests that SYSFILE INFO works.
+
+TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
+ echo "NOT cleaning $TEMPDIR"
+ return ;
+ fi
+ 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 test file"
+cat > $TESTFILE << EOF
+DATA LIST LIST /x * name (a10) .
+BEGIN DATA
+1 one
+2 two
+3 three
+END DATA.
+SAVE OUTFILE='pro.sav'.
+
+sysfile info file='pro.sav'.
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+activity="run program"
+$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="filter output"
+grep -v '^Created: ' $TEMPDIR/pspp.list > $TEMPDIR/out-filtered
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="compare output"
+diff $TEMPDIR/out-filtered - << EOF
+1.1 DATA LIST. Reading free-form data from the command file.
++--------+------+
+|Variable|Format|
+#========#======#
+|x |F8.0 |
+|name |A10 |
++--------+------+
+
+2.1 SYSFILE INFO.
+File: pro.sav
+Label: No label.
+Endian: Little.
+Variables: 2
+Cases: 3
+Type: System File.
+Weight: Not weighted.
+Mode: Compression off.
+
++--------+-------------+---+
+|Variable|Description |Pos|
+| | |iti|
+| | |on |
+#========#=============#===#
+|x |Format: F8.2 | 1|
++--------+-------------+---+
+|name |Format: A10 | 2|
++--------+-------------+---+
+
+EOF
+if [ $? -ne 0 ] ; then fail ; fi
+
+pass;
# This program tests ....
TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
here=`pwd`;
cleanup()
{
+ if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
+ echo "NOT cleaning $TEMPDIR"
+ return ;
+ fi
rm -rf $TEMPDIR
}
cd $TEMPDIR
put test set up here ...
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="run program"
+$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
if [ $? -ne 0 ] ; then no_result ; fi
+
put test here
if [ $? -ne 0 ] ; then fail ; fi