Fixed problem reading long string continuation records.
[pspp-builds.git] / tests / command / no_case_size.sh
1 #!/bin/sh
2
3 # This program tests that system files can be read properly, even when the 
4 # case_size header value is -1 (Some 3rd party products do this)
5
6
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
9
10 here=`pwd`;
11
12 # ensure that top_srcdir is absolute
13 cd $top_srcdir; top_srcdir=`pwd`
14
15 export STAT_CONFIG_PATH=$top_srcdir/config
16
17
18 cleanup()
19 {
20      if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then 
21         echo "NOT cleaning $TEMPDIR"
22         return ; 
23      fi
24      rm -rf $TEMPDIR
25 }
26
27
28 fail()
29 {
30     echo $activity
31     echo FAILED
32     cleanup;
33     exit 1;
34 }
35
36
37 no_result()
38 {
39     echo $activity
40     echo NO RESULT;
41     cleanup;
42     exit 2;
43 }
44
45 pass()
46 {
47     cleanup;
48     exit 0;
49 }
50
51 mkdir -p $TEMPDIR
52
53 cd $TEMPDIR
54
55 activity="create program"
56 cat <<EOF > $TESTFILE
57 GET FILE='$top_srcdir/tests/no_case_size.sav'.
58 DISPLAY DICTIONARY.
59 LIST.
60 EOF
61 if [ $? -ne 0 ] ; then no_result ; fi
62
63
64 activity="run program"
65 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
66 if [ $? -ne 0 ] ; then no_result ; fi
67
68 activity="compare output"
69 diff -b -B -w pspp.list - <<EOF
70 1.1 DISPLAY.  
71 +--------+-------------------------------------------+--------+
72 |Variable|Description                                |Position|
73 #========#===========================================#========#
74 |CONT    |continents of the world                    |       1|
75 |        |Format: A32                                |        |
76 +--------+-------------------------------------------+--------+
77 |SIZE    |sq km                                      |       2|
78 |        |Format: F8.2                               |        |
79 +--------+-------------------------------------------+--------+
80 |POP     |population                                 |       3|
81 |        |Format: F8.2                               |        |
82 +--------+-------------------------------------------+--------+
83 |COUNT   |number of countries                        |       4|
84 |        |Format: F8.2                               |        |
85 +--------+-------------------------------------------+--------+
86
87                             CONT     SIZE      POP    COUNT
88 -------------------------------- -------- -------- --------
89 Asia                             44579000 3.67E+09    44.00 
90 Africa                           30065000 7.78E+08    53.00 
91 North America                    24256000 4.83E+08    23.00 
92 South America                    17819000 3.42E+08    12.00 
93 Antarctica                       13209000      .00      .00 
94 Europe                            9938000 7.32E+08    46.00 
95 Australia/Oceania                 7687000 31000000    14.00 
96
97 EOF
98 if [ $? -ne 0 ] ; then fail ; fi
99
100
101 pass;