1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([system file reader - positive])
19 m4_divert_text([PREPARE_TESTS], [dnl
21 local endian=$1 file=$2 dir=$(pwd)
22 $(which sack) "$1" "$2" > expected.sav || return 1
23 (cd $top_srcdir/rust && cargo test --test sack -- "$endian" "$dir/$file" "$dir/actual.sav" >/dev/null 2>&1) || return 1
24 diff -u <(hd expected.sav) <(hd actual.sav) || return 1
29 AT_SETUP([variable labels and missing values])
30 AT_KEYWORDS([sack synthetic system file positive])
31 AT_DATA([sys-file.sack], [dnl
33 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
35 28; dnl Nominal case size
40 "01 Jan 11"; "20:53:52";
41 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
44 dnl Numeric variable, no label or missing values.
45 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
47 dnl Numeric variable, variable label.
48 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
49 32; "Numeric variable 2's label ("; i8 249; i8 250; i8 251; ")";
51 dnl Numeric variable, one missing value.
52 2; 0; 0; 1; 0x050800 *2; s8 "NUM3";
55 dnl Numeric variable, variable label and missing value.
56 2; 0; 1; 1; 0x050800 *2; s8 "NUM4";
57 30; "Another numeric variable label"; i8 0 * 2;
60 dnl Numeric variable, two missing values.
61 2; 0; 0; 2; 0x050800 *2; s8 "NUM5"; 1.0; 2.0;
63 dnl Numeric variable, three missing values.
64 2; 0; 0; 3; 0x050800 *2; s8 "NUM6"; 1.0; 2.0; 3.0;
66 dnl Numeric variable, range of missing values.
67 2; 0; 0; -2; 0x050800 *2; s8 "NUM7"; 1.0; 3.0;
69 dnl Numeric variables, range of missing values plus discrete value.
70 2; 0; 0; -3; 0x050800 *2; s8 "NUM8"; 1.0; 3.0; 5.0;
71 2; 0; 0; -3; 0x050800 *2; s8 "NUM9"; 1.0; HIGHEST; -5.0;
72 2; 0; 0; -3; 0x050800 *2; "NUM"; i8 192; i8 200; i8 204; i8 209; i8 210;
75 dnl String variable, no label or missing values.
76 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
78 dnl String variable, variable label.
79 2; 4; 1; 0; 0x010400 *2; s8 "STR2";
80 25; "String variable 2's label"; i8 0 * 3;
82 dnl String variable, one missing value.
83 2; 4; 0; 1; 0x010400 *2; s8 "STR3"; s8 "MISS";
85 dnl String variable, variable label and missing value.
86 2; 4; 1; 1; 0x010400 *2; s8 "STR4";
87 29; "Another string variable label"; i8 0 * 3;
90 dnl String variable, two missing values.
91 2; 4; 0; 2; 0x010400 *2; s8 "STR5"; s8 "MISS"; s8 "OTHR";
93 dnl String variable, three missing values.
94 2; 4; 0; 3; 0x010400 *2; s8 "STR6"; s8 "MISS"; s8 "OTHR"; s8 "MORE";
96 dnl Long string variable, one missing value.
97 dnl (This is not how SPSS represents missing values for long strings--it
98 dnl uses a separate record as shown later below--but old versions of PSPP
99 dnl did use this representation so we continue supporting it for backward
101 2; 11; 0; 1; 0x010b00 *2; s8 "STR7"; "first8by";
102 2; -1; 0; 0; 0; 0; s8 "";
104 dnl Long string variables that will have missing values added with a
106 2; 9; 0; 0; 0x010900 *2; s8 "STR8";
107 2; -1; 0; 0; 0; 0; s8 "";
108 2; 10; 0; 0; 0x010a00 *2; s8 "STR9";
109 2; -1; 0; 0; 0; 0; s8 "";
110 2; 11; 0; 0; 0x010b00 *2; s8 "STR10";
111 2; -1; 0; 0; 0; 0; s8 "";
113 dnl Long string variable, value label.
114 2; 25; 1; 0; 0x011900 *2; s8 "STR11"; 14; "25-byte string"; i8 0 * 2;
115 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
116 dnl Variable label fields on continuation records have been spotted in system
117 dnl files created by "SPSS Power Macintosh Release 6.1".
118 2; -1; 1; 0; 0; 0; s8 ""; 20; "dummy variable label";
120 dnl Machine integer info record.
121 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
123 dnl Machine floating-point info record.
124 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
126 dnl Long string variable missing values record.
128 dnl One missing value for STR8.
129 COUNT("STR8"); i8 1; 8; "abcdefgh";
131 dnl Two missing values for STR9.
132 COUNT("STR9"); i8 2; 8; "abcdefgh"; "01234567";
134 dnl Three missing values for STR9.
135 COUNT("STR10"); i8 3; 8; "abcdefgh"; "01234567"; "0 ";
138 dnl Character encoding record.
139 7; 20; 1; 12; "windows-1252";
141 dnl Dictionary termination record.
145 1.0; 2.0; 3.0; 4.0; 5.0; 6.0; 7.0; 8.0; 9.0; 10.0;
146 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
147 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
148 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
150 for variant in be le; do
151 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
152 AT_DATA([sys-file.sps], [dnl
153 GET FILE='sys-file.sav'.
158 AT_CHECK([pspp -o pspp.csv sys-file.sps])
159 AT_CHECK([cat pspp.csv], [0], [dnl
161 Label,PSPP synthetic test file: ôõöø
164 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
165 num1,1,,Unknown,Input,8,Right,F8.0,F8.0,
166 num2,2,Numeric variable 2's label (ùúû),Unknown,Input,8,Right,F8.0,F8.0,
167 num3,3,,Unknown,Input,8,Right,F8.0,F8.0,1
168 num4,4,Another numeric variable label,Unknown,Input,8,Right,F8.0,F8.0,1
169 num5,5,,Unknown,Input,8,Right,F8.0,F8.0,1; 2
170 num6,6,,Unknown,Input,8,Right,F8.0,F8.0,1; 2; 3
171 num7,7,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU 3
172 num8,8,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU 3; 5
173 num9,9,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU HIGHEST; -5
174 numàèìñò,10,,Unknown,Input,8,Right,F8.0,F8.0,LOWEST THRU 1; 5
175 str1,11,,Nominal,Input,4,Left,A4,A4,
176 str2,12,String variable 2's label,Nominal,Input,4,Left,A4,A4,
177 str3,13,,Nominal,Input,4,Left,A4,A4,"""MISS"""
178 str4,14,Another string variable label,Nominal,Input,4,Left,A4,A4,"""OTHR"""
179 str5,15,,Nominal,Input,4,Left,A4,A4,"""MISS""; ""OTHR"""
180 str6,16,,Nominal,Input,4,Left,A4,A4,"""MISS""; ""OTHR""; ""MORE"""
181 str7,17,,Nominal,Input,11,Left,A11,A11,"""first8by"""
182 str8,18,,Nominal,Input,9,Left,A9,A9,"""abcdefgh"""
183 str9,19,,Nominal,Input,10,Left,A10,A10,"""abcdefgh""; ""01234567"""
184 str10,20,,Nominal,Input,11,Left,A11,A11,"""abcdefgh""; ""01234567""; ""0 """
185 str11,21,25-byte string,Nominal,Input,25,Left,A25,A25,
188 num1,num2,num3,num4,num5,num6,num7,num8,num9,numàèìñò,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11
189 1,2,3,4,5,6,7,8,9,10,abcd,efgh,ijkl,mnop,qrst,uvwx,yzABCDEFGHI,JKLMNOPQR,STUVWXYZ01,23456789abc,defghijklmnopqstuvwxyzABC
194 AT_SETUP([unspecified number of variable positions])
195 AT_KEYWORDS([sack synthetic system file positive])
196 AT_DATA([sys-file.sack], [dnl
198 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
200 -1; dnl Nominal case size (unspecified)
201 0; dnl Not compressed
205 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
208 dnl Numeric variable, no label or missing values.
209 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
211 dnl Numeric variable, variable label.
212 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
213 26; "Numeric variable 2's label"; i8 0 *2;
215 dnl Character encoding record.
216 7; 20; 1; 12; "windows-1252";
218 dnl Dictionary termination record.
224 for variant in be le; do
225 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
226 AT_DATA([sys-file.sps], [dnl
227 GET FILE='sys-file.sav'.
231 AT_CHECK([pspp -o pspp.csv sys-file.sps])
232 AT_CHECK([cat pspp.csv], [0], [dnl
234 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
235 num1,1,,Unknown,Input,8,Right,F8.0,F8.0
236 num2,2,Numeric variable 2's label,Unknown,Input,8,Right,F8.0,F8.0
245 AT_SETUP([wrong number of variable positions but version 13])
246 AT_KEYWORDS([sack synthetic system file positive])
247 AT_DATA([sys-file.sack], [dnl
249 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
251 -1; dnl Nominal case size (unspecified)
252 0; dnl Not compressed
256 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
259 dnl Numeric variable, no label or missing values.
260 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
262 dnl Numeric variable, variable label.
263 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
264 26; "Numeric variable 2's label"; i8 0 *2;
266 dnl Machine integer info record (SPSS 13).
267 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
269 dnl Character encoding record.
270 7; 20; 1; 12; "windows-1252";
272 dnl Dictionary termination record.
278 for variant in be le; do
279 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
280 AT_DATA([sys-file.sps], [dnl
281 GET FILE='sys-file.sav'.
285 AT_CHECK([pspp -o pspp.csv sys-file.sps])
286 AT_CHECK([cat pspp.csv], [0], [dnl
288 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
289 num1,1,,Unknown,Input,8,Right,F8.0,F8.0
290 num2,2,Numeric variable 2's label,Unknown,Input,8,Right,F8.0,F8.0
299 AT_SETUP([value labels])
300 AT_KEYWORDS([sack synthetic system file positive])
301 AT_DATA([sys-file.sack], [dnl
303 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
305 22; dnl Nominal case size
306 0; dnl Not compressed
310 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
313 dnl Numeric variables.
314 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
315 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
316 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
317 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
318 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
320 dnl String variables.
321 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
322 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
323 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
324 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
325 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
326 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
327 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
328 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
329 2; 9; 0; 0; 0x010900 *2; "STR9"; i8 230; s3 ""; dnl index 14
330 2; -1; 0; 0; 0; 0; s8 "";
331 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
332 2; -1; 0; 0; 0; 0; s8 "";
333 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
334 2; -1; 0; 0; 0; 0; s8 "";
335 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
336 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
338 dnl One value label for NUM1.
339 3; 1; 1.0; i8 17; i8 238; i8 228; i8 232; i8 237; s19 " (in Russian)"; 4; 1; 1;
341 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
342 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
344 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
345 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
346 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
348 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
349 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
350 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
351 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
352 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
353 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
355 dnl One value label for STR1.
356 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
358 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
360 s8 "bc"; i8 20; s23 "value label for `bc'";
361 s8 "de"; i8 20; s23 "value label for `de'";
364 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
365 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
366 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
368 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
369 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
370 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
372 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
373 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
375 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
376 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
378 dnl One value label for STR6, STR7, STR8.
379 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
380 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
381 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
383 dnl Machine integer info record.
384 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1251;
386 dnl Character encoding record.
387 7; 20; 1; 12; "windows-1251";
390 dnl One value label for STR9ж,
391 COUNT("STR9"; i8 230); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
393 dnl Two value labels for STR12.
394 COUNT("STR12"); 12; 2;
395 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
396 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
398 dnl Three value labels for STR16.
399 COUNT("STR16"); 16; 3;
400 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
401 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
402 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789' with Cyrillic letters: `"; i8 244; i8 245; i8 246; "'");
404 dnl One value label for STR17.
405 COUNT("STR17"); 17; 1;
406 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
409 dnl Dictionary termination record.
412 for variant in be le; do
413 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
414 AT_DATA([sys-file.sps], [dnl
415 GET FILE='sys-file.sav'.
418 AT_CHECK([pspp -o pspp.csv sys-file.sps])
419 AT_CHECK([cat pspp.csv], [0], [dnl
421 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
422 num1,1,Unknown,Input,8,Right,F8.0,F8.0
423 num2,2,Unknown,Input,8,Right,F8.0,F8.0
424 num3,3,Unknown,Input,8,Right,F8.0,F8.0
425 num4,4,Unknown,Input,8,Right,F8.0,F8.0
426 num5,5,Unknown,Input,8,Right,F8.0,F8.0
427 str1,6,Nominal,Input,1,Left,A1,A1
428 str2,7,Nominal,Input,2,Left,A2,A2
429 str3,8,Nominal,Input,3,Left,A3,A3
430 str4,9,Nominal,Input,4,Left,A4,A4
431 str5,10,Nominal,Input,4,Left,A4,A4
432 str6,11,Nominal,Input,6,Left,A6,A6
433 str7,12,Nominal,Input,7,Left,A7,A7
434 str8,13,Nominal,Input,8,Left,A8,A8
435 str9ж,14,Nominal,Input,9,Left,A9,A9
436 str12,15,Nominal,Input,12,Left,A12,A12
437 str16,16,Nominal,Input,16,Left,A16,A16
438 str17,17,Nominal,Input,17,Left,A17,A17
441 Variable Value,,Label
442 num1,1,один (in Russian)
455 str1,a,value label for `a'
456 str2,bc,value label for `bc'
457 ,de,value label for `de'
458 str3,fgh,value label for `fgh'
459 ,ijk,value label for `ijk'
460 str4,BCDE,value label for `BCDE'
461 ,lmno,value label for `lmno'
462 ,tuvw,value label for `tuvw'
463 ,xyzA,value label for `xyzA'
464 str5,FGHI,value label for `FGHI'
465 ,pqrs,value label for `pqrs'
466 ,tuvw,value label for `tuvw'
467 ,xyzA,value label for `xyzA'
468 str6,JKLMNO,value label for `JKLMNO'
469 str7,JKLMNOP,value label for `JKLMNOP'
470 str8,JKLMNOPQ,value label for `JKLMNOPQ'
471 str9ж,RSTUVWXYZ,value label for `RSTUVWXYZ'
472 str12,0123456789ab,value label for `0123456789ab'
473 ,cdefghijklmn,value label for `cdefghijklmn'
474 str16,EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST'
475 ,UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц'
476 ,opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD'
477 str17,abcdefghijklmnopq,value label for `abcdefghijklmnopq'
482 AT_SETUP([documents])
483 AT_KEYWORDS([sack synthetic system file positive])
484 AT_DATA([sys-file.sack], [dnl
486 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
488 1; dnl Nominal case size
489 0; dnl Not compressed
493 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
496 dnl Numeric variable, no label or missing values.
497 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
499 dnl Machine integer info record.
500 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
504 s80 "First line of documents";
505 s80 "Second line of documents";
506 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
509 s80 "Last line of documents";
511 dnl Character encoding record.
512 7; 20; 1; 12; "windows-1252";
514 dnl Dictionary termination record.
520 for variant in be le; do
521 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
522 AT_DATA([sys-file.sps], [dnl
523 GET FILE='sys-file.sav'.
527 AT_CHECK([pspp -o pspp.csv sys-file.sps])
528 AT_CHECK([cat pspp.csv], [0], [dnl
530 "First line of documents
531 Second line of documents
532 abbé appliqué attaché blasé café canapé cliché consommé
534 Last line of documents"
543 AT_SETUP([empty document record])
544 AT_KEYWORDS([sack synthetic system file positive])
545 AT_DATA([sys-file.sack], [dnl
547 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
549 1; dnl Nominal case size
550 0; dnl Not compressed
554 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
557 dnl Numeric variable, no label or missing values.
558 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
560 dnl Machine integer info record.
561 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
566 dnl Character encoding record.
567 7; 20; 1; 12; "windows-1252";
569 dnl Dictionary termination record.
575 for variant in be le; do
576 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
577 AT_DATA([sys-file.sps], [dnl
578 GET FILE='sys-file.sav'.
581 AT_CHECK([pspp -o pspp.csv sys-file.sps])
582 AT_CHECK([cat pspp.csv], [0], [dnl
590 AT_SETUP([variable sets])
591 AT_KEYWORDS([sack synthetic system file positive set])
592 AT_DATA([sys-file.sack], [dnl
594 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
596 10; dnl Nominal case size
597 0; dnl Not compressed
601 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
605 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
606 2; 0; 0; 0; 0x050800 *2; s8 "B";
607 2; 0; 0; 0; 0x050800 *2; s8 "C";
610 2; 0; 0; 0; 0x050800 *2; s8 "D";
611 2; 0; 0; 0; 0x050800 *2; s8 "E";
612 2; 0; 0; 0; 0x050800 *2; s8 "F";
613 2; 0; 0; 0; 0x050800 *2; s8 "G";
616 2; 4; 0; 0; 0x010400 *2; s8 "H";
617 2; 4; 0; 0; 0x010400 *2; s8 "I";
618 2; 4; 0; 0; 0x010400 *2; s8 "J";
620 dnl Machine integer info record.
621 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
625 "Variable Set 1= "; i8 0x82; i8 0xa0; " b c"; i8 10;
626 "vs2=d e f g"; i8 10;
627 "c=h i j"; i8 13; i8 10;
628 "d= e g i b f"; i8 10;
629 "Empty Variable Set= "; i8 10);
631 dnl Character encoding record.
632 7; 20; 1; 9; "shift_jis";
634 dnl Dictionary termination record.
637 AT_DATA([expout], [dnl
639 ╭────┬────────┬────────────┬────────────╮
640 │Name│Position│Print Format│Write Format│
641 ├────┼────────┼────────────┼────────────┤
652 ╰────┴────────┴────────────┴────────────╯
655 ╭──────────────────────────┬────────╮
656 │Variable Set and Position │Variable│
657 ├──────────────────────────┼────────┤
658 │Variable Set 1 1 │あ │
661 ├──────────────────────────┼────────┤
666 ├──────────────────────────┼────────┤
670 ├──────────────────────────┼────────┤
676 ├──────────────────────────┼────────┤
677 │Empty Variable Set n/a │(empty) │
678 ╰──────────────────────────┴────────╯
680 AT_DATA([sys-file-1.sps], [dnl
681 GET FILE='sys-file.sav'.
683 DISPLAY VARIABLE SETS.
684 SAVE OUTFILE='sys-file-2.sav'.
686 AT_DATA([sys-file-2.sps], [dnl
687 GET FILE='sys-file-2.sav'.
689 DISPLAY VARIABLE SETS.
691 for variant in be le; do
692 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
693 AT_CHECK([rm -f sys-file-2.sav])
694 AT_CHECK([pspp --testing-mode -O box=unicode sys-file-1.sps], [0], [expout])
695 AT_CHECK([pspp --testing-mode -O box=unicode sys-file-2.sps], [0], [expout])
699 AT_SETUP([multiple response sets])
700 AT_KEYWORDS([sack synthetic system file positive])
701 AT_DATA([sys-file.sack], [dnl
703 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
705 16; dnl Nominal case size
706 0; dnl Not compressed
710 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
714 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
715 2; 0; 0; 0; 0x050800 *2; s8 "B";
716 2; 0; 0; 0; 0x050800 *2; s8 "C";
719 2; 0; 0; 0; 0x050800 *2; s8 "D";
720 2; 0; 0; 0; 0x050800 *2; s8 "E";
721 2; 0; 0; 0; 0x050800 *2; s8 "F";
722 2; 0; 0; 0; 0x050800 *2; s8 "G";
725 2; 4; 0; 0; 0x010400 *2; s8 "H";
726 2; 4; 0; 0; 0x010400 *2; s8 "I";
727 2; 4; 0; 0; 0x010400 *2; s8 "J";
730 2; 0; 0; 0; 0x050800 *2; s8 "K";
731 2; 0; 0; 0; 0x050800 *2; s8 "L";
732 2; 0; 0; 0; 0x050800 *2; s8 "M";
735 2; 6; 0; 0; 0x010600 *2; s8 "N";
736 2; 6; 0; 0; 0x010600 *2; s8 "O";
737 2; 6; 0; 0; 0x010600 *2; s8 "P";
739 dnl Machine integer info record.
740 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
744 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
745 "$b=D2 55 0 g e f d"; i8 10; i8 10;
746 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
751 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
752 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
754 dnl Character encoding record.
755 7; 20; 1; 9; "shift_jis";
757 dnl Dictionary termination record.
760 for variant in be le; do
761 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
762 AT_DATA([sys-file.sps], [dnl
763 GET FILE='sys-file.sav'.
764 MRSETS /DISPLAY NAME=ALL.
766 AT_CHECK([pspp -o pspp.csv sys-file.sps])
767 AT_CHECK([cat pspp.csv], [0], [dnl
768 Table: Multiple Response Sets
769 Name,Label,Encoding,Counted Value,Member Variables
770 $a,my mcgroup,Categories,,"あ
773 $b,,Dichotomies,55,"g
777 $c,mdgroup #2,Dichotomies,はい,"h
780 $d,third mdgroup,Dichotomies,34,"k
783 $e,,Dichotomies,choice,"n
790 dnl Also checks for handling of CR-only line ends in file label and
791 dnl extra product info.
792 AT_SETUP([extra product info])
793 AT_KEYWORDS([sack synthetic system file positive])
794 AT_DATA([sys-file.sack], [dnl
796 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
798 4; dnl Nominal case size
799 0; dnl Not compressed
803 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
806 dnl Numeric variables.
807 2; 0; 0; 0; 0x050800 *2; s8 "A";
808 2; 0; 0; 0; 0x050800 *2; s8 "B";
809 2; 0; 0; 0; 0x050800 *2; s8 "C";
810 2; 0; 0; 0; 0x050800 *2; s8 "D";
812 dnl Extra product info.
813 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
815 dnl Character encoding record.
816 7; 20; 1; 12; "windows-1252";
818 dnl Dictionary termination record.
821 for variant in be; do
822 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
823 AT_DATA([sys-file.sps], [dnl
824 SYSFILE INFO FILE='sys-file.sav'.
826 AT_CHECK([pspp -o pspp.csv sys-file.sps])
827 AT_CHECK([sed 8q pspp.csv], [0], [dnl
828 Table: File Information
830 Label,"PSPP synthetic
832 Created,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
833 Product,"Extra product info
840 AT_SETUP([variable display parameters, without width])
841 AT_KEYWORDS([sack synthetic system file positive])
842 AT_DATA([sys-file.sack], [dnl
844 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
846 19; dnl Nominal case size
847 0; dnl Not compressed
851 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
854 dnl Numeric variables.
855 2; 0; 0; 0; 0x050800 *2; s8 "A";
856 2; 0; 0; 0; 0x050800 *2; s8 "B";
857 2; 0; 0; 0; 0x050800 *2; s8 "C";
858 2; 0; 0; 0; 0x050800 *2; s8 "D";
860 dnl Short string variables.
861 2; 3; 0; 0; 0x010300 *2; s8 "H";
862 2; 3; 0; 0; 0x010300 *2; s8 "I";
863 2; 3; 0; 0; 0x010300 *2; s8 "J";
864 2; 3; 0; 0; 0x010300 *2; s8 "K";
866 dnl Long string variables.
867 2; 9; 0; 0; 0x010900 *2; s8 "L";
868 2; -1; 0; 0; 0; 0; s8 "";
869 2; 10; 0; 0; 0x010a00 *2; s8 "M";
870 2; -1; 0; 0; 0; 0; s8 "";
871 2; 17; 0; 0; 0x011100 *2; s8 "N";
872 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
873 2; 25; 0; 0; 0x011900 *2; s8 "O";
874 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
876 dnl Variable display parameters
891 dnl Character encoding record.
892 7; 20; 1; 12; "windows-1252";
894 dnl Dictionary termination record.
897 for variant in be le; do
898 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
899 AT_DATA([sys-file.sps], [dnl
900 GET FILE='sys-file.sav'.
903 AT_CHECK([pspp -o pspp.csv sys-file.sps])
904 AT_CHECK([cat pspp.csv], [0], [dnl
906 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
907 a,1,Nominal,Input,8,Left,F8.0,F8.0
908 b,2,Ordinal,Input,8,Left,F8.0,F8.0
909 c,3,Scale,Input,8,Left,F8.0,F8.0
910 d,4,Nominal,Input,8,Right,F8.0,F8.0
911 h,5,Ordinal,Input,3,Right,A3,A3
912 i,6,Scale,Input,3,Right,A3,A3
913 j,7,Nominal,Input,3,Center,A3,A3
914 k,8,Ordinal,Input,3,Center,A3,A3
915 l,9,Scale,Input,9,Center,A9,A9
916 m,10,Nominal,Input,10,Left,A10,A10
917 n,11,Nominal,Input,17,Right,A17,A17
918 o,12,Nominal,Input,25,Center,A25,A25
923 AT_SETUP([variable display parameters, with width])
924 AT_KEYWORDS([sack synthetic system file positive])
925 AT_DATA([sys-file.sack], [dnl
927 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
929 19; dnl Nominal case size
930 0; dnl Not compressed
934 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
937 dnl Numeric variables.
938 2; 0; 0; 0; 0x050800 *2; s8 "A";
939 2; 0; 0; 0; 0x050800 *2; s8 "B";
940 2; 0; 0; 0; 0x050800 *2; s8 "C";
941 2; 0; 0; 0; 0x050800 *2; s8 "D";
943 dnl Short string variables.
944 2; 3; 0; 0; 0x010300 *2; s8 "H";
945 2; 3; 0; 0; 0x010300 *2; s8 "I";
946 2; 3; 0; 0; 0x010300 *2; s8 "J";
947 2; 3; 0; 0; 0x010300 *2; s8 "K";
949 dnl Long string variables.
950 2; 9; 0; 0; 0x010900 *2; s8 "L";
951 2; -1; 0; 0; 0; 0; s8 "";
952 2; 10; 0; 0; 0x010a00 *2; s8 "M";
953 2; -1; 0; 0; 0; 0; s8 "";
954 2; 17; 0; 0; 0x011100 *2; s8 "N";
955 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
956 2; 25; 0; 0; 0x011900 *2; s8 "O";
957 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
959 dnl Variable display parameters
974 dnl Character encoding record.
975 7; 20; 1; 12; "windows-1252";
977 dnl Dictionary termination record.
980 for variant in be le; do
981 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
982 AT_DATA([sys-file.sps], [dnl
983 GET FILE='sys-file.sav'.
986 AT_CHECK([pspp -o pspp.csv sys-file.sps])
987 AT_CHECK([cat pspp.csv], [0], [dnl
989 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
990 a,1,Nominal,Input,1,Left,F8.0,F8.0
991 b,2,Ordinal,Input,2,Left,F8.0,F8.0
992 c,3,Scale,Input,3,Left,F8.0,F8.0
993 d,4,Nominal,Input,4,Right,F8.0,F8.0
994 h,5,Ordinal,Input,5,Right,A3,A3
995 i,6,Scale,Input,6,Right,A3,A3
996 j,7,Nominal,Input,7,Center,A3,A3
997 k,8,Ordinal,Input,8,Center,A3,A3
998 l,9,Scale,Input,9,Center,A9,A9
999 m,10,Nominal,Input,10,Left,A10,A10
1000 n,11,Nominal,Input,11,Right,A17,A17
1001 o,12,Nominal,Input,12,Center,A25,A25
1006 AT_SETUP([long variable names])
1007 AT_KEYWORDS([sack synthetic system file positive])
1008 AT_DATA([sys-file.sack], [dnl
1010 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1012 7; dnl Nominal case size
1013 0; dnl Not compressed
1017 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1020 dnl Numeric variables.
1021 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
1022 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
1023 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
1024 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
1025 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
1026 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
1027 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
1029 dnl Machine integer info record.
1030 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1032 dnl Machine floating-point info record.
1033 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1035 dnl Long variable names.
1037 "LONGVARI=LongVariableName1"; i8 9;
1038 "LONGVA_A=LongVariableName2"; i8 9;
1039 "LONGVA_B=LongVariableName3"; i8 9;
1040 "LONGVA_C=LongVariableName4"; i8 9;
1041 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
1042 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
1043 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
1046 dnl Character encoding record.
1047 7; 20; 1; 12; "windows-1252";
1049 dnl Dictionary termination record.
1052 for variant in be le; do
1053 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1054 AT_DATA([sys-file.sps], [dnl
1055 GET FILE='sys-file.sav'.
1058 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1059 AT_CHECK([cat pspp.csv], [0], [dnl
1061 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1062 LongVariableName1,1,Unknown,Input,8,Right,F8.0,F8.0
1063 LongVariableName2,2,Unknown,Input,8,Right,F8.0,F8.0
1064 LongVariableName3,3,Unknown,Input,8,Right,F8.0,F8.0
1065 LongVariableName4,4,Unknown,Input,8,Right,F8.0,F8.0
1066 Coördinate_X,5,Unknown,Input,8,Right,F8.0,F8.0
1067 Coördinate_Y,6,Unknown,Input,8,Right,F8.0,F8.0
1068 Coördinate_Z,7,Unknown,Input,8,Right,F8.0,F8.0
1073 AT_SETUP([very long strings])
1074 AT_KEYWORDS([sack synthetic system file positive])
1075 AT_DATA([sys-file.sack], [dnl
1077 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1079 109; dnl Nominal case size
1080 0; dnl Not compressed
1084 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1087 dnl 256-byte string.
1088 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1089 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1090 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1092 dnl 600-byte string.
1093 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1094 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1095 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1096 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1097 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1098 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1100 dnl Machine integer info record.
1101 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1103 dnl Very long string record.
1105 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1106 "STR600=00600"; i8 0; i8 9;
1109 dnl Character encoding record.
1110 7; 20; 1; 12; "windows-1252";
1112 dnl Dictionary termination record.
1116 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1118 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1119 "abcdefghijklmnopqrstuvwxyzABCDEF";
1121 for variant in be le; do
1122 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1123 AT_DATA([sys-file.sps], [dnl
1124 GET FILE='sys-file.sav'.
1128 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1129 AT_CHECK([cat pspp.csv], [0], [dnl
1131 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1132 séq256,1,Nominal,Input,32,Left,A256,A256
1133 str600,2,Nominal,Input,32,Left,A600,A600
1137 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1142 AT_SETUP([data file and variable attributes])
1143 AT_KEYWORDS([sack synthetic system file positive])
1144 AT_DATA([sys-file.sack], [dnl
1146 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1148 3; dnl Nominal case size
1149 0; dnl Not compressed
1153 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1157 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1158 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1159 2; 0; 0; 0; 0x050800 *2; s8 "THIRDVAR";
1161 dnl Machine integer info record.
1162 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1164 dnl Long variable names.
1166 "FIRSTVAR=FirstVariable"; i8 9;
1167 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1168 "THIRDVAR=ThirdVariable"; i8 9
1171 dnl Data file attributes record.
1173 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1174 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1177 dnl Variable attributes record.
1180 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1181 "bert('123'"; i8 10; ")";
1182 "$@Role('1'"; i8 10; ")";
1183 "/S"; i8 233; "condVariable:";
1184 "xyzzy('quux'"; i8 10; ")";
1187 dnl Another variable attributes record.
1188 dnl Only system files written by "Stata 14.1/-savespss- 1.77 by S.Radyakin"
1189 dnl include multiple variable attributes records.
1190 7; 18; 1; COUNT ("ThirdVariable:fizz('buzz'"; i8 10; ")";);
1192 dnl Character encoding record.
1193 7; 20; 1; 12; "windows-1252";
1195 dnl Dictionary termination record.
1198 for variant in be le; do
1199 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1200 AT_DATA([sys-file.sps], [dnl
1201 GET FILE='sys-file.sav'.
1202 DISPLAY @ATTRIBUTES.
1204 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1205 AT_CHECK([cat pspp.csv], [0],
1206 [[Table: Variable and Dataset Attributes
1207 Variable and Name,,Value
1208 (dataset),Attr1[1],Value1
1209 ,Attr1[2],'déclaration'
1212 FirstVariable,$@Role,1
1216 SécondVariable,xyzzy,quux
1217 ThirdVariable,fizz,buzz
1219 AT_DATA([sys-file.sps], [dnl
1220 GET FILE='sys-file.sav'.
1223 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1224 AT_CHECK([cat pspp.csv], [0],
1226 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1227 FirstVariable,1,Unknown,Output,8,Right,F8.0,F8.0
1228 SécondVariable,2,Unknown,Input,8,Right,F8.0,F8.0
1229 ThirdVariable,3,Unknown,Input,8,Right,F8.0,F8.0
1234 AT_SETUP([variable roles])
1235 AT_KEYWORDS([sack synthetic system file positive])
1236 AT_DATA([sys-file.sack], [dnl
1238 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1240 7; dnl Nominal case size
1241 0; dnl Not compressed
1245 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1249 2; 0; 0; 0; 0x050800 *2; s8 "I";
1250 2; 0; 0; 0; 0x050800 *2; s8 "O";
1251 2; 0; 0; 0; 0x050800 *2; s8 "B";
1252 2; 0; 0; 0; 0x050800 *2; s8 "N";
1253 2; 0; 0; 0; 0x050800 *2; s8 "P";
1254 2; 0; 0; 0; 0x050800 *2; s8 "S";
1255 2; 0; 0; 0; 0x050800 *2; s8 "X";
1257 dnl Machine integer info record.
1258 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1260 dnl Variable attributes record.
1262 "I:$@Role('0'"; i8 10; ")";
1263 "/O:$@Role('1'"; i8 10; ")";
1264 "/B:$@Role('2'"; i8 10; ")";
1265 "/N:$@Role('3'"; i8 10; ")";
1266 "/P:$@Role('4'"; i8 10; ")";
1267 "/S:$@Role('5'"; i8 10; ")";
1268 "/X:$@Role('6'"; i8 10; ")";
1271 dnl Character encoding record.
1272 7; 20; 1; 12; "windows-1252";
1274 dnl Dictionary termination record.
1277 for variant in be le; do
1278 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1279 AT_DATA([sys-file.sps], [dnl
1280 GET FILE='sys-file.sav'.
1283 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1284 warning: `sys-file.sav': Invalid role for variable x.
1286 AT_CHECK([cat pspp.csv], [0], [dnl
1287 warning: `sys-file.sav': Invalid role for variable x.
1290 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1291 i,1,Unknown,Input,8,Right,F8.0,F8.0
1292 o,2,Unknown,Output,8,Right,F8.0,F8.0
1293 b,3,Unknown,Both,8,Right,F8.0,F8.0
1294 n,4,Unknown,None,8,Right,F8.0,F8.0
1295 p,5,Unknown,Partition,8,Right,F8.0,F8.0
1296 s,6,Unknown,Split,8,Right,F8.0,F8.0
1297 x,7,Unknown,Input,8,Right,F8.0,F8.0
1302 AT_SETUP([compressed data])
1303 AT_KEYWORDS([sack synthetic system file positive])
1304 AT_DATA([sys-file.sack], [dnl
1306 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1308 6; dnl Nominal case size
1309 1; dnl Simple compression
1311 -1; dnl Unspecified number of cases.
1313 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1316 dnl Numeric variables.
1317 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1318 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1320 dnl String variable.
1321 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1322 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1323 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1324 2; -1; 0; 0; 0; 0; s8 "";
1326 dnl Character encoding record.
1327 7; 20; 1; 12; "windows-1252";
1329 dnl Dictionary termination record.
1332 dnl Compressed data.
1333 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1334 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1335 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1336 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1339 for variant in be le; do
1340 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1341 AT_DATA([sys-file.sps], [dnl
1342 GET FILE='sys-file.sav'.
1346 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1347 AT_CHECK([cat pspp.csv], [0], [dnl
1349 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1350 num1,1,Unknown,Input,8,Right,F8.0,F8.0
1351 num2,2,Unknown,Input,8,Right,F8.0,F8.0
1352 str4,3,Nominal,Input,4,Left,A4,A4
1353 str8,4,Nominal,Input,8,Left,A8,A8
1354 str15,5,Nominal,Input,15,Left,A15,A15
1357 num1,num2,str4,str8,str15
1358 -99,0,,abcdefgh,0123
1359 .,151,jklm,nopqrstu,vwxyzABC
1360 1,2,DEFG,HIJKLMNO,PQRSTUV
1365 AT_SETUP([compressed data, zero bias])
1366 AT_KEYWORDS([sack synthetic system file positive])
1367 AT_DATA([sys-file.sack], [dnl
1369 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1371 6; dnl Nominal case size
1372 1; dnl Simple compression.
1374 -1; dnl Unspecified number of cases.
1376 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1379 dnl Numeric variables.
1380 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1381 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1383 dnl String variable.
1384 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1385 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1386 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1387 2; -1; 0; 0; 0; 0; s8 "";
1389 dnl Character encoding record.
1390 7; 20; 1; 12; "windows-1252";
1392 dnl Dictionary termination record.
1395 dnl Compressed data.
1396 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1397 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1398 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1399 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1402 for variant in be le; do
1403 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1404 AT_DATA([sys-file.sps], [dnl
1405 GET FILE='sys-file.sav'.
1409 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1410 AT_CHECK([cat pspp.csv], [0], [dnl
1412 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1413 num1,1,Unknown,Input,8,Right,F8.0,F8.0
1414 num2,2,Unknown,Input,8,Right,F8.0,F8.0
1415 str4,3,Nominal,Input,4,Left,A4,A4
1416 str8,4,Nominal,Input,8,Left,A8,A8
1417 str15,5,Nominal,Input,15,Left,A15,A15
1420 num1,num2,str4,str8,str15
1421 1,100,,abcdefgh,0123
1422 .,251,jklm,nopqrstu,vwxyzABC
1423 101,102,DEFG,HIJKLMNO,PQRSTUV
1428 AT_SETUP([compressed data, other bias])
1429 AT_KEYWORDS([sack synthetic system file positive])
1430 AT_DATA([sys-file.sack], [dnl
1432 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1434 6; dnl Nominal case size
1435 1; dnl Simple compression.
1437 -1; dnl Unspecified number of cases.
1439 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1442 dnl Numeric variables.
1443 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1444 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1446 dnl String variable.
1447 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1448 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1449 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1450 2; -1; 0; 0; 0; 0; s8 "";
1452 dnl Character encoding record.
1453 7; 20; 1; 12; "windows-1252";
1455 dnl Dictionary termination record.
1458 dnl Compressed data.
1459 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1460 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1461 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1462 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1465 for variant in be le; do
1466 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1467 AT_DATA([sys-file.sps], [dnl
1468 GET FILE='sys-file.sav'.
1472 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1473 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1475 AT_CHECK([cat pspp.csv], [0], [dnl
1476 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1479 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1480 num1,1,Unknown,Input,8,Right,F8.0,F8.0
1481 num2,2,Unknown,Input,8,Right,F8.0,F8.0
1482 str4,3,Nominal,Input,4,Left,A4,A4
1483 str8,4,Nominal,Input,8,Left,A8,A8
1484 str15,5,Nominal,Input,15,Left,A15,A15
1487 num1,num2,str4,str8,str15
1488 -49,50,,abcdefgh,0123
1489 .,201,jklm,nopqrstu,vwxyzABC
1490 51,52,DEFG,HIJKLMNO,PQRSTUV
1495 m4_divert_push([PREPARE_TESTS])
1496 zcompressed_sack () {
1499 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1501 6; dnl Nominal case size
1502 2; dnl zlib compressed
1504 -1; dnl Unspecified number of cases.
1506 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1509 dnl Numeric variables.
1510 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1511 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1513 dnl String variable.
1514 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1515 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1516 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1517 2; -1; 0; 0; 0; 0; s8 "";
1519 dnl Character encoding record.
1520 7; 20; 1; 12; "windows-1252";
1522 dnl Dictionary termination record.
1525 dnl ZLIB data header.
1526 i64 0x194; # zheader_ofs
1527 i64 0x205; # ztrailer_ofs
1528 i64 48; # ztrailer_len
1530 dnl ZLIB data block.
1532 dnl This is the compressed form of:
1534 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1535 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1536 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1537 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1538 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1539 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1541 dnl which is the data from the "compressed data" test.
1542 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1543 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1544 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1545 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1546 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1547 hex "90 d0 b0 70 00 0f 3f 23 d7";
1549 dnl ZLIB data trailer fixed header:
1550 i64 -100; # ztrailer_bias
1551 i64 0; # ztrailer_zero
1552 0x3ff000; # block_size
1555 dnl ZLIB block descriptor:
1556 i64 0x194; # uncompressed_ofs
1557 i64 0x1ac; # compressed_ofs
1558 88; # uncompressed_size
1559 89; # compressed_size
1562 m4_divert_pop([PREPARE_TESTS])
1564 AT_SETUP([zcompressed data])
1565 AT_KEYWORDS([sack synthetic system file positive zlib])
1566 zcompressed_sack > sys-file.sack
1567 for variant in be le; do
1568 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1569 AT_DATA([sys-file.sps], [dnl
1570 GET FILE='sys-file.sav'.
1574 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1575 AT_CHECK([cat pspp.csv], [0], [dnl
1577 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1578 num1,1,Unknown,Input,8,Right,F8.0,F8.0
1579 num2,2,Unknown,Input,8,Right,F8.0,F8.0
1580 str4,3,Nominal,Input,4,Left,A4,A4
1581 str8,4,Nominal,Input,8,Left,A8,A8
1582 str15,5,Nominal,Input,15,Left,A15,A15
1585 num1,num2,str4,str8,str15
1586 -99,0,,abcdefgh,0123
1587 .,151,jklm,nopqrstu,vwxyzABC
1588 1,2,DEFG,HIJKLMNO,PQRSTUV
1593 AT_BANNER([system file reader - negative])
1595 AT_SETUP([no variables])
1596 AT_KEYWORDS([sack synthetic system file negative])
1597 AT_DATA([sys-file.sack], [dnl
1599 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1601 0; dnl Nominal case size (empty)
1602 0; dnl Not compressed
1606 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1609 dnl Character encoding record.
1610 7; 20; 1; 12; "windows-1252";
1612 dnl Dictionary termination record.
1615 for variant in be le; do
1616 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1617 AT_DATA([sys-file.sps], [dnl
1618 GET FILE='sys-file.sav'.
1620 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1621 sys-file.sps:1: error: GET: `sys-file.sav': Data file dictionary has no variables.
1624 dnl At one point pspp-convert would hang forever if there were no variables,
1625 dnl so check against regression.
1626 AT_CHECK([pspp-convert sys-file.sav sys-file.txt])
1627 AT_CHECK([cat sys-file.txt], [0], [
1632 AT_SETUP([unspecified character encoding])
1633 AT_KEYWORDS([sack synthetic system file positive])
1634 AT_DATA([sys-file.sack], [dnl
1636 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1638 4; dnl Nominal case size
1639 0; dnl Not compressed
1643 "01 Jan 11"; "20:53:52";
1644 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1647 dnl Numeric variables.
1648 2; 0; 0; 0; 0x050800 *2; s8 "A";
1649 2; 0; 0; 0; 0x050800 *2; s8 "B";
1650 2; 0; 0; 0; 0x050800 *2; s8 "C";
1651 2; 0; 0; 0; 0x050800 *2; s8 "D";
1653 dnl Dictionary termination record.
1656 for variant in be le; do
1657 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1658 AT_DATA([sys-file.sps], [dnl
1661 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [stdout])
1662 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
1663 "warning: `sys-file.sav': This system file does not indicate its own character encoding. Using default encoding. For best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING=""DETECT"" to analyze the possible encodings."
1668 AT_SETUP([misplaced type 4 record])
1669 AT_KEYWORDS([sack synthetic system file negative])
1670 AT_DATA([sys-file.sack], [dnl
1672 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1673 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1675 dnl Numeric variable.
1676 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1681 for variant in be le; do
1682 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1683 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1685 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1686 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1691 AT_SETUP([bad record type])
1692 AT_KEYWORDS([sack synthetic system file negative])
1693 AT_DATA([sys-file.sack], [dnl
1695 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1696 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1698 dnl Numeric variable.
1699 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1701 dnl Type 8 record (not a valid type).
1704 for variant in be le; do
1705 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1706 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1708 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1709 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1714 AT_SETUP([wrong number of variable positions])
1715 AT_KEYWORDS([sack synthetic system file negative])
1716 AT_DATA([sys-file.sack], [dnl
1718 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1719 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1721 dnl Numeric variable.
1722 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1724 dnl Character encoding record.
1725 7; 20; 1; 12; "windows-1252";
1727 dnl End of dictionary.
1730 for variant in be le; do
1731 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1732 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1734 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1735 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1740 AT_SETUP([variable name may not begin with `#'])
1741 AT_KEYWORDS([sack synthetic system file negative])
1742 AT_DATA([sys-file.sack], [dnl
1744 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1745 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1747 dnl Numeric variable.
1748 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1750 dnl Character encoding record.
1751 7; 20; 1; 12; "windows-1252";
1753 dnl End of dictionary.
1756 for variant in be le; do
1757 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1758 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1760 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
1761 [warning: `sys-file.sav' near offset 0xb4: Renaming variable with invalid name `$UM1' to `VAR001'.
1766 AT_SETUP([variable name may not be reserved word])
1767 AT_KEYWORDS([sack synthetic system file negative])
1768 AT_DATA([sys-file.sack], [dnl
1770 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1771 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1773 dnl Numeric variable.
1774 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1776 dnl Character encoding record.
1777 7; 20; 1; 12; "windows-1252";
1779 dnl End of dictionary.
1782 for variant in be le; do
1783 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1784 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1786 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
1787 [warning: `sys-file.sav' near offset 0xb4: Renaming variable with invalid name `TO' to `VAR001'.
1792 AT_SETUP([variable width must be between 0 and 255])
1793 AT_KEYWORDS([sack synthetic system file negative])
1794 AT_DATA([sys-file.sack], [dnl
1796 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1797 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1799 dnl String variable with invalid width 256.
1800 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1802 dnl Character encoding record.
1803 7; 20; 1; 12; "windows-1252";
1805 dnl End of dictionary.
1808 for variant in be le; do
1809 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1810 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1812 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1813 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1818 dnl SPSS-generated system file can contain duplicate variable names
1819 dnl (see bug #41475).
1820 AT_SETUP([duplicate variable name])
1821 AT_KEYWORDS([sack synthetic system file negative])
1822 AT_DATA([sys-file.sack], [dnl
1824 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1825 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1827 dnl Numeric variables.
1828 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1829 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1831 dnl Character encoding record.
1832 7; 20; 1; 12; "windows-1252";
1834 dnl End of dictionary.
1837 for variant in be le; do
1838 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1839 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1842 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1843 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1846 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1847 var1,1,Unknown,Input,8,Right,F8.0,F8.0
1848 var001,2,Unknown,Input,8,Right,F8.0,F8.0
1853 AT_SETUP([variable label indicator not 0 or 1])
1854 AT_KEYWORDS([sack synthetic system file negative])
1855 AT_DATA([sys-file.sack], [dnl
1857 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1858 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1860 dnl Numeric variable.
1861 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1863 dnl Character encoding record.
1864 7; 20; 1; 12; "windows-1252";
1866 dnl End of dictionary.
1869 for variant in be le; do
1870 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1871 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1873 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1874 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1879 AT_SETUP([invalid numeric missing value indicator])
1880 AT_KEYWORDS([sack synthetic system file negative])
1881 AT_DATA([sys-file.sack], [dnl
1883 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1884 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1886 dnl Numeric variable.
1887 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1889 dnl Character encoding record.
1890 7; 20; 1; 12; "windows-1252";
1892 dnl End of dictionary.
1895 for variant in be le; do
1896 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1897 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1899 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1900 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1905 AT_SETUP([invalid string missing value indicator])
1906 AT_KEYWORDS([sack synthetic system file negative])
1907 AT_DATA([sys-file.sack], [dnl
1909 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1910 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1912 dnl String variable.
1913 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1915 dnl Character encoding record.
1916 7; 20; 1; 12; "windows-1252";
1918 dnl End of dictionary.
1921 for variant in be le; do
1922 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1923 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1925 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1926 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1931 AT_SETUP([missing string continuation record])
1932 AT_KEYWORDS([sack synthetic system file negative])
1933 AT_DATA([sys-file.sack], [dnl
1935 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1936 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1938 dnl String variable.
1939 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1940 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1942 dnl Character encoding record.
1943 7; 20; 1; 12; "windows-1252";
1945 dnl End of dictionary.
1948 for variant in be le; do
1949 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1950 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1952 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1953 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1958 AT_SETUP([invalid variable format])
1959 AT_KEYWORDS([sack synthetic system file negative])
1960 AT_DATA([sys-file.sack], [dnl
1962 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1963 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1965 dnl Numeric variable, invalid format types.
1966 dnl No warning is issued for type 0 because it has been observed in real
1968 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1970 dnl Numeric variable, string formats.
1971 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1973 dnl String variable, numeric formats.
1974 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1976 dnl String variable, wrong width formats.
1977 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1979 dnl Character encoding record.
1980 7; 20; 1; 12; "windows-1252";
1982 dnl End of dictionary.
1985 for variant in be le; do
1986 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1987 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1989 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1990 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1992 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1994 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1996 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1998 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
2000 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
2002 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
2007 AT_SETUP([invalid long string missing values])
2008 AT_KEYWORDS([sack synthetic system file negative])
2009 AT_DATA([sys-file.sack], [dnl
2011 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2013 7; dnl Nominal case size
2014 0; dnl Not compressed
2018 "01 Jan 11"; "20:53:52";
2019 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
2022 dnl One numeric variable.
2023 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2025 dnl Long string variables that will have missing values added with a
2027 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2028 2; -1; 0; 0; 0; 0; s8 "";
2029 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
2030 2; -1; 0; 0; 0; 0; s8 "";
2031 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
2032 2; -1; 0; 0; 0; 0; s8 "";
2034 dnl Machine integer info record.
2035 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
2037 dnl Machine floating-point info record.
2038 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
2040 dnl Long string variable missing values record.
2042 dnl Zero missing values (not allowed) for STR1 .
2043 COUNT("STR1"); i8 >>0<<; 8;
2045 dnl Four missing values (not allowed) for STR2.
2046 COUNT("STR2"); i8 4; 8;
2047 "abcdefgh"; "ijklmnop"; "qrstuvwx"; "yz012345";
2049 dnl Missing values for unknown variable
2050 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
2052 dnl Missing values for numeric variable
2053 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
2055 dnl Too long missing value
2056 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
2058 dnl Buggy way that this was written in old PSPP, with a length
2059 dnl before each missing value instead of just once.
2060 COUNT("STR3"); i8 2; 8; "ABCDEFGH"; >>8<<; "IJKLMNOP";
2063 dnl Character encoding record.
2064 7; 20; 1; 12; "windows-1252";
2066 dnl Dictionary termination record.
2068 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
2069 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
2070 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
2073 for variant in be le; do
2074 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2075 AT_DATA([sys-file.sps], [dnl
2076 GET FILE='sys-file.sav'.
2079 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2080 ["warning: `sys-file.sav' near offset 0x1f8: Long string missing values record says variable STR1 has 0 missing values, but only 1 to 3 missing values are allowed."
2082 "warning: `sys-file.sav' near offset 0x205: Long string missing values record says variable STR2 has 4 missing values, but only 1 to 3 missing values are allowed."
2084 warning: `sys-file.sav' near offset 0x23a: Ignoring long string missing value record for unknown variable Nonexistent.
2086 warning: `sys-file.sav' near offset 0x24f: Ignoring long string missing value record for numeric variable NUM1.
2088 "warning: `sys-file.sav' near offset 0x268: Ignoring long string missing value 0 for variable str3, with width 11, that has bad value width 12."
2090 "warning: `sys-file.sav' near offset 0x289: This file has corrupted metadata written by a buggy version of PSPP. To fix it, save a new copy of the file."
2093 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
2094 num1,1,Unknown,Input,8,Right,F8.0,F8.0,
2095 str1,2,Nominal,Input,9,Left,A9,A9,
2096 str2,3,Nominal,Input,10,Left,A10,A10,"""abcdefgh""; ""ijklmnop""; ""qrstuvwx"""
2097 str3,4,Nominal,Input,11,Left,A11,A11,"""ABCDEFGH""; ""IJKLMNOP"""
2102 AT_SETUP([weighting variable must be numeric])
2103 AT_KEYWORDS([sack synthetic system file negative])
2104 AT_DATA([sys-file.sack], [dnl
2106 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2107 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2109 dnl Numeric variable.
2110 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2112 dnl String variable.
2113 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2115 dnl Character encoding record.
2116 7; 20; 1; 12; "windows-1252";
2118 dnl End of dictionary.
2121 for variant in be le; do
2122 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2123 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2126 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2127 [warning: `sys-file.sav' near offset 0x4c: Ignoring string variable `STR1' set as weighting variable.
2130 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
2131 num1,1,Unknown,Input,8,Right,F8.0,F8.0
2132 str1,2,Nominal,Input,4,Left,A4,A4
2137 AT_SETUP([bad weighting variable index])
2138 AT_KEYWORDS([sack synthetic system file negative])
2139 AT_DATA([sys-file.sack], [dnl
2141 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2142 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2144 dnl Numeric variable.
2145 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2147 dnl String variable.
2148 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2150 dnl Character encoding record.
2151 7; 20; 1; 12; "windows-1252";
2153 dnl End of dictionary.
2156 for variant in be le; do
2157 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2158 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2160 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
2161 [warning: `sys-file.sav' near offset 0x4c: Weight variable index 3 not in valid range 1...2. Treating file as unweighted.
2166 AT_SETUP([variable index is long string continuation])
2167 AT_KEYWORDS([sack synthetic system file negative])
2168 AT_DATA([sys-file.sack], [dnl
2170 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2171 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2173 dnl Numeric variable.
2174 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2176 dnl Long string variable.
2177 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2178 (2; -1; 0; 0; 0; 0; s8 "");
2180 dnl Character encoding record.
2181 7; 20; 1; 12; "windows-1252";
2183 dnl End of dictionary.
2186 for variant in be le; do
2187 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2188 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2190 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
2191 [warning: `sys-file.sav' near offset 0x4c: Weight variable index 3 refers to long string continuation. Treating file as unweighted.
2196 AT_SETUP([multiple documents records])
2197 AT_KEYWORDS([sack synthetic system file negative])
2198 AT_DATA([sys-file.sack], [dnl
2200 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2201 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2203 dnl Numeric variables, no label or missing values.
2204 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2205 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
2207 dnl Two document records.
2208 (6; 1; s80 "One line of documents") >>* 2<<;
2210 dnl Character encoding record.
2211 7; 20; 1; 12; "windows-1252";
2213 dnl Dictionary termination record.
2219 for variant in be le; do
2220 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2221 AT_DATA([sys-file.sps], [dnl
2222 GET FILE='sys-file.sav'.
2224 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
2225 warning: `sys-file.sav' near offset 0x14c: Duplicate type 6 (document) record.
2231 AT_SETUP([extension record too large])
2232 AT_KEYWORDS([sack synthetic system file negative])
2233 AT_DATA([sys-file.sack], [dnl
2235 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2236 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2238 dnl Numeric variable, no label or missing values.
2239 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2241 dnl Too-large extension record.
2242 7; 3; >>0xfffff000 * 2<<;
2244 for variant in be le; do
2245 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2246 AT_DATA([sys-file.sps], [dnl
2247 GET FILE='sys-file.sav'.
2249 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2250 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2255 AT_SETUP([unknown extension record])
2256 AT_KEYWORDS([sack synthetic system file negative])
2257 AT_DATA([sys-file.sack], [dnl
2259 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2260 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2262 dnl Numeric variable, no label or missing values.
2263 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2265 dnl Unknown extension record type.
2268 dnl Character encoding record.
2269 7; 20; 1; 12; "windows-1252";
2271 dnl End of dictionary.
2274 for variant in be le; do
2275 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2276 AT_DATA([sys-file.sps], [dnl
2277 GET FILE='sys-file.sav'.
2279 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2280 "warning: \`sys-file.sav' near offset 0xd8: Unrecognized record type 7, subtype 30. For help, please send this file to ${PACKAGE_BUGREPORT} and mention that you were using ${PACKAGE_STRING}."
2285 AT_SETUP([bad machine integer info size])
2286 AT_KEYWORDS([sack synthetic system file negative])
2287 AT_DATA([sys-file.sack], [dnl
2289 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2290 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2292 dnl Numeric variable, no label or missing values.
2293 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2295 dnl Machine integer info record.
2296 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2298 dnl Character encoding record.
2299 7; 20; 1; 12; "windows-1252";
2301 dnl End of dictionary.
2304 for variant in be le; do
2305 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2306 AT_DATA([sys-file.sps], [dnl
2307 GET FILE='sys-file.sav'.
2309 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2310 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2315 AT_SETUP([bad machine integer info float format])
2316 AT_KEYWORDS([sack synthetic system file negative])
2317 AT_DATA([sys-file.sack], [dnl
2319 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2320 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2322 dnl Numeric variable, no label or missing values.
2323 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2325 dnl Machine integer info record.
2326 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2328 dnl Character encoding record.
2329 7; 20; 1; 12; "windows-1252";
2331 dnl End of dictionary.
2334 for variant in be le; do
2335 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2336 AT_DATA([sys-file.sps], [dnl
2337 GET FILE='sys-file.sav'.
2339 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2340 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2345 AT_SETUP([bad machine integer info endianness])
2346 AT_KEYWORDS([sack synthetic system file negative])
2347 AT_DATA([sys-file.sack], [dnl
2349 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2350 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2352 dnl Numeric variable, no label or missing values.
2353 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2355 dnl Machine integer info record.
2356 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2358 dnl Character encoding record.
2359 7; 20; 1; 12; "windows-1252";
2361 dnl End of dictionary.
2364 for variant in "be 1" "le 2"; do
2366 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2367 AT_DATA([sys-file.sps], [dnl
2368 GET FILE='sys-file.sav'.
2371 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2372 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2375 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
2376 num1,1,Unknown,Input,8,Right,F8.0,F8.0
2382 AT_SETUP([bad machine floating-point info size])
2383 AT_KEYWORDS([sack synthetic system file negative])
2384 AT_DATA([sys-file.sack], [dnl
2386 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2387 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2389 dnl Numeric variable, no label or missing values.
2390 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2392 dnl Machine floating-point info record.
2393 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2395 dnl Character encoding record.
2396 7; 20; 1; 12; "windows-1252";
2398 dnl End of dictionary.
2401 for variant in be le; do
2402 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2403 AT_DATA([sys-file.sps], [dnl
2404 GET FILE='sys-file.sav'.
2406 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2407 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2412 AT_SETUP([wrong special floating point values])
2413 AT_KEYWORDS([sack synthetic system file negative])
2414 AT_DATA([sys-file.sack], [dnl
2416 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2417 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2419 dnl Numeric variable, no label or missing values.
2420 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2422 dnl Machine floating-point info record.
2423 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2425 dnl Character encoding record.
2426 7; 20; 1; 12; "windows-1252";
2428 dnl End of dictionary.
2431 for variant in be le; do
2432 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2433 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2435 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2436 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2438 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2440 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2445 AT_SETUP([unknown variables in variable sets])
2446 AT_KEYWORDS([sack synthetic system file negative set])
2447 AT_DATA([sys-file.sack], [dnl
2449 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2451 10; dnl Nominal case size
2452 0; dnl Not compressed
2456 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2460 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2461 2; 0; 0; 0; 0x050800 *2; s8 "B";
2462 2; 0; 0; 0; 0x050800 *2; s8 "C";
2465 2; 0; 0; 0; 0x050800 *2; s8 "D";
2466 2; 0; 0; 0; 0x050800 *2; s8 "E";
2467 2; 0; 0; 0; 0x050800 *2; s8 "F";
2468 2; 0; 0; 0; 0x050800 *2; s8 "G";
2471 2; 4; 0; 0; 0x010400 *2; s8 "H";
2472 2; 4; 0; 0; 0x010400 *2; s8 "I";
2473 2; 4; 0; 0; 0x010400 *2; s8 "J";
2475 dnl Machine integer info record.
2476 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2480 "Variable Set 1= "; i8 0x82; i8 0xa0; " "; >>"xyzzy"<<; " b c"; i8 10;
2481 "vs2=d "; >>"foo"<<; " e f g"; i8 10;);
2483 dnl Character encoding record.
2484 7; 20; 1; 9; "shift_jis";
2486 dnl Dictionary termination record.
2489 for variant in be le; do
2490 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2491 AT_DATA([sys-file.sps], [dnl
2492 GET FILE='sys-file.sav'.
2494 DISPLAY VARIABLE SETS.
2496 AT_CHECK([pspp --testing-mode -O box=unicode sys-file.sps], [0], [dnl
2497 warning: `sys-file.sav' near offset 0x228: Variable set Variable Set 1 contains
2498 unknown variable xyzzy.
2500 warning: `sys-file.sav' near offset 0x228: Variable set vs2 contains unknown
2504 ╭────┬────────┬────────────┬────────────╮
2505 │Name│Position│Print Format│Write Format│
2506 ├────┼────────┼────────────┼────────────┤
2517 ╰────┴────────┴────────────┴────────────╯
2520 ╭──────────────────────────┬────────╮
2521 │Variable Set and Position │Variable│
2522 ├──────────────────────────┼────────┤
2523 │Variable Set 1 1 │あ │
2526 ├──────────────────────────┼────────┤
2531 ╰──────────────────────────┴────────╯
2536 AT_SETUP([bad mrsets name])
2537 AT_KEYWORDS([sack synthetic system file negative multiple response])
2538 AT_DATA([sys-file.sack], [dnl
2540 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2542 16; dnl Nominal case size
2543 0; dnl Not compressed
2547 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2551 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2552 2; 0; 0; 0; 0x050800 *2; s8 "B";
2553 2; 0; 0; 0; 0x050800 *2; s8 "C";
2556 2; 0; 0; 0; 0x050800 *2; s8 "D";
2557 2; 0; 0; 0; 0x050800 *2; s8 "E";
2558 2; 0; 0; 0; 0x050800 *2; s8 "F";
2559 2; 0; 0; 0; 0x050800 *2; s8 "G";
2562 2; 4; 0; 0; 0x010400 *2; s8 "H";
2563 2; 4; 0; 0; 0x010400 *2; s8 "I";
2564 2; 4; 0; 0; 0x010400 *2; s8 "J";
2567 2; 0; 0; 0; 0x050800 *2; s8 "K";
2568 2; 0; 0; 0; 0x050800 *2; s8 "L";
2569 2; 0; 0; 0; 0x050800 *2; s8 "M";
2572 2; 6; 0; 0; 0x010600 *2; s8 "N";
2573 2; 6; 0; 0; 0x010600 *2; s8 "O";
2574 2; 6; 0; 0; 0x010600 *2; s8 "P";
2576 dnl Machine integer info record.
2577 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2581 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2582 "b=D2 55 0 g e f d"; i8 10;
2583 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2587 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2588 "e=E 11 6 choice 0 n o p"; i8 10);
2590 dnl Character encoding record.
2591 7; 20; 1; 9; "shift_jis";
2593 dnl Dictionary termination record.
2596 for variant in be le; do
2597 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2598 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2599 MRSETS /DISPLAY NAME=ALL.
2601 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2602 warning: `sys-file.sav': Invalid multiple response set name `b'.
2604 warning: `sys-file.sav': Invalid multiple response set name `e'.
2606 Table: Multiple Response Sets
2607 Name,Label,Encoding,Counted Value,Member Variables
2608 $a,my mcgroup,Categories,,"あ
2611 $c,mdgroup #2,Dichotomies,はい,"h
2614 $d,third mdgroup,Dichotomies,34,"k
2621 AT_SETUP([missing space after C in mrsets])
2622 AT_KEYWORDS([sack synthetic system file negative multiple response])
2623 AT_DATA([sys-file.sack], [dnl
2625 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2626 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2628 dnl Numeric variable, no label or missing values.
2629 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2631 dnl Multiple response sets.
2632 7; 7; 1; COUNT("$a=Cx");
2634 dnl Character encoding record.
2635 7; 20; 1; 12; "windows-1252";
2639 for variant in be le; do
2640 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2641 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2643 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2644 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2649 AT_SETUP([missing space after E in mrsets])
2650 AT_KEYWORDS([sack synthetic system file negative multiple response])
2651 AT_DATA([sys-file.sack], [dnl
2653 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2654 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2656 dnl Numeric variable, no label or missing values.
2657 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2659 dnl Multiple response sets.
2660 7; 7; 1; COUNT("$a=Ex");
2662 dnl Character encoding record.
2663 7; 20; 1; 12; "windows-1252";
2667 for variant in be le; do
2668 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2669 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2671 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2672 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2677 AT_SETUP([missing label source in mrsets])
2678 AT_KEYWORDS([sack synthetic system file negative multiple response])
2679 AT_DATA([sys-file.sack], [dnl
2681 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2682 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2684 dnl Numeric variable, no label or missing values.
2685 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2687 dnl Multiple response sets.
2688 7; 7; 1; COUNT("$a=E ");
2690 dnl Character encoding record.
2691 7; 20; 1; 12; "windows-1252";
2695 for variant in be le; do
2696 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2697 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2699 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2700 warning: `sys-file.sav' near offset 0xd8: Missing label source value following `E' at offset 5 in MRSETS record.
2702 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 5 in MRSETS record.
2707 AT_SETUP([unexpected label source in mrsets])
2708 AT_KEYWORDS([sack synthetic system file negative multiple response])
2709 AT_DATA([sys-file.sack], [dnl
2711 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2712 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2714 dnl Numeric variable, no label or missing values.
2715 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2717 dnl Multiple response sets.
2718 7; 7; 1; COUNT("$a=E 2");
2720 dnl Character encoding record.
2721 7; 20; 1; 12; "windows-1252";
2725 for variant in be le; do
2726 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2727 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2729 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2730 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2732 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2737 AT_SETUP([bad type character in mrsets])
2738 AT_KEYWORDS([sack synthetic system file negative multiple response])
2739 AT_DATA([sys-file.sack], [dnl
2741 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2742 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2744 dnl Numeric variable, no label or missing values.
2745 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2747 dnl Multiple response sets.
2748 7; 7; 1; COUNT("$a=");
2750 dnl Character encoding record.
2751 7; 20; 1; 12; "windows-1252";
2755 for variant in be le; do
2756 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2757 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2759 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2760 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2765 AT_SETUP([bad counted string length in mrsets])
2766 AT_KEYWORDS([sack synthetic system file negative multiple response])
2767 AT_DATA([sys-file.sack], [dnl
2769 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2770 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2772 dnl Numeric variable, no label or missing values.
2773 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2775 dnl Multiple response sets.
2776 7; 7; 1; COUNT("$a=Dx");
2778 dnl Character encoding record.
2779 7; 20; 1; 12; "windows-1252";
2783 for variant in be le; do
2784 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2785 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2787 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2788 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2793 AT_SETUP([missing space in counted string in mrsets])
2794 AT_KEYWORDS([sack synthetic system file negative multiple response])
2795 AT_DATA([sys-file.sack], [dnl
2797 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2798 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2800 dnl Numeric variable, no label or missing values.
2801 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2803 dnl Multiple response sets.
2804 7; 7; 1; COUNT("$a=D1x");
2806 dnl Character encoding record.
2807 7; 20; 1; 12; "windows-1252";
2811 for variant in be le; do
2812 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2813 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2815 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2816 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2821 AT_SETUP([counted string too long in mrsets])
2822 AT_KEYWORDS([sack synthetic system file negative multiple response])
2823 AT_DATA([sys-file.sack], [dnl
2825 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2826 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2828 dnl Numeric variable, no label or missing values.
2829 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2831 dnl Multiple response sets.
2832 7; 7; 1; COUNT("$a=D4 abc");
2834 dnl Character encoding record.
2835 7; 20; 1; 12; "windows-1252";
2839 for variant in be le; do
2840 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2841 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2843 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2844 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2849 AT_SETUP([missing space after counted string in mrsets])
2850 AT_KEYWORDS([sack synthetic system file negative multiple response])
2851 AT_DATA([sys-file.sack], [dnl
2853 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2854 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2856 dnl Numeric variable, no label or missing values.
2857 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2859 dnl Multiple response sets.
2860 7; 7; 1; COUNT("$a=D3 abcx");
2862 dnl Character encoding record.
2863 7; 20; 1; 12; "windows-1252";
2867 for variant in be le; do
2868 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2869 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2871 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2872 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2877 AT_SETUP([missing newline after variable name in mrsets])
2878 AT_KEYWORDS([sack synthetic system file negative multiple response])
2879 AT_DATA([sys-file.sack], [dnl
2881 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2882 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2884 dnl Numeric variable, no label or missing values.
2885 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2887 dnl Multiple response sets.
2888 7; 7; 1; COUNT("$a=C 0 NUM1");
2890 dnl Character encoding record.
2891 7; 20; 1; 12; "windows-1252";
2895 for variant in be le; do
2896 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2897 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2899 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2900 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2902 warning: `sys-file.sav': MRSET $a has only one variable.
2907 AT_SETUP([duplicate variable name in mrsets])
2908 AT_KEYWORDS([sack synthetic system file negative multiple response])
2909 AT_DATA([sys-file.sack], [dnl
2911 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2912 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2914 dnl Numeric variable, no label or missing values.
2915 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2917 dnl Multiple response sets.
2918 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2920 dnl Character encoding record.
2921 7; 20; 1; 12; "windows-1252";
2925 for variant in be le; do
2926 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2927 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2929 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2930 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2932 warning: `sys-file.sav': MRSET $a has only one variable.
2937 AT_SETUP([mixed variable types in mrsets])
2938 AT_KEYWORDS([sack synthetic system file negative multiple response])
2939 AT_DATA([sys-file.sack], [dnl
2941 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2942 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2945 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2946 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2948 dnl Multiple response sets.
2949 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2951 dnl Character encoding record.
2952 7; 20; 1; 12; "windows-1252";
2956 for variant in be le; do
2957 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2958 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2960 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2961 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2963 warning: `sys-file.sav': MRSET $a has only one variable.
2968 AT_SETUP([missing newline after variable name in mrsets])
2969 AT_KEYWORDS([sack synthetic system file negative multiple response])
2970 AT_DATA([sys-file.sack], [dnl
2972 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2973 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2975 dnl Numeric variable, no label or missing values.
2976 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2978 dnl Multiple response sets.
2979 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2981 dnl Character encoding record.
2982 7; 20; 1; 12; "windows-1252";
2986 for variant in be le; do
2987 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2988 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2990 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2991 warning: `sys-file.sav': MRSET $a has only one variable.
2996 AT_SETUP([zero or one variable in mrset])
2997 AT_KEYWORDS([sack synthetic system file negative multiple response])
2998 AT_DATA([sys-file.sack], [dnl
3000 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3001 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3003 dnl Numeric variable, no label or missing values.
3004 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3006 dnl Multiple response sets.
3007 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
3009 dnl Character encoding record.
3010 7; 20; 1; 12; "windows-1252";
3014 for variant in be le; do
3015 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3016 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3018 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3019 warning: `sys-file.sav': MRSET $a has only one variable.
3021 warning: `sys-file.sav': MRSET $b has no variables.
3026 AT_SETUP([wrong display parameter size])
3027 AT_KEYWORDS([sack synthetic system file negative])
3028 AT_DATA([sys-file.sack], [dnl
3030 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3031 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3033 dnl Numeric variable, no label or missing values.
3034 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3036 dnl Display parameters record.
3037 7; 11; >>8<<; 2; 1.0; 1.0;
3039 dnl Character encoding record.
3040 7; 20; 1; 12; "windows-1252";
3042 dnl End of dictionary.
3045 for variant in be le; do
3046 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3047 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3049 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3050 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
3055 AT_SETUP([wrong display parameter count])
3056 AT_KEYWORDS([sack synthetic system file negative])
3057 AT_DATA([sys-file.sack], [dnl
3059 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3060 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3062 dnl Numeric variable, no label or missing values.
3063 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3065 dnl Display parameters record.
3066 7; 11; 4; >>4<<; 1; 1; 2; 2;
3068 dnl Character encoding record.
3069 7; 20; 1; 12; "windows-1252";
3071 dnl End of dictionary.
3074 for variant in be le; do
3075 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3076 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3078 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3079 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
3084 AT_SETUP([wrong display measurement level])
3085 AT_KEYWORDS([sack synthetic system file negative])
3086 AT_DATA([sys-file.sack], [dnl
3088 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3089 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3091 dnl Numeric variable, no label or missing values.
3092 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3094 dnl Display parameters record.
3095 7; 11; 4; 2; >>4<<; 0;
3097 dnl Character encoding record.
3098 7; 20; 1; 12; "windows-1252";
3100 dnl End of dictionary.
3103 for variant in be le; do
3104 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3105 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3107 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3108 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3113 AT_SETUP([wrong display alignment])
3114 AT_KEYWORDS([sack synthetic system file negative])
3115 AT_DATA([sys-file.sack], [dnl
3117 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3118 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3120 dnl Numeric variable, no label or missing values.
3121 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3123 dnl Display parameters record.
3124 7; 11; 4; 2; 1; >>-1<<;
3126 dnl Character encoding record.
3127 7; 20; 1; 12; "windows-1252";
3129 dnl End of dictionary.
3132 for variant in be le; do
3133 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3134 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3136 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3137 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3142 AT_SETUP([bad variable name in variable/value pair])
3143 AT_KEYWORDS([sack synthetic system file negative])
3144 AT_DATA([sys-file.sack], [dnl
3146 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3147 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3149 dnl Numeric variables.
3150 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3152 dnl Long variable names.
3153 7; 13; 1; COUNT (>>"xyzzy"<<);
3155 dnl Character encoding record.
3156 7; 20; 1; 12; "windows-1252";
3158 dnl Dictionary termination record.
3161 for variant in be le; do
3162 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3163 AT_DATA([sys-file.sps], [dnl
3164 GET FILE='sys-file.sav'.
3166 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3167 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
3172 AT_SETUP([duplicate long variable name])
3173 AT_KEYWORDS([sack synthetic system file negative])
3174 AT_DATA([sys-file.sack], [dnl
3176 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3177 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3179 dnl Numeric variables.
3180 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3181 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
3182 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
3183 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
3185 dnl Long variable names.
3187 "LONGVARI=_Invalid"; i8 9;
3188 "LONGVARI=$Invalid"; i8 9;
3189 "LONGVARI=#Invalid"; i8 9;
3190 "LONGVA_A=LongVariableName"; i8 9;
3191 "LONGVA_B=LONGVARIABLENAME"; i8 9;
3194 dnl Character encoding record.
3195 7; 20; 1; 12; "windows-1252";
3197 dnl Dictionary termination record.
3200 for variant in be le; do
3201 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3202 AT_DATA([sys-file.sps], [dnl
3203 GET FILE='sys-file.sav'.
3205 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3206 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3208 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `$Invalid'.
3210 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `#Invalid'.
3212 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3217 AT_SETUP([bad very long string length])
3218 AT_KEYWORDS([sack synthetic system file negative])
3219 AT_DATA([sys-file.sack], [dnl
3221 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3222 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3224 dnl Numeric variable.
3225 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3227 dnl Very long string map.
3229 "NUM1=00000"; i8 0; i8 9;
3230 "NUM1=00255"; i8 0; i8 9;
3231 "NUM1=00256"; i8 0; i8 9;
3234 dnl Character encoding record.
3235 7; 20; 1; 12; "windows-1252";
3237 dnl Dictionary termination record.
3240 for variant in be le; do
3241 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3242 AT_DATA([sys-file.sps], [dnl
3243 GET FILE='sys-file.sav'.
3245 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3246 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3248 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3250 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3255 AT_SETUP([bad very long string segment width])
3256 AT_KEYWORDS([sack synthetic system file negative])
3257 AT_DATA([sys-file.sack], [dnl
3259 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3260 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3263 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3264 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3265 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3266 >>2; -1; 0; 0; 0; 0; s8 "";<<
3268 dnl Very long string map.
3270 "STR1=00256"; i8 0; i8 9;
3273 dnl Character encoding record.
3274 7; 20; 1; 12; "windows-1252";
3276 dnl Dictionary termination record.
3279 for variant in be le; do
3280 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3281 AT_DATA([sys-file.sps], [dnl
3282 GET FILE='sys-file.sav'.
3284 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3285 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3290 AT_SETUP([too many value labels])
3291 AT_KEYWORDS([sack synthetic system file negative])
3292 AT_DATA([sys-file.sack], [dnl
3294 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3295 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3297 dnl Numeric variable.
3298 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3301 for variant in be le; do
3302 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3303 AT_DATA([sys-file.sps], [dnl
3304 GET FILE='sys-file.sav'.
3306 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3307 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3312 AT_SETUP([missing type 4 record])
3313 AT_KEYWORDS([sack synthetic system file negative])
3314 AT_DATA([sys-file.sack], [dnl
3316 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3317 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3319 dnl Numeric variable.
3320 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3322 dnl Value label with missing type 4 record.
3323 3; 1; 1.0; i8 3; s7 "one";
3325 dnl Character encoding record.
3326 7; 20; 1; 12; "windows-1252";
3328 dnl End of dictionary.
3331 for variant in be le; do
3332 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3333 AT_DATA([sys-file.sps], [dnl
3334 GET FILE='sys-file.sav'.
3336 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3337 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3342 AT_SETUP([value label with no associated variables])
3343 AT_KEYWORDS([sack synthetic system file negative])
3344 AT_DATA([sys-file.sack], [dnl
3346 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3347 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3349 dnl Numeric variable.
3350 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3352 dnl Value label with no variables.
3353 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3355 for variant in be le; do
3356 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3357 AT_DATA([sys-file.sps], [dnl
3358 GET FILE='sys-file.sav'.
3360 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3361 error: `sys-file.sav' near offset 0xec: Number of variables associated with a value label (0) is not between 1 and the number of variables (1).
3366 AT_SETUP([type 4 record names long string variable])
3367 AT_KEYWORDS([sack synthetic system file negative])
3368 AT_DATA([sys-file.sack], [dnl
3370 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3371 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3373 dnl Long string variable.
3374 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3375 2; -1; 0; 0; 0; 0; s8 "";
3377 dnl Value label that names long string variable.
3378 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3380 dnl Character encoding record.
3381 7; 20; 1; 12; "windows-1252";
3383 dnl End of dictionary.
3386 for variant in be le; do
3387 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3388 AT_DATA([sys-file.sps], [dnl
3389 GET FILE='sys-file.sav'.
3391 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3392 warning: `sys-file.sav' near offset 0xf4: Value labels may not be added to long string variables (e.g. STR1) using records types 3 and 4.
3397 AT_SETUP([value label variable indexes must be in correct range])
3398 AT_KEYWORDS([sack synthetic system file negative])
3399 AT_DATA([sys-file.sack], [dnl
3401 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3402 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3405 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3406 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3408 dnl Value labels with bad variable indexes.
3409 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>3; 4;<<
3410 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>5; 6;<<
3411 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>7; 8;<<
3413 dnl Character encoding record.
3414 7; 20; 1; 12; "windows-1252";
3416 dnl End of dictionary.
3419 for variant in be le; do
3420 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3421 AT_DATA([sys-file.sps], [dnl
3422 GET FILE='sys-file.sav'.
3424 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3425 warning: `sys-file.sav' near offset 0xf4: Value label variable index 3 not in valid range 1...2.
3427 warning: `sys-file.sav' near offset 0xf4: Value label variable index 4 not in valid range 1...2.
3429 warning: `sys-file.sav' near offset 0x11c: Value label variable index 5 not in valid range 1...2.
3431 warning: `sys-file.sav' near offset 0x11c: Value label variable index 6 not in valid range 1...2.
3433 warning: `sys-file.sav' near offset 0x144: Value label variable index 7 not in valid range 1...2.
3435 warning: `sys-file.sav': Suppressed 1 additional warnings for value labels.
3440 AT_SETUP([value label variable indexes must not be long string continuation])
3441 AT_KEYWORDS([sack synthetic system file negative])
3442 AT_DATA([sys-file.sack], [dnl
3444 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3445 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3447 dnl Long string variable.
3448 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3449 (2; -1; 0; 0; 0; 0; s8 "");
3451 dnl Value label with long string indexes.
3452 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>2;<<
3454 dnl Character encoding record.
3455 7; 20; 1; 12; "windows-1252";
3457 dnl End of dictionary.
3460 for variant in be le; do
3461 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3462 AT_DATA([sys-file.sps], [dnl
3463 GET FILE='sys-file.sav'.
3465 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3466 warning: `sys-file.sav' near offset 0xf4: Value label variable index 2 refers to long string continuation.
3471 AT_SETUP([variables for value label must all be same type])
3472 AT_KEYWORDS([sack synthetic system file negative])
3473 AT_DATA([sys-file.sack], [dnl
3475 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3476 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3479 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3480 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3482 dnl Value label that names numeric and string variables.
3483 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3485 dnl Character encoding record.
3486 7; 20; 1; 12; "windows-1252";
3488 dnl End of dictionary.
3491 for variant in be le; do
3492 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3493 AT_DATA([sys-file.sps], [dnl
3494 GET FILE='sys-file.sav'.
3496 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3497 "warning: `sys-file.sav' near offset 0xf4: Variables associated with value label are not all of identical type. Variable STR1 is string, but variable NUM1 is numeric."
3502 AT_SETUP([duplicate value labels type])
3503 AT_KEYWORDS([sack synthetic system file negative])
3504 AT_DATA([sys-file.sack], [dnl
3506 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3507 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3510 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3511 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3513 dnl Duplicate value labels.
3514 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3515 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3517 dnl Character encoding record.
3518 7; 20; 1; 12; "windows-1252";
3520 dnl End of dictionary.
3523 for variant in be le; do
3524 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3525 AT_DATA([sys-file.sps], [dnl
3526 GET FILE='sys-file.sav'.
3528 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3529 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3531 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3536 AT_SETUP([missing attribute value])
3537 AT_KEYWORDS([sack synthetic system file negative])
3538 AT_DATA([sys-file.sack], [dnl
3540 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3541 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3544 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3546 dnl Data file attributes record.
3551 dnl Variable attributes record.
3557 dnl Character encoding record.
3558 7; 20; 1; 12; "windows-1252";
3560 dnl Dictionary termination record.
3563 for variant in be le; do
3564 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3565 AT_DATA([sys-file.sps], [dnl
3566 GET FILE='sys-file.sav'.
3568 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3569 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3571 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3576 AT_SETUP([unquoted attribute value])
3577 AT_KEYWORDS([sack synthetic system file negative])
3578 AT_DATA([sys-file.sack], [dnl
3580 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3581 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3584 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3586 dnl Data file attributes record.
3588 "Attr1(value"; i8 10;
3592 dnl Variable attributes record.
3595 "fred(23"; i8 10; ")"
3598 dnl Character encoding record.
3599 7; 20; 1; 12; "windows-1252";
3601 dnl Dictionary termination record.
3604 for variant in be le; do
3605 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3606 AT_DATA([sys-file.sps], [dnl
3607 GET FILE='sys-file.sav'.
3609 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3610 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3612 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3617 AT_SETUP([duplicate attribute name])
3618 AT_KEYWORDS([sack synthetic system file negative])
3619 AT_DATA([sys-file.sack], [dnl
3621 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3622 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3625 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3627 dnl Data file attributes record.
3629 "Attr1('value'"; i8 10; ")";
3630 "Attr1('value'"; i8 10; ")";
3633 dnl Variable attributes record.
3636 "fred('23'"; i8 10; ")";
3637 "fred('23'"; i8 10; ")";
3640 dnl Character encoding record.
3641 7; 20; 1; 12; "windows-1252";
3643 dnl Dictionary termination record.
3646 for variant in be le; do
3647 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3648 AT_DATA([sys-file.sps], [dnl
3649 GET FILE='sys-file.sav'.
3651 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3652 warning: `sys-file.sav' near offset 0xf6: Duplicate attribute Attr1.
3654 warning: `sys-file.sav' near offset 0x125: Duplicate attribute fred.
3659 AT_SETUP([bad variable name in long string value label])
3660 AT_KEYWORDS([sack synthetic system file negative])
3661 AT_DATA([sys-file.sack], [dnl
3663 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3664 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3667 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3668 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3669 2; -1; 0; 0; 0; 0; s8 "";
3672 dnl No variable named STR9.
3673 COUNT(>>"STR9"<<); 9;
3674 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3676 dnl NUM1 is numeric.
3677 COUNT(>>"NUM1"<<); 0;
3678 1; COUNT("xyz"); COUNT("value label for 1.0");
3680 dnl Wrong width for STR14.
3681 COUNT("STR14"); >>9<<;
3682 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3684 dnl Wrong width for value.
3686 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3688 dnl Duplicate value label.
3689 COUNT("STR14"); 14; 2;
3690 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3691 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3694 dnl Character encoding record.
3695 7; 20; 1; 12; "windows-1252";
3697 dnl Dictionary termination record.
3700 for variant in be le; do
3701 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3702 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3704 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3705 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3707 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3709 warning: `sys-file.sav' near offset 0x193: Ignoring long string value label record for variable STR14 because the record's width (9) does not match the variable's width (14).
3711 "warning: `sys-file.sav' near offset 0x1d4: Ignoring long string value label 0 for variable str14, with width 14, that has bad value width 9."
3713 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3718 AT_SETUP([fewer data records than indicated by file header])
3719 AT_KEYWORDS([sack synthetic system file negative])
3720 AT_DATA([sys-file.sack], [dnl
3722 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3723 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3725 dnl Numeric variables.
3726 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3727 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3729 dnl Character encoding record.
3730 7; 20; 1; 12; "windows-1252";
3738 dnl Missing record here.
3740 for variant in be le; do
3741 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3742 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3745 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3746 [error: Error reading case from file `sys-file.sav'.
3758 AT_SETUP([partial data record between variables])
3759 AT_KEYWORDS([sack synthetic system file negative])
3760 AT_DATA([sys-file.sack], [dnl
3762 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3763 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3765 dnl Numeric variables.
3766 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3767 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3769 dnl Character encoding record.
3770 7; 20; 1; 12; "windows-1252";
3777 for variant in be le; do
3778 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3779 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3782 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3783 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3792 AT_SETUP([partial data record within long string])
3793 AT_KEYWORDS([sack synthetic system file negative])
3794 AT_DATA([sys-file.sack], [dnl
3796 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3797 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3799 dnl Numeric variables.
3800 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3801 2; -1; 0; 0; 0; 0; s8 "";
3803 dnl Character encoding record.
3804 7; 20; 1; 12; "windows-1252";
3808 s14 "one data item";
3811 for variant in be le; do
3812 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3813 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3816 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3817 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3826 AT_SETUP([partial compressed data record])
3827 AT_KEYWORDS([sack synthetic system file positive])
3828 AT_DATA([sys-file.sack], [dnl
3830 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3832 6; dnl Nominal case size
3835 -1; dnl Unspecified number of cases.
3837 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3840 dnl Numeric variables.
3841 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3842 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3844 dnl String variable.
3845 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3846 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3847 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3848 2; -1; 0; 0; 0; 0; s8 "";
3850 dnl Character encoding record.
3851 7; 20; 1; 12; "windows-1252";
3853 dnl Dictionary termination record.
3856 dnl Compressed data.
3857 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3859 for variant in be le; do
3860 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3861 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3864 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3865 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3868 num1,num2,str4,str8,str15
3869 -99,0,,abcdefgh,0123
3874 AT_SETUP([zcompressed data - bad zheader_ofs])
3875 AT_KEYWORDS([sack synthetic system file negative zlib])
3876 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3877 for variant in be le; do
3878 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3879 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3881 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Wrong ZLIB data header offset 0 (expected 0x194).
3886 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3887 AT_KEYWORDS([sack synthetic system file negative zlib])
3888 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3889 for variant in be le; do
3890 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3891 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3893 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3898 # ztrailer_len must be a multiple of 24 and at least 48,
3899 # so a value of 12 is impossible.
3900 AT_SETUP([zcompressed data - invalid ztrailer_len])
3901 AT_KEYWORDS([sack synthetic system file negative zlib])
3902 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3903 for variant in be le; do
3904 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3905 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3907 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3912 # ztrailer_ofs + ztrailer_len must be the file size.
3913 AT_SETUP([zcompressed data - wrong ztrailer_len])
3914 AT_KEYWORDS([sack synthetic system file negative zlib])
3915 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3916 for variant in be le; do
3917 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3918 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3920 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [warning: `sys-file.sav' near offset 0x1ac: End of ZLIB trailer (0x24d) is not file size (0x235).
3921 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3926 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3927 AT_KEYWORDS([sack synthetic system file negative zlib])
3928 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3929 for variant in be le; do
3930 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3931 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3933 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x20d: ZLIB trailer bias (0) differs from file header bias (100.00).
3938 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3939 AT_KEYWORDS([sack synthetic system file negative zlib])
3940 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3941 for variant in be le; do
3942 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3943 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3945 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x215: ZLIB trailer "zero" field has nonzero value 100.
3950 AT_SETUP([zcompressed data - wrong block_size])
3951 AT_KEYWORDS([sack synthetic system file negative zlib])
3952 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3953 for variant in be le; do
3954 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3955 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3957 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x219: ZLIB trailer specifies unexpected 4096-byte block size.
3962 AT_SETUP([zcompressed data - wrong n_blocks])
3963 AT_KEYWORDS([sack synthetic system file negative zlib])
3964 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3965 for variant in be le; do
3966 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3967 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3969 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: 48-byte ZLIB trailer specifies 2 data blocks (expected 1).
3974 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3975 AT_KEYWORDS([sack synthetic system file negative zlib])
3976 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3977 for variant in be le; do
3978 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3979 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3981 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported uncompressed data offset 0x177, when 0x194 was expected.
3986 AT_SETUP([zcompressed data - wrong compressed_ofs])
3987 AT_KEYWORDS([sack synthetic system file negative zlib])
3988 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3989 for variant in be le; do
3990 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3991 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3993 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported compressed data offset 0x191, when 0x1ac was expected.
3998 AT_SETUP([zcompressed data - compressed sizes don't add up])
3999 AT_KEYWORDS([sack synthetic system file negative zlib])
4000 AT_DATA([sys-file.sack], [dnl
4002 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
4004 6; dnl Nominal case size
4005 2; dnl zlib compressed
4007 -1; dnl Unspecified number of cases.
4009 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
4012 dnl Numeric variables.
4013 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
4014 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
4016 dnl String variable.
4017 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
4018 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
4019 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
4020 2; -1; 0; 0; 0; 0; s8 "";
4022 dnl Character encoding record.
4023 7; 20; 1; 12; "windows-1252";
4025 dnl Dictionary termination record.
4028 dnl ZLIB data header.
4029 i64 0x194; # zheader_ofs
4030 i64 0x1ac; # ztrailer_ofs
4031 i64 72; # ztrailer_len
4033 dnl This is where the ZLIB data blocks would go, but we don't need any to
4034 dnl provoke this message so we omit them.
4036 dnl ZLIB data trailer fixed header:
4037 i64 -100; # ztrailer_bias
4038 i64 0; # ztrailer_zero
4039 0x3ff000; # block_size
4042 dnl ZLIB block descriptor 1:
4043 i64 0x194; # uncompressed_ofs
4044 i64 0x1ac; # compressed_ofs
4045 0x100000; # uncompressed_size
4046 0x12345; # compressed_size
4048 dnl ZLIB block descriptor 2:
4049 i64 0x100194; # uncompressed_ofs
4050 i64 0x12421; # compressed_ofs
4051 0x100000; # uncompressed_size
4052 0x12345; # compressed_size
4054 for variant in be le; do
4055 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
4056 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
4058 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [warning: `sys-file.sav' near offset 0x1c4: ZLIB block descriptor 0 reported block size 0x100000, when 0x3ff000 was expected.
4059 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
4064 AT_SETUP([zcompressed data - uncompressed_size > block_size])
4065 AT_KEYWORDS([sack synthetic system file negative zlib])
4066 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
4067 for variant in be le; do
4068 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
4069 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
4071 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported block size 0x400000, when at most 0x3ff000 was expected.
4076 AT_SETUP([zcompressed data - compression expands data too much])
4077 AT_KEYWORDS([sack synthetic system file negative zlib])
4078 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
4079 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
4080 for variant in be le; do
4081 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
4082 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
4084 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reports compressed size 100 and uncompressed size 50.
4089 AT_SETUP([zcompressed data - compressed sizes don't add up])
4090 AT_KEYWORDS([sack synthetic system file negative zlib])
4091 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
4092 for variant in be le; do
4093 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
4094 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
4096 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x235: ZLIB trailer is at offset 0x205 but 0x204 would be expected from block descriptors.
4102 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467004.
4103 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
4104 # See also https://security-tracker.debian.org/tracker/CVE-2017-10791.
4105 # Found by team OWL337, using the collAFL fuzzer.
4106 AT_SETUP([integer overflows in long string missing values])
4107 AT_KEYWORDS([system file negative])
4108 cp $top_srcdir/tests/data/CVE-2017-10791.sav .
4109 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10791.sav -], [0], [], [dnl
4110 `CVE-2017-10791.sav' near offset 0x217: Extension record subtype 21 ends unexpectedly.
4115 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467005.
4116 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
4117 # See also https://security-tracker.debian.org/tracker/CVE-2017-10792.
4118 # Reported by team OWL337, with fuzzer collAFL.
4119 AT_SETUP([null dereference skipping bad extension record 18])
4120 AT_KEYWORDS([system file negative])
4121 cp $top_srcdir/tests/data/CVE-2017-10792.sav .
4122 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10792.sav -], [0], [], [dnl
4123 `CVE-2017-10792.sav' near offset 0x1c0: Record type 7, subtype 18 has bad size 4 (expected 1).