1 AT_BANNER([system file reader - positive])
3 AT_SETUP([variable labels and missing values])
4 AT_KEYWORDS([sack synthetic system file positive])
5 AT_DATA([sys-file.sack], [dnl
7 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
9 28; dnl Nominal case size
14 "01 Jan 11"; "20:53:52";
15 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
18 dnl Numeric variable, no label or missing values.
19 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
21 dnl Numeric variable, variable label.
22 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
23 32; "Numeric variable 2's label ("; i8 249; i8 250; i8 251; ")";
25 dnl Numeric variable, one missing value.
26 2; 0; 0; 1; 0x050800 *2; s8 "NUM3";
29 dnl Numeric variable, variable label and missing value.
30 2; 0; 1; 1; 0x050800 *2; s8 "NUM4";
31 30; "Another numeric variable label"; i8 0 * 2;
34 dnl Numeric variable, two missing values.
35 2; 0; 0; 2; 0x050800 *2; s8 "NUM5"; 1.0; 2.0;
37 dnl Numeric variable, three missing values.
38 2; 0; 0; 3; 0x050800 *2; s8 "NUM6"; 1.0; 2.0; 3.0;
40 dnl Numeric variable, range of missing values.
41 2; 0; 0; -2; 0x050800 *2; s8 "NUM7"; 1.0; 3.0;
43 dnl Numeric variables, range of missing values plus discrete value.
44 2; 0; 0; -3; 0x050800 *2; s8 "NUM8"; 1.0; 3.0; 5.0;
45 2; 0; 0; -3; 0x050800 *2; s8 "NUM9"; 1.0; HIGHEST; -5.0;
46 2; 0; 0; -3; 0x050800 *2; "NUM"; i8 192; i8 200; i8 204; i8 209; i8 210;
49 dnl String variable, no label or missing values.
50 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
52 dnl String variable, variable label.
53 2; 4; 1; 0; 0x010400 *2; s8 "STR2";
54 25; "String variable 2's label"; i8 0 * 3;
56 dnl String variable, one missing value.
57 2; 4; 0; 1; 0x010400 *2; s8 "STR3"; s8 "MISS";
59 dnl String variable, variable label and missing value.
60 2; 4; 1; 1; 0x010400 *2; s8 "STR4";
61 29; "Another string variable label"; i8 0 * 3;
64 dnl String variable, two missing values.
65 2; 4; 0; 2; 0x010400 *2; s8 "STR5"; s8 "MISS"; s8 "OTHR";
67 dnl String variable, three missing values.
68 2; 4; 0; 3; 0x010400 *2; s8 "STR6"; s8 "MISS"; s8 "OTHR"; s8 "MORE";
70 dnl Long string variable, one missing value.
71 dnl (This is not how SPSS represents missing values for long strings--it
72 dnl uses a separate record as shown later below--but old versions of PSPP
73 dnl did use this representation so we continue supporting it for backward
75 2; 11; 0; 1; 0x010b00 *2; s8 "STR7"; "first8by";
76 2; -1; 0; 0; 0; 0; s8 "";
78 dnl Long string variables that will have missing values added with a
80 2; 9; 0; 0; 0x010900 *2; s8 "STR8";
81 2; -1; 0; 0; 0; 0; s8 "";
82 2; 10; 0; 0; 0x010a00 *2; s8 "STR9";
83 2; -1; 0; 0; 0; 0; s8 "";
84 2; 11; 0; 0; 0x010b00 *2; s8 "STR10";
85 2; -1; 0; 0; 0; 0; s8 "";
87 dnl Long string variable, value label.
88 2; 25; 1; 0; 0x011900 *2; s8 "STR11"; 14; "25-byte string"; i8 0 * 2;
89 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
90 dnl Variable label fields on continuation records have been spotted in system
91 dnl files created by "SPSS Power Macintosh Release 6.1".
92 2; -1; 1; 0; 0; 0; s8 ""; 20; "dummy variable label";
94 dnl Machine integer info record.
95 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
97 dnl Machine floating-point info record.
98 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
100 dnl Long string variable missing values record.
102 dnl One missing value for STR8.
103 COUNT("STR8"); i8 1; 8; "abcdefgh";
105 dnl Two missing values for STR9.
106 COUNT("STR9"); i8 2; 8; "abcdefgh"; 8; "01234567";
108 dnl Three missing values for STR9.
109 COUNT("STR10"); i8 3; 8; "abcdefgh"; 8; "01234567"; 8; "0 ";
112 dnl Character encoding record.
113 7; 20; 1; 12; "windows-1252";
115 dnl Dictionary termination record.
119 1.0; 2.0; 3.0; 4.0; 5.0; 6.0; 7.0; 8.0; 9.0; 10.0;
120 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
121 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
122 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
124 for variant in be le; do
125 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
126 AT_DATA([sys-file.sps], [dnl
127 GET FILE='sys-file.sav'.
132 AT_CHECK([pspp -o pspp.csv sys-file.sps])
133 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
134 File label: PSPP synthetic test file: ôõöø
136 Variable,Description,,Position
138 num2,Label: Numeric variable 2's label (ùúû),,2
142 num4,Label: Another numeric variable label,,4
146 ,Missing Values: 1; 2,,
148 ,Missing Values: 1; 2; 3,,
150 ,Missing Values: 1 THRU 3,,
152 ,Missing Values: 1 THRU 3; 5,,
154 ,Missing Values: 1 THRU HIGHEST; -5,,
155 numàèìñò,Format: F8.0,,10
156 ,Missing Values: LOWEST THRU 1; 5,,
158 str2,Label: String variable 2's label,,12
161 ,"Missing Values: ""MISS""",,
162 str4,Label: Another string variable label,,14
164 ,"Missing Values: ""OTHR""",,
166 ,"Missing Values: ""MISS""; ""OTHR""",,
168 ,"Missing Values: ""MISS""; ""OTHR""; ""MORE""",,
170 ,"Missing Values: ""first8by""",,
172 ,"Missing Values: ""abcdefgh""",,
174 ,"Missing Values: ""abcdefgh""; ""01234567""",,
175 str10,Format: A11,,20
176 ,"Missing Values: ""abcdefgh""; ""01234567""; ""0 """,,
177 str11,Label: 25-byte string,,21
181 num1,num2,num3,num4,num5,num6,num7,num8,num9,numàèìñò,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11
182 1,2,3,4,5,6,7,8,9,10,abcd,efgh,ijkl,mnop,qrst,uvwx,yzABCDEFGHI,JKLMNOPQR,STUVWXYZ01,23456789abc,defghijklmnopqstuvwxyzABC
187 AT_SETUP([unspecified number of variable positions])
188 AT_KEYWORDS([sack synthetic system file positive])
189 AT_DATA([sys-file.sack], [dnl
191 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
193 -1; dnl Nominal case size (unspecified)
194 0; dnl Not compressed
198 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
201 dnl Numeric variable, no label or missing values.
202 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
204 dnl Numeric variable, variable label.
205 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
206 26; "Numeric variable 2's label"; i8 0 *2;
208 dnl Dictionary termination record.
214 for variant in be le; do
215 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
216 AT_DATA([sys-file.sps], [dnl
217 GET FILE='sys-file.sav'.
221 AT_CHECK([pspp -o pspp.csv sys-file.sps])
222 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
223 Variable,Description,,Position
225 num2,Label: Numeric variable 2's label,,2
235 AT_SETUP([wrong number of variable positions but version 13])
236 AT_KEYWORDS([sack synthetic system file positive])
237 AT_DATA([sys-file.sack], [dnl
239 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
241 -1; dnl Nominal case size (unspecified)
242 0; dnl Not compressed
246 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
249 dnl Numeric variable, no label or missing values.
250 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
252 dnl Numeric variable, variable label.
253 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
254 26; "Numeric variable 2's label"; i8 0 *2;
256 dnl Machine integer info record (SPSS 13).
257 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
259 dnl Dictionary termination record.
265 for variant in be le; do
266 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
267 AT_DATA([sys-file.sps], [dnl
268 GET FILE='sys-file.sav'.
272 AT_CHECK([pspp -o pspp.csv sys-file.sps])
273 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
274 Variable,Description,,Position
276 num2,Label: Numeric variable 2's label,,2
286 AT_SETUP([value labels])
287 AT_KEYWORDS([sack synthetic system file positive])
288 AT_DATA([sys-file.sack], [dnl
290 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
292 22; dnl Nominal case size
293 0; dnl Not compressed
297 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
300 dnl Numeric variables.
301 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
302 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
303 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
304 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
305 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
307 dnl String variables.
308 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
309 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
310 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
311 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
312 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
313 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
314 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
315 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
316 2; 9; 0; 0; 0x010900 *2; "STR9"; i8 230; s3 ""; dnl index 14
317 2; -1; 0; 0; 0; 0; s8 "";
318 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
319 2; -1; 0; 0; 0; 0; s8 "";
320 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
321 2; -1; 0; 0; 0; 0; s8 "";
322 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
323 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
325 dnl One value label for NUM1.
326 3; 1; 1.0; i8 17; i8 238; i8 228; i8 232; i8 237; s19 " (in Russian)"; 4; 1; 1;
328 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
329 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
331 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
332 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
333 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
335 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
336 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
337 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
338 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
339 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
340 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
342 dnl One value label for STR1.
343 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
345 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
347 s8 "bc"; i8 20; s23 "value label for `bc'";
348 s8 "de"; i8 20; s23 "value label for `de'";
351 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
352 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
353 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
355 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
356 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
357 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
359 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
360 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
362 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
363 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
365 dnl One value label for STR6, STR7, STR8.
366 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
367 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
368 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
370 dnl Machine integer info record.
371 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1251;
373 dnl Character encoding record.
374 7; 20; 1; 12; "windows-1251";
377 dnl One value label for STR9ж,
378 COUNT("STR9"; i8 230); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
380 dnl Two value labels for STR12.
381 COUNT("STR12"); 12; 2;
382 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
383 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
385 dnl Three value labels for STR16.
386 COUNT("STR16"); 16; 3;
387 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
388 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
389 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789' with Cyrillic letters: `"; i8 244; i8 245; i8 246; "'");
391 dnl One value label for STR17.
392 COUNT("STR17"); 17; 1;
393 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
396 dnl Dictionary termination record.
399 for variant in be le; do
400 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
401 AT_DATA([sys-file.sps], [dnl
402 GET FILE='sys-file.sav'.
405 AT_CHECK([pspp -o pspp.csv sys-file.sps])
406 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
407 Variable,Description,,Position
409 ,1,один (in Russian),
427 ,a,value label for `a',
429 ,bc,value label for `bc',
430 ,de,value label for `de',
432 ,fgh,value label for `fgh',
433 ,ijk,value label for `ijk',
435 ,BCDE,value label for `BCDE',
436 ,lmno,value label for `lmno',
437 ,tuvw,value label for `tuvw',
438 ,xyzA,value label for `xyzA',
440 ,FGHI,value label for `FGHI',
441 ,pqrs,value label for `pqrs',
442 ,tuvw,value label for `tuvw',
443 ,xyzA,value label for `xyzA',
445 ,JKLMNO,value label for `JKLMNO',
447 ,JKLMNOP,value label for `JKLMNOP',
449 ,JKLMNOPQ,value label for `JKLMNOPQ',
451 ,RSTUVWXYZ,value label for `RSTUVWXYZ',
452 str12,Format: A12,,15
453 ,0123456789ab,value label for `0123456789ab',
454 ,cdefghijklmn,value label for `cdefghijklmn',
455 str16,Format: A16,,16
456 ,EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST',
457 ,UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц',
458 ,opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD',
459 str17,Format: A17,,17
460 ,abcdefghijklmnopq,value label for `abcdefghijklmnopq',
465 AT_SETUP([documents])
466 AT_KEYWORDS([sack synthetic system file positive])
467 AT_DATA([sys-file.sack], [dnl
469 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
471 1; dnl Nominal case size
472 0; dnl Not compressed
476 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
479 dnl Numeric variable, no label or missing values.
480 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
482 dnl Machine integer info record.
483 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
487 s80 "First line of documents";
488 s80 "Second line of documents";
489 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
492 s80 "Last line of documents";
494 dnl Character encoding record.
495 7; 20; 1; 12; "windows-1252";
497 dnl Dictionary termination record.
503 for variant in be le; do
504 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
505 AT_DATA([sys-file.sps], [dnl
506 GET FILE='sys-file.sav'.
510 AT_CHECK([pspp -o pspp.csv sys-file.sps])
511 AT_CHECK([cat pspp.csv], [0], [dnl
512 Documents in the active dataset:
514 First line of documents
516 Second line of documents
518 abbé appliqué attaché blasé café canapé cliché consommé
522 Last line of documents
531 AT_SETUP([multiple response sets])
532 AT_KEYWORDS([sack synthetic system file positive])
533 AT_DATA([sys-file.sack], [dnl
535 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
537 16; dnl Nominal case size
538 0; dnl Not compressed
542 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
546 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
547 2; 0; 0; 0; 0x050800 *2; s8 "B";
548 2; 0; 0; 0; 0x050800 *2; s8 "C";
551 2; 0; 0; 0; 0x050800 *2; s8 "D";
552 2; 0; 0; 0; 0x050800 *2; s8 "E";
553 2; 0; 0; 0; 0x050800 *2; s8 "F";
554 2; 0; 0; 0; 0x050800 *2; s8 "G";
557 2; 4; 0; 0; 0x010400 *2; s8 "H";
558 2; 4; 0; 0; 0x010400 *2; s8 "I";
559 2; 4; 0; 0; 0x010400 *2; s8 "J";
562 2; 0; 0; 0; 0x050800 *2; s8 "K";
563 2; 0; 0; 0; 0x050800 *2; s8 "L";
564 2; 0; 0; 0; 0x050800 *2; s8 "M";
567 2; 6; 0; 0; 0x010600 *2; s8 "N";
568 2; 6; 0; 0; 0x010600 *2; s8 "O";
569 2; 6; 0; 0; 0x010600 *2; s8 "P";
571 dnl Machine integer info record.
572 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
576 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
577 "$b=D2 55 0 g e f d"; i8 10; i8 10;
578 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
583 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
584 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
586 dnl Character encoding record.
587 7; 20; 1; 9; "shift_jis";
589 dnl Dictionary termination record.
592 for variant in be le; do
593 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
594 AT_DATA([sys-file.sps], [dnl
595 GET FILE='sys-file.sav'.
596 MRSETS /DISPLAY NAME=ALL.
598 AT_CHECK([pspp -o pspp.csv sys-file.sps])
599 AT_CHECK([cat pspp.csv], [0], [dnl
600 Table: Multiple Response Sets
601 Name,Variables,Details
605 ","Multiple category set
612 ","Multiple dichotomy set
614 Category label source: Variable labels
619 ","Multiple dichotomy set
621 Label source: Provided by user
623 Category label source: Variable labels
628 ","Multiple dichotomy set
630 Label source: Provided by user
632 Category label source: Value labels of counted value
637 ","Multiple dichotomy set
638 Label source: First variable label among variables
639 Counted value: `choice'
640 Category label source: Value labels of counted value
646 dnl Also checks for handling of CR-only line ends in file label and
647 dnl extra product info.
648 AT_SETUP([extra product info])
649 AT_KEYWORDS([sack synthetic system file positive])
650 AT_DATA([sys-file.sack], [dnl
652 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
654 4; dnl Nominal case size
655 0; dnl Not compressed
659 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
662 dnl Numeric variables.
663 2; 0; 0; 0; 0x050800 *2; s8 "A";
664 2; 0; 0; 0; 0x050800 *2; s8 "B";
665 2; 0; 0; 0; 0x050800 *2; s8 "C";
666 2; 0; 0; 0; 0x050800 *2; s8 "D";
668 dnl Extra product info.
669 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
671 dnl Dictionary termination record.
674 for variant in be le; do
675 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
676 AT_DATA([sys-file.sps], [dnl
677 SYSFILE INFO FILE='sys-file.sav'.
679 AT_CHECK([pspp -o pspp.csv sys-file.sps])
680 AT_CHECK([sed 7q pspp.csv], [0], [dnl
682 Label:,"PSPP synthetic
684 Created:,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
685 Product:,"Extra product info
692 AT_SETUP([variable display parameters, without width])
693 AT_KEYWORDS([sack synthetic system file positive])
694 AT_DATA([sys-file.sack], [dnl
696 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
698 19; dnl Nominal case size
699 0; dnl Not compressed
703 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
706 dnl Numeric variables.
707 2; 0; 0; 0; 0x050800 *2; s8 "A";
708 2; 0; 0; 0; 0x050800 *2; s8 "B";
709 2; 0; 0; 0; 0x050800 *2; s8 "C";
710 2; 0; 0; 0; 0x050800 *2; s8 "D";
712 dnl Short string variables.
713 2; 3; 0; 0; 0x010300 *2; s8 "H";
714 2; 3; 0; 0; 0x010300 *2; s8 "I";
715 2; 3; 0; 0; 0x010300 *2; s8 "J";
716 2; 3; 0; 0; 0x010300 *2; s8 "K";
718 dnl Long string variables.
719 2; 9; 0; 0; 0x010900 *2; s8 "L";
720 2; -1; 0; 0; 0; 0; s8 "";
721 2; 10; 0; 0; 0x010a00 *2; s8 "M";
722 2; -1; 0; 0; 0; 0; s8 "";
723 2; 17; 0; 0; 0x011100 *2; s8 "N";
724 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
725 2; 25; 0; 0; 0x011900 *2; s8 "O";
726 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
728 dnl Variable display parameters
743 dnl Dictionary termination record.
746 for variant in be le; do
747 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
748 AT_DATA([sys-file.sps], [dnl
749 GET FILE='sys-file.sav'.
752 AT_CHECK([pspp -o pspp.csv sys-file.sps])
753 AT_CHECK([cat pspp.csv], [0], [dnl
754 Variable,Description,,Position
757 ,Display Alignment: Left,,
761 ,Display Alignment: Left,,
765 ,Display Alignment: Left,,
769 ,Display Alignment: Right,,
773 ,Display Alignment: Right,,
777 ,Display Alignment: Right,,
781 ,Display Alignment: Center,,
785 ,Display Alignment: Center,,
789 ,Display Alignment: Center,,
793 ,Display Alignment: Left,,
797 ,Display Alignment: Right,,
801 ,Display Alignment: Center,,
807 AT_SETUP([variable display parameters, with width])
808 AT_KEYWORDS([sack synthetic system file positive])
809 AT_DATA([sys-file.sack], [dnl
811 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
813 19; dnl Nominal case size
814 0; dnl Not compressed
818 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
821 dnl Numeric variables.
822 2; 0; 0; 0; 0x050800 *2; s8 "A";
823 2; 0; 0; 0; 0x050800 *2; s8 "B";
824 2; 0; 0; 0; 0x050800 *2; s8 "C";
825 2; 0; 0; 0; 0x050800 *2; s8 "D";
827 dnl Short string variables.
828 2; 3; 0; 0; 0x010300 *2; s8 "H";
829 2; 3; 0; 0; 0x010300 *2; s8 "I";
830 2; 3; 0; 0; 0x010300 *2; s8 "J";
831 2; 3; 0; 0; 0x010300 *2; s8 "K";
833 dnl Long string variables.
834 2; 9; 0; 0; 0x010900 *2; s8 "L";
835 2; -1; 0; 0; 0; 0; s8 "";
836 2; 10; 0; 0; 0x010a00 *2; s8 "M";
837 2; -1; 0; 0; 0; 0; s8 "";
838 2; 17; 0; 0; 0x011100 *2; s8 "N";
839 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
840 2; 25; 0; 0; 0x011900 *2; s8 "O";
841 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
843 dnl Variable display parameters
858 dnl Dictionary termination record.
861 for variant in be le; do
862 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
863 AT_DATA([sys-file.sps], [dnl
864 GET FILE='sys-file.sav'.
867 AT_CHECK([pspp -o pspp.csv sys-file.sps])
868 AT_CHECK([cat pspp.csv], [0], [dnl
869 Variable,Description,,Position
872 ,Display Alignment: Left,,
876 ,Display Alignment: Left,,
880 ,Display Alignment: Left,,
884 ,Display Alignment: Right,,
888 ,Display Alignment: Right,,
892 ,Display Alignment: Right,,
896 ,Display Alignment: Center,,
900 ,Display Alignment: Center,,
904 ,Display Alignment: Center,,
908 ,Display Alignment: Left,,
912 ,Display Alignment: Right,,
916 ,Display Alignment: Center,,
922 AT_SETUP([long variable names])
923 AT_KEYWORDS([sack synthetic system file positive])
924 AT_DATA([sys-file.sack], [dnl
926 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
928 7; dnl Nominal case size
929 0; dnl Not compressed
933 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
936 dnl Numeric variables.
937 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
938 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
939 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
940 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
941 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
942 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
943 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
945 dnl Machine integer info record.
946 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
948 dnl Machine floating-point info record.
949 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
951 dnl Long variable names.
953 "LONGVARI=LongVariableName1"; i8 9;
954 "LONGVA_A=LongVariableName2"; i8 9;
955 "LONGVA_B=LongVariableName3"; i8 9;
956 "LONGVA_C=LongVariableName4"; i8 9;
957 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
958 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
959 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
962 dnl Character encoding record.
963 7; 20; 1; 12; "windows-1252";
965 dnl Dictionary termination record.
968 for variant in be le; do
969 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
970 AT_DATA([sys-file.sps], [dnl
971 GET FILE='sys-file.sav'.
974 AT_CHECK([pspp -o pspp.csv sys-file.sps])
975 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
976 Variable,Description,,Position
977 LongVariableName1,Format: F8.0,,1
978 LongVariableName2,Format: F8.0,,2
979 LongVariableName3,Format: F8.0,,3
980 LongVariableName4,Format: F8.0,,4
981 Coördinate_X,Format: F8.0,,5
982 Coördinate_Y,Format: F8.0,,6
983 Coördinate_Z,Format: F8.0,,7
988 AT_SETUP([very long strings])
989 AT_KEYWORDS([sack synthetic system file positive])
990 AT_DATA([sys-file.sack], [dnl
992 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
994 109; dnl Nominal case size
995 0; dnl Not compressed
999 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1002 dnl 256-byte string.
1003 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1004 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1005 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1007 dnl 600-byte string.
1008 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1009 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1010 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1011 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1012 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1013 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1015 dnl Machine integer info record.
1016 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1018 dnl Very long string record.
1020 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1021 "STR600=00600"; i8 0; i8 9;
1024 dnl Character encoding record.
1025 7; 20; 1; 12; "windows-1252";
1027 dnl Dictionary termination record.
1031 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1033 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1034 "abcdefghijklmnopqrstuvwxyzABCDEF";
1036 for variant in be le; do
1037 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1038 AT_DATA([sys-file.sps], [dnl
1039 GET FILE='sys-file.sav'.
1043 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1044 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1045 Variable,Description,,Position
1046 séq256,Format: A256,,1
1047 str600,Format: A600,,2
1051 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1056 AT_SETUP([data file and variable attributes])
1057 AT_KEYWORDS([sack synthetic system file positive])
1058 AT_DATA([sys-file.sack], [dnl
1060 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1062 2; dnl Nominal case size
1063 0; dnl Not compressed
1067 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1071 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1072 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1074 dnl Machine integer info record.
1075 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1077 dnl Long variable names.
1079 "FIRSTVAR=FirstVariable"; i8 9;
1080 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1083 dnl Data file attributes record.
1085 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1086 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1089 dnl Variable attributes record.
1092 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1093 "bert('123'"; i8 10; ")";
1094 "$@Role('1'"; i8 10; ")";
1095 "/S"; i8 233; "condVariable:";
1096 "xyzzy('quux'"; i8 10; ")";
1100 dnl Character encoding record.
1101 7; 20; 1; 12; "windows-1252";
1103 dnl Dictionary termination record.
1106 for variant in be le; do
1107 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1108 AT_DATA([sys-file.sps], [dnl
1109 GET FILE='sys-file.sav'.
1110 DISPLAY @ATTRIBUTES.
1112 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1113 AT_CHECK([cat pspp.csv], [0],
1114 [[Variable,Description,
1115 FirstVariable,Custom attributes:,
1120 SécondVariable,Custom attributes:,
1123 Table: Custom data file attributes.
1126 Attr1[2],'déclaration'
1130 AT_DATA([sys-file.sps], [dnl
1131 GET FILE='sys-file.sav'.
1134 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1135 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0],
1136 [[Variable,Description,,Position
1137 FirstVariable,Format: F8.0,,1
1139 ,Custom attributes:,,
1143 SécondVariable,Format: F8.0,,2
1144 ,Custom attributes:,,
1147 Table: Custom data file attributes.
1150 Attr1[2],'déclaration'
1157 AT_SETUP([variable roles])
1158 AT_KEYWORDS([sack synthetic system file positive])
1159 AT_DATA([sys-file.sack], [dnl
1161 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1163 7; dnl Nominal case size
1164 0; dnl Not compressed
1168 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1172 2; 0; 0; 0; 0x050800 *2; s8 "I";
1173 2; 0; 0; 0; 0x050800 *2; s8 "O";
1174 2; 0; 0; 0; 0x050800 *2; s8 "B";
1175 2; 0; 0; 0; 0x050800 *2; s8 "N";
1176 2; 0; 0; 0; 0x050800 *2; s8 "P";
1177 2; 0; 0; 0; 0x050800 *2; s8 "S";
1178 2; 0; 0; 0; 0x050800 *2; s8 "X";
1180 dnl Machine integer info record.
1181 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1183 dnl Variable attributes record.
1185 "I:$@Role('0'"; i8 10; ")";
1186 "/O:$@Role('1'"; i8 10; ")";
1187 "/B:$@Role('2'"; i8 10; ")";
1188 "/N:$@Role('3'"; i8 10; ")";
1189 "/P:$@Role('4'"; i8 10; ")";
1190 "/S:$@Role('5'"; i8 10; ")";
1191 "/X:$@Role('6'"; i8 10; ")";
1194 dnl Character encoding record.
1195 7; 20; 1; 12; "windows-1252";
1197 dnl Dictionary termination record.
1200 for variant in be le; do
1201 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1202 AT_DATA([sys-file.sps], [dnl
1203 GET FILE='sys-file.sav'.
1206 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1207 warning: `sys-file.sav': Invalid role for variable x.
1209 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1210 warning: `sys-file.sav': Invalid role for variable x.
1212 Variable,Description,,Position
1229 AT_SETUP([compressed data])
1230 AT_KEYWORDS([sack synthetic system file positive])
1231 AT_DATA([sys-file.sack], [dnl
1233 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1235 6; dnl Nominal case size
1236 1; dnl Simple compression
1238 -1; dnl Unspecified number of cases.
1240 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1243 dnl Numeric variables.
1244 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1245 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1247 dnl String variable.
1248 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1249 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1250 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1251 2; -1; 0; 0; 0; 0; s8 "";
1253 dnl Dictionary termination record.
1256 dnl Compressed data.
1257 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1258 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1259 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1260 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1263 for variant in be le; do
1264 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1265 AT_DATA([sys-file.sps], [dnl
1266 GET FILE='sys-file.sav'.
1270 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1271 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1272 Variable,Description,,Position
1273 num1,Format: F8.0,,1
1274 num2,Format: F8.0,,2
1277 str15,Format: A15,,5
1280 num1,num2,str4,str8,str15
1281 -99,0,,abcdefgh,0123 @&t@
1282 .,151,jklm,nopqrstu,vwxyzABC @&t@
1283 1,2,DEFG,HIJKLMNO,PQRSTUV
1288 AT_SETUP([compressed data, zero bias])
1289 AT_KEYWORDS([sack synthetic system file positive])
1290 AT_DATA([sys-file.sack], [dnl
1292 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1294 6; dnl Nominal case size
1295 1; dnl Simple compression.
1297 -1; dnl Unspecified number of cases.
1299 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1302 dnl Numeric variables.
1303 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1304 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1306 dnl String variable.
1307 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1308 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1309 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1310 2; -1; 0; 0; 0; 0; s8 "";
1312 dnl Dictionary termination record.
1315 dnl Compressed data.
1316 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1317 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1318 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1319 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1322 for variant in be le; do
1323 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1324 AT_DATA([sys-file.sps], [dnl
1325 GET FILE='sys-file.sav'.
1329 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1330 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1331 Variable,Description,,Position
1332 num1,Format: F8.0,,1
1333 num2,Format: F8.0,,2
1336 str15,Format: A15,,5
1339 num1,num2,str4,str8,str15
1340 1,100,,abcdefgh,0123 @&t@
1341 .,251,jklm,nopqrstu,vwxyzABC @&t@
1342 101,102,DEFG,HIJKLMNO,PQRSTUV
1347 AT_SETUP([compressed data, other bias])
1348 AT_KEYWORDS([sack synthetic system file positive])
1349 AT_DATA([sys-file.sack], [dnl
1351 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1353 6; dnl Nominal case size
1354 1; dnl Simple compression.
1356 -1; dnl Unspecified number of cases.
1358 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1361 dnl Numeric variables.
1362 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1363 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1365 dnl String variable.
1366 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1367 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1368 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1369 2; -1; 0; 0; 0; 0; s8 "";
1371 dnl Dictionary termination record.
1374 dnl Compressed data.
1375 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1376 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1377 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1378 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1381 for variant in be le; do
1382 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1383 AT_DATA([sys-file.sps], [dnl
1384 GET FILE='sys-file.sav'.
1388 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1389 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1391 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1392 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1394 Variable,Description,,Position
1395 num1,Format: F8.0,,1
1396 num2,Format: F8.0,,2
1399 str15,Format: A15,,5
1402 num1,num2,str4,str8,str15
1403 -49,50,,abcdefgh,0123 @&t@
1404 .,201,jklm,nopqrstu,vwxyzABC @&t@
1405 51,52,DEFG,HIJKLMNO,PQRSTUV
1410 m4_divert_push([PREPARE_TESTS])
1411 zcompressed_sack () {
1414 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1416 6; dnl Nominal case size
1417 2; dnl zlib compressed
1419 -1; dnl Unspecified number of cases.
1421 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1424 dnl Numeric variables.
1425 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1426 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1428 dnl String variable.
1429 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1430 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1431 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1432 2; -1; 0; 0; 0; 0; s8 "";
1434 dnl Dictionary termination record.
1437 dnl ZLIB data header.
1438 i64 0x178; # zheader_ofs
1439 i64 0x1e9; # ztrailer_ofs
1440 i64 48; # ztrailer_len
1442 dnl ZLIB data block.
1444 dnl This is the compressed form of:
1446 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1447 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1448 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1449 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1450 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1451 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1453 dnl which is the data from the "compressed data" test.
1454 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1455 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1456 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1457 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1458 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1459 hex "90 d0 b0 70 00 0f 3f 23 d7";
1461 dnl ZLIB data trailer fixed header:
1462 i64 -100; # ztrailer_bias
1463 i64 0; # ztrailer_zero
1464 0x3ff000; # block_size
1467 dnl ZLIB block descriptor:
1468 i64 0x178; # uncompressed_ofs
1469 i64 0x190; # compressed_ofs
1470 88; # uncompressed_size
1471 89; # compressed_size
1474 m4_divert_pop([PREPARE_TESTS])
1476 AT_SETUP([zcompressed data])
1477 AT_KEYWORDS([sack synthetic system file positive zlib])
1478 zcompressed_sack > sys-file.sack
1479 for variant in be le; do
1480 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1481 AT_DATA([sys-file.sps], [dnl
1482 GET FILE='sys-file.sav'.
1486 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1487 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1488 Variable,Description,,Position
1489 num1,Format: F8.0,,1
1490 num2,Format: F8.0,,2
1493 str15,Format: A15,,5
1496 num1,num2,str4,str8,str15
1497 -99,0,,abcdefgh,0123 @&t@
1498 .,151,jklm,nopqrstu,vwxyzABC @&t@
1499 1,2,DEFG,HIJKLMNO,PQRSTUV
1504 AT_BANNER([system file reader - negative])
1506 AT_SETUP([misplaced type 4 record])
1507 AT_KEYWORDS([sack synthetic system file negative])
1508 AT_DATA([sys-file.sack], [dnl
1510 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1511 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1513 dnl Numeric variable.
1514 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1519 for variant in be le; do
1520 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1521 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1523 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1524 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1529 AT_SETUP([bad record type])
1530 AT_KEYWORDS([sack synthetic system file negative])
1531 AT_DATA([sys-file.sack], [dnl
1533 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1534 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1536 dnl Numeric variable.
1537 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1539 dnl Type 8 record (not a valid type).
1542 for variant in be le; do
1543 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1544 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1546 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1547 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1552 AT_SETUP([wrong number of variable positions])
1553 AT_KEYWORDS([sack synthetic system file negative])
1554 AT_DATA([sys-file.sack], [dnl
1556 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1557 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1559 dnl Numeric variable.
1560 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1562 dnl End of dictionary.
1565 for variant in be le; do
1566 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1567 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1569 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1570 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1575 AT_SETUP([variable name may not begin with `#'])
1576 AT_KEYWORDS([sack synthetic system file negative])
1577 AT_DATA([sys-file.sack], [dnl
1579 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1580 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1582 dnl Numeric variable.
1583 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1585 dnl End of dictionary.
1588 for variant in be le; do
1589 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1590 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1592 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1593 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1598 AT_SETUP([variable name may not be reserved word])
1599 AT_KEYWORDS([sack synthetic system file negative])
1600 AT_DATA([sys-file.sack], [dnl
1602 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1603 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1605 dnl Numeric variable.
1606 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1608 dnl End of dictionary.
1611 for variant in be le; do
1612 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1613 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1615 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1616 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1621 AT_SETUP([variable width must be between 0 and 255])
1622 AT_KEYWORDS([sack synthetic system file negative])
1623 AT_DATA([sys-file.sack], [dnl
1625 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1626 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1628 dnl String variable with invalid width 256.
1629 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1631 dnl End of dictionary.
1634 for variant in be le; do
1635 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1636 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1638 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1639 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1644 dnl SPSS-generated system file can contain duplicate variable names
1645 dnl (see bug #41475).
1646 AT_SETUP([duplicate variable name])
1647 AT_KEYWORDS([sack synthetic system file negative])
1648 AT_DATA([sys-file.sack], [dnl
1650 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1651 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1653 dnl Numeric variables.
1654 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1655 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1657 dnl End of dictionary.
1660 for variant in be le; do
1661 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1662 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1665 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1666 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1668 Variable,Description,,Position
1669 var1,Format: F8.0,,1
1671 ,Display Alignment: Right,,
1673 var001,Format: F8.0,,2
1675 ,Display Alignment: Right,,
1681 AT_SETUP([variable label indicator not 0 or 1])
1682 AT_KEYWORDS([sack synthetic system file negative])
1683 AT_DATA([sys-file.sack], [dnl
1685 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1686 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1688 dnl Numeric variable.
1689 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1691 dnl End of dictionary.
1694 for variant in be le; do
1695 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1696 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1698 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1699 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1704 AT_SETUP([invalid numeric missing value indicator])
1705 AT_KEYWORDS([sack synthetic system file negative])
1706 AT_DATA([sys-file.sack], [dnl
1708 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1709 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1711 dnl Numeric variable.
1712 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1714 dnl End of dictionary.
1717 for variant in be le; do
1718 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1719 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1721 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1722 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1727 AT_SETUP([invalid string missing value indicator])
1728 AT_KEYWORDS([sack synthetic system file negative])
1729 AT_DATA([sys-file.sack], [dnl
1731 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1732 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1734 dnl String variable.
1735 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1737 dnl End of dictionary.
1740 for variant in be le; do
1741 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1742 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1744 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1745 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1750 AT_SETUP([missing string continuation record])
1751 AT_KEYWORDS([sack synthetic system file negative])
1752 AT_DATA([sys-file.sack], [dnl
1754 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1755 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1757 dnl String variable.
1758 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1759 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1761 dnl End of dictionary.
1764 for variant in be le; do
1765 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1766 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1768 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1769 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1774 AT_SETUP([invalid variable format])
1775 AT_KEYWORDS([sack synthetic system file negative])
1776 AT_DATA([sys-file.sack], [dnl
1778 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1779 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1781 dnl Numeric variable, invalid format types.
1782 dnl No warning is issued for type 0 because it has been observed in real
1784 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1786 dnl Numeric variable, string formats.
1787 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1789 dnl String variable, numeric formats.
1790 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1792 dnl String variable, wrong width formats.
1793 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1795 dnl End of dictionary.
1798 for variant in be le; do
1799 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1800 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1802 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1803 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1805 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1807 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1809 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1811 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1813 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1815 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1820 AT_SETUP([invalid long string missing values])
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";
1826 7; dnl Nominal case size
1827 0; dnl Not compressed
1831 "01 Jan 11"; "20:53:52";
1832 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1835 dnl One numeric variable.
1836 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1838 dnl Long string variables that will have missing values added with a
1840 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1841 2; -1; 0; 0; 0; 0; s8 "";
1842 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
1843 2; -1; 0; 0; 0; 0; s8 "";
1844 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
1845 2; -1; 0; 0; 0; 0; s8 "";
1847 dnl Machine integer info record.
1848 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1850 dnl Machine floating-point info record.
1851 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1853 dnl Long string variable missing values record.
1855 dnl Zero missing values (not allowed) for STR1 .
1856 COUNT("STR1"); i8 >>0<<;
1858 dnl Four missing values (not allowed) for STR2.
1859 COUNT("STR2"); i8 4;
1860 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
1862 dnl Missing values for unknown variable
1863 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
1865 dnl Missing values for numeric variable
1866 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
1868 dnl Too long missing value
1869 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
1872 dnl Character encoding record.
1873 7; 20; 1; 12; "windows-1252";
1875 dnl Dictionary termination record.
1877 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
1878 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
1879 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
1882 for variant in be le; do
1883 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1884 AT_DATA([sys-file.sps], [dnl
1885 GET FILE='sys-file.sav'.
1888 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1889 ["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."
1891 "warning: `sys-file.sav' near offset 0x201: Long string missing values record says variable STR2 has 4 missing values, but only 1 to 3 missing values are allowed."
1893 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
1895 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
1897 "warning: `sys-file.sav' near offset 0x270: Ignoring long string missing value 0 for variable str3, with width 11, that has bad value width 12."
1899 Variable,Description,,Position
1900 num1,Format: F8.0,,1
1902 ,Display Alignment: Right,,
1906 ,Display Alignment: Left,,
1910 ,Display Alignment: Left,,
1911 ,Display Width: 10,,
1912 ,"Missing Values: ""abcdefgh""; ""ijklmnop""; ""qrstuvwx""",,
1915 ,Display Alignment: Left,,
1916 ,Display Width: 11,,
1921 AT_SETUP([weighting variable must be numeric])
1922 AT_KEYWORDS([sack synthetic system file negative])
1923 AT_DATA([sys-file.sack], [dnl
1925 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1926 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1928 dnl Numeric variable.
1929 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1931 dnl String variable.
1932 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1934 dnl End of dictionary.
1937 for variant in be le; do
1938 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1939 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1942 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1943 [warning: `sys-file.sav': Ignoring string variable `STR1' set as weighting variable.
1945 Variable,Description,,Position
1946 num1,Format: F8.0,,1
1948 ,Display Alignment: Right,,
1952 ,Display Alignment: Left,,
1958 AT_SETUP([bad weighting variable index])
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; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1965 dnl Numeric variable.
1966 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1968 dnl String variable.
1969 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1971 dnl End of dictionary.
1974 for variant in be le; do
1975 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1976 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1978 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1979 [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
1984 AT_SETUP([variable index is long string contination])
1985 AT_KEYWORDS([sack synthetic system file negative])
1986 AT_DATA([sys-file.sack], [dnl
1988 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1989 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1991 dnl Numeric variable.
1992 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1994 dnl Long string variable.
1995 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1996 (2; -1; 0; 0; 0; 0; s8 "");
1998 dnl End of dictionary.
2001 for variant in be le; do
2002 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2003 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2005 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2006 [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
2011 AT_SETUP([multiple documents records])
2012 AT_KEYWORDS([sack synthetic system file negative])
2013 AT_DATA([sys-file.sack], [dnl
2015 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2016 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2018 dnl Numeric variable, no label or missing values.
2019 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2021 dnl Two document records.
2022 (6; 1; s80 "One line of documents") >>* 2<<;
2024 dnl Dictionary termination record.
2030 for variant in be le; do
2031 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2032 AT_DATA([sys-file.sps], [dnl
2033 GET FILE='sys-file.sav'.
2035 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2036 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
2042 AT_SETUP([empty document record])
2043 AT_KEYWORDS([sack synthetic system file negative])
2044 AT_DATA([sys-file.sack], [dnl
2046 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2047 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2049 dnl Numeric variable, no label or missing values.
2050 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2052 dnl Empty document record.
2055 dnl Dictionary termination record.
2061 for variant in be le; do
2062 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2063 AT_DATA([sys-file.sps], [dnl
2064 GET FILE='sys-file.sav'.
2066 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2067 error: `sys-file.sav' near offset 0xd4: Number of document lines (0) must be greater than 0 and less than 26843545.
2072 AT_SETUP([extension record too large])
2073 AT_KEYWORDS([sack synthetic system file negative])
2074 AT_DATA([sys-file.sack], [dnl
2076 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2077 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2079 dnl Numeric variable, no label or missing values.
2080 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2082 dnl Too-large extension record.
2083 7; 3; >>0xfffff000 * 2<<;
2085 for variant in be le; do
2086 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2087 AT_DATA([sys-file.sps], [dnl
2088 GET FILE='sys-file.sav'.
2090 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2091 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2096 AT_SETUP([unknown extension record])
2097 AT_KEYWORDS([sack synthetic system file negative])
2098 AT_DATA([sys-file.sack], [dnl
2100 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2101 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2103 dnl Numeric variable, no label or missing values.
2104 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2106 dnl Unknown extension record type.
2109 dnl End of dictionary.
2112 for variant in be le; do
2113 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2114 AT_DATA([sys-file.sps], [dnl
2115 GET FILE='sys-file.sav'.
2117 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2118 "warning: `sys-file.sav' near offset 0xd8: Unrecognized record type 7, subtype 30. Please send a copy of this file, and the syntax which created it to bug-gnu-pspp@gnu.org."
2123 AT_SETUP([bad machine integer info size])
2124 AT_KEYWORDS([sack synthetic system file negative])
2125 AT_DATA([sys-file.sack], [dnl
2127 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2128 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2130 dnl Numeric variable, no label or missing values.
2131 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2133 dnl Machine integer info record.
2134 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2136 dnl End of dictionary.
2139 for variant in be le; do
2140 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2141 AT_DATA([sys-file.sps], [dnl
2142 GET FILE='sys-file.sav'.
2144 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2145 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2150 AT_SETUP([bad machine integer info float format])
2151 AT_KEYWORDS([sack synthetic system file negative])
2152 AT_DATA([sys-file.sack], [dnl
2154 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2155 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2157 dnl Numeric variable, no label or missing values.
2158 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2160 dnl Machine integer info record.
2161 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2163 dnl End of dictionary.
2166 for variant in be le; do
2167 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2168 AT_DATA([sys-file.sps], [dnl
2169 GET FILE='sys-file.sav'.
2171 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2172 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2177 AT_SETUP([bad machine integer info endianness])
2178 AT_KEYWORDS([sack synthetic system file negative])
2179 AT_DATA([sys-file.sack], [dnl
2181 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2182 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2184 dnl Numeric variable, no label or missing values.
2185 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2187 dnl Machine integer info record.
2188 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2190 dnl End of dictionary.
2193 for variant in "be 1" "le 2"; do
2195 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2196 AT_DATA([sys-file.sps], [dnl
2197 GET FILE='sys-file.sav'.
2200 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2201 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2203 Variable,Description,,Position
2204 num1,Format: F8.0,,1
2206 ,Display Alignment: Right,,
2213 AT_SETUP([bad machine floating-point info size])
2214 AT_KEYWORDS([sack synthetic system file negative])
2215 AT_DATA([sys-file.sack], [dnl
2217 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2218 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2220 dnl Numeric variable, no label or missing values.
2221 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2223 dnl Machine floating-point info record.
2224 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2226 dnl End of dictionary.
2229 for variant in be le; do
2230 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2231 AT_DATA([sys-file.sps], [dnl
2232 GET FILE='sys-file.sav'.
2234 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2235 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2240 AT_SETUP([wrong special floating point values])
2241 AT_KEYWORDS([sack synthetic system file negative])
2242 AT_DATA([sys-file.sack], [dnl
2244 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2245 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2247 dnl Numeric variable, no label or missing values.
2248 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2250 dnl Machine floating-point info record.
2251 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2253 dnl End of dictionary.
2256 for variant in be le; do
2257 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2258 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2260 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2261 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2263 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2265 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2270 AT_SETUP([bad mrsets name])
2271 AT_KEYWORDS([sack synthetic system file negative multiple response])
2272 AT_DATA([sys-file.sack], [dnl
2274 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2276 16; dnl Nominal case size
2277 0; dnl Not compressed
2281 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2285 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2286 2; 0; 0; 0; 0x050800 *2; s8 "B";
2287 2; 0; 0; 0; 0x050800 *2; s8 "C";
2290 2; 0; 0; 0; 0x050800 *2; s8 "D";
2291 2; 0; 0; 0; 0x050800 *2; s8 "E";
2292 2; 0; 0; 0; 0x050800 *2; s8 "F";
2293 2; 0; 0; 0; 0x050800 *2; s8 "G";
2296 2; 4; 0; 0; 0x010400 *2; s8 "H";
2297 2; 4; 0; 0; 0x010400 *2; s8 "I";
2298 2; 4; 0; 0; 0x010400 *2; s8 "J";
2301 2; 0; 0; 0; 0x050800 *2; s8 "K";
2302 2; 0; 0; 0; 0x050800 *2; s8 "L";
2303 2; 0; 0; 0; 0x050800 *2; s8 "M";
2306 2; 6; 0; 0; 0x010600 *2; s8 "N";
2307 2; 6; 0; 0; 0x010600 *2; s8 "O";
2308 2; 6; 0; 0; 0x010600 *2; s8 "P";
2310 dnl Machine integer info record.
2311 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2315 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2316 "b=D2 55 0 g e f d"; i8 10;
2317 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2321 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2322 "e=E 11 6 choice 0 n o p"; i8 10);
2324 dnl Character encoding record.
2325 7; 20; 1; 9; "shift_jis";
2327 dnl Dictionary termination record.
2330 for variant in be le; do
2331 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2332 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2333 MRSETS /DISPLAY NAME=ALL.
2335 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2336 warning: `sys-file.sav': Multiple response set name `b' does not begin with `$'.
2338 warning: `sys-file.sav': Multiple response set name `e' does not begin with `$'.
2340 Table: Multiple Response Sets
2341 Name,Variables,Details
2345 ","Multiple category set
2351 ","Multiple dichotomy set
2353 Label source: Provided by user
2355 Category label source: Variable labels
2360 ","Multiple dichotomy set
2361 Label: third mdgroup
2362 Label source: Provided by user
2364 Category label source: Value labels of counted value
2370 AT_SETUP([missing space after C in mrsets])
2371 AT_KEYWORDS([sack synthetic system file negative multiple response])
2372 AT_DATA([sys-file.sack], [dnl
2374 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2375 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2377 dnl Numeric variable, no label or missing values.
2378 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2380 dnl Multiple response sets.
2381 7; 7; 1; COUNT("$a=Cx");
2385 for variant in be le; do
2386 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2387 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2389 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2390 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2395 AT_SETUP([missing space after E in mrsets])
2396 AT_KEYWORDS([sack synthetic system file negative multiple response])
2397 AT_DATA([sys-file.sack], [dnl
2399 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2400 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2402 dnl Numeric variable, no label or missing values.
2403 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2405 dnl Multiple response sets.
2406 7; 7; 1; COUNT("$a=Ex");
2410 for variant in be le; do
2411 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2412 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2414 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2415 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2420 AT_SETUP([unexpected label source in mrsets])
2421 AT_KEYWORDS([sack synthetic system file negative multiple response])
2422 AT_DATA([sys-file.sack], [dnl
2424 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2425 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2427 dnl Numeric variable, no label or missing values.
2428 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2430 dnl Multiple response sets.
2431 7; 7; 1; COUNT("$a=E 2");
2435 for variant in be le; do
2436 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2437 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2439 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2440 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2442 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2447 AT_SETUP([bad type character in mrsets])
2448 AT_KEYWORDS([sack synthetic system file negative multiple response])
2449 AT_DATA([sys-file.sack], [dnl
2451 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2452 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2454 dnl Numeric variable, no label or missing values.
2455 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2457 dnl Multiple response sets.
2458 7; 7; 1; COUNT("$a=");
2462 for variant in be le; do
2463 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2464 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2466 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2467 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2472 AT_SETUP([bad counted string length in mrsets])
2473 AT_KEYWORDS([sack synthetic system file negative multiple response])
2474 AT_DATA([sys-file.sack], [dnl
2476 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2477 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2479 dnl Numeric variable, no label or missing values.
2480 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2482 dnl Multiple response sets.
2483 7; 7; 1; COUNT("$a=Dx");
2487 for variant in be le; do
2488 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2489 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2491 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2492 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2497 AT_SETUP([missing space in counted string in mrsets])
2498 AT_KEYWORDS([sack synthetic system file negative multiple response])
2499 AT_DATA([sys-file.sack], [dnl
2501 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2502 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2504 dnl Numeric variable, no label or missing values.
2505 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2507 dnl Multiple response sets.
2508 7; 7; 1; COUNT("$a=D1x");
2512 for variant in be le; do
2513 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2514 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2516 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2517 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2522 AT_SETUP([counted string too long in mrsets])
2523 AT_KEYWORDS([sack synthetic system file negative multiple response])
2524 AT_DATA([sys-file.sack], [dnl
2526 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2527 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2529 dnl Numeric variable, no label or missing values.
2530 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2532 dnl Multiple response sets.
2533 7; 7; 1; COUNT("$a=D4 abc");
2537 for variant in be le; do
2538 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2539 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2541 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2542 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2547 AT_SETUP([missing space after counted string in mrsets])
2548 AT_KEYWORDS([sack synthetic system file negative multiple response])
2549 AT_DATA([sys-file.sack], [dnl
2551 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2552 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2554 dnl Numeric variable, no label or missing values.
2555 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2557 dnl Multiple response sets.
2558 7; 7; 1; COUNT("$a=D3 abcx");
2562 for variant in be le; do
2563 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2564 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2566 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2567 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2572 AT_SETUP([missing newline after variable name in mrsets])
2573 AT_KEYWORDS([sack synthetic system file negative multiple response])
2574 AT_DATA([sys-file.sack], [dnl
2576 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2577 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2579 dnl Numeric variable, no label or missing values.
2580 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2582 dnl Multiple response sets.
2583 7; 7; 1; COUNT("$a=C 0 NUM1");
2587 for variant in be le; do
2588 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2589 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2591 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2592 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2594 warning: `sys-file.sav': MRSET $a has only one variable.
2599 AT_SETUP([duplicate variable name in mrsets])
2600 AT_KEYWORDS([sack synthetic system file negative multiple response])
2601 AT_DATA([sys-file.sack], [dnl
2603 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2604 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2606 dnl Numeric variable, no label or missing values.
2607 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2609 dnl Multiple response sets.
2610 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2614 for variant in be le; do
2615 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2616 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2618 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2619 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2621 warning: `sys-file.sav': MRSET $a has only one variable.
2626 AT_SETUP([mixed variable types in mrsets])
2627 AT_KEYWORDS([sack synthetic system file negative multiple response])
2628 AT_DATA([sys-file.sack], [dnl
2630 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2631 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2634 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2635 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2637 dnl Multiple response sets.
2638 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2642 for variant in be le; do
2643 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2644 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2646 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2647 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2649 warning: `sys-file.sav': MRSET $a has only one variable.
2654 AT_SETUP([missing newline after variable name in mrsets])
2655 AT_KEYWORDS([sack synthetic system file negative multiple response])
2656 AT_DATA([sys-file.sack], [dnl
2658 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2659 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2661 dnl Numeric variable, no label or missing values.
2662 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2664 dnl Multiple response sets.
2665 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2669 for variant in be le; do
2670 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2671 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2673 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2674 warning: `sys-file.sav': MRSET $a has only one variable.
2679 AT_SETUP([zero or one variable in mrset])
2680 AT_KEYWORDS([sack synthetic system file negative multiple response])
2681 AT_DATA([sys-file.sack], [dnl
2683 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2684 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2686 dnl Numeric variable, no label or missing values.
2687 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2689 dnl Multiple response sets.
2690 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2694 for variant in be le; do
2695 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2696 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2698 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2699 warning: `sys-file.sav': MRSET $a has only one variable.
2701 warning: `sys-file.sav': MRSET $b has no variables.
2706 AT_SETUP([wrong display parameter size])
2707 AT_KEYWORDS([sack synthetic system file negative])
2708 AT_DATA([sys-file.sack], [dnl
2710 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2711 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2713 dnl Numeric variable, no label or missing values.
2714 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2716 dnl Display parameters record.
2717 7; 11; >>8<<; 2; 1.0; 1.0;
2719 dnl End of dictionary.
2722 for variant in be le; do
2723 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2724 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2726 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2727 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2732 AT_SETUP([wrong display parameter count])
2733 AT_KEYWORDS([sack synthetic system file negative])
2734 AT_DATA([sys-file.sack], [dnl
2736 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2737 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2739 dnl Numeric variable, no label or missing values.
2740 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2742 dnl Display parameters record.
2743 7; 11; 4; >>4<<; 1; 1; 2; 2;
2745 dnl End of dictionary.
2748 for variant in be le; do
2749 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2750 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2752 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2753 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2758 AT_SETUP([wrong display measurement level])
2759 AT_KEYWORDS([sack synthetic system file negative])
2760 AT_DATA([sys-file.sack], [dnl
2762 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2763 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2765 dnl Numeric variable, no label or missing values.
2766 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2768 dnl Display parameters record.
2769 7; 11; 4; 2; >>4<<; 0;
2771 dnl End of dictionary.
2774 for variant in be le; do
2775 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2776 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2778 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2779 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2784 AT_SETUP([wrong display alignment])
2785 AT_KEYWORDS([sack synthetic system file negative])
2786 AT_DATA([sys-file.sack], [dnl
2788 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2789 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2791 dnl Numeric variable, no label or missing values.
2792 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2794 dnl Display parameters record.
2795 7; 11; 4; 2; 1; >>-1<<;
2797 dnl End of dictionary.
2800 for variant in be le; do
2801 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2802 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2804 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2805 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2810 AT_SETUP([bad variable name in variable/value pair])
2811 AT_KEYWORDS([sack synthetic system file negative])
2812 AT_DATA([sys-file.sack], [dnl
2814 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2815 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2817 dnl Numeric variables.
2818 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2820 dnl Long variable names.
2821 7; 13; 1; COUNT (>>"xyzzy"<<);
2823 dnl Dictionary termination record.
2826 for variant in be le; do
2827 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2828 AT_DATA([sys-file.sps], [dnl
2829 GET FILE='sys-file.sav'.
2831 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2832 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
2837 AT_SETUP([duplicate long variable name])
2838 AT_KEYWORDS([sack synthetic system file negative])
2839 AT_DATA([sys-file.sack], [dnl
2841 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2842 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2844 dnl Numeric variables.
2845 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2846 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
2847 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
2848 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
2850 dnl Long variable names.
2852 "LONGVARI=_Invalid"; i8 9;
2853 "LONGVA_A=LongVariableName"; i8 9;
2854 "LONGVA_B=LONGVARIABLENAME"; i8 9;
2857 dnl Dictionary termination record.
2860 for variant in be le; do
2861 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2862 AT_DATA([sys-file.sps], [dnl
2863 GET FILE='sys-file.sav'.
2865 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2866 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
2868 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
2873 AT_SETUP([bad very long string length])
2874 AT_KEYWORDS([sack synthetic system file negative])
2875 AT_DATA([sys-file.sack], [dnl
2877 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2878 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2880 dnl Numeric variable.
2881 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2883 dnl Very long string map.
2885 "NUM1=00000"; i8 0; i8 9;
2886 "NUM1=00255"; i8 0; i8 9;
2887 "NUM1=00256"; i8 0; i8 9;
2890 dnl Dictionary termination record.
2893 for variant in be le; do
2894 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2895 AT_DATA([sys-file.sps], [dnl
2896 GET FILE='sys-file.sav'.
2898 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2899 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
2901 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
2903 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
2908 AT_SETUP([bad very long string segment width])
2909 AT_KEYWORDS([sack synthetic system file negative])
2910 AT_DATA([sys-file.sack], [dnl
2912 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2913 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2916 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
2917 (2; -1; 0; 0; 0; 0; s8 "") * 31;
2918 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
2919 >>2; -1; 0; 0; 0; 0; s8 "";<<
2921 dnl Very long string map.
2923 "STR1=00256"; i8 0; i8 9;
2926 dnl Dictionary termination record.
2929 for variant in be le; do
2930 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2931 AT_DATA([sys-file.sps], [dnl
2932 GET FILE='sys-file.sav'.
2934 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2935 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
2940 AT_SETUP([too many value labels])
2941 dnl Skip the test if multiplying a small number by INT32_MAX would not
2942 dnl cause an overflow in size_t.
2943 AT_SKIP_IF([test $SIZEOF_SIZE_T -gt 4])
2944 AT_KEYWORDS([sack synthetic system file negative])
2945 AT_DATA([sys-file.sack], [dnl
2947 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2948 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2950 dnl Numeric variable.
2951 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2954 for variant in be le; do
2955 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2956 AT_DATA([sys-file.sps], [dnl
2957 GET FILE='sys-file.sav'.
2959 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2960 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
2965 AT_SETUP([missing type 4 record])
2966 AT_KEYWORDS([sack synthetic system file negative])
2967 AT_DATA([sys-file.sack], [dnl
2969 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2970 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2972 dnl Numeric variable.
2973 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2975 dnl Value label with missing type 4 record.
2976 3; 1; 1.0; i8 3; s7 "one";
2978 dnl End of dictionary.
2981 for variant in be le; do
2982 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2983 AT_DATA([sys-file.sps], [dnl
2984 GET FILE='sys-file.sav'.
2986 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2987 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
2992 AT_SETUP([value label with no associated variables])
2993 AT_KEYWORDS([sack synthetic system file negative])
2994 AT_DATA([sys-file.sack], [dnl
2996 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2997 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2999 dnl Numeric variable.
3000 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3002 dnl Value label with no variables.
3003 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3005 for variant in be le; do
3006 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3007 AT_DATA([sys-file.sps], [dnl
3008 GET FILE='sys-file.sav'.
3010 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3011 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).
3016 AT_SETUP([type 4 record names long string variable])
3017 AT_KEYWORDS([sack synthetic system file negative])
3018 AT_DATA([sys-file.sack], [dnl
3020 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3021 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3023 dnl Long string variable.
3024 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3025 2; -1; 0; 0; 0; 0; s8 "";
3027 dnl Value label that names long string variable.
3028 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3030 dnl End of dictionary.
3033 for variant in be le; do
3034 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3035 AT_DATA([sys-file.sps], [dnl
3036 GET FILE='sys-file.sav'.
3038 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3039 error: `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.
3044 AT_SETUP([variables for value label must all be same type])
3045 AT_KEYWORDS([sack synthetic system file negative])
3046 AT_DATA([sys-file.sack], [dnl
3048 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3049 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3052 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3053 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3055 dnl Value label that names numeric and string variables.
3056 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3058 dnl End of dictionary.
3061 for variant in be le; do
3062 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3063 AT_DATA([sys-file.sps], [dnl
3064 GET FILE='sys-file.sav'.
3066 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3067 "error: `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."
3072 AT_SETUP([duplicate value labels type])
3073 AT_KEYWORDS([sack synthetic system file negative])
3074 AT_DATA([sys-file.sack], [dnl
3076 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3077 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3080 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3081 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3083 dnl Duplicate value labels.
3084 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3085 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3087 dnl End of dictionary.
3090 for variant in be le; do
3091 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3092 AT_DATA([sys-file.sps], [dnl
3093 GET FILE='sys-file.sav'.
3095 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3096 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3098 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3103 AT_SETUP([missing attribute value])
3104 AT_KEYWORDS([sack synthetic system file negative])
3105 AT_DATA([sys-file.sack], [dnl
3107 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3108 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3111 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3113 dnl Data file attributes record.
3118 dnl Variable attributes record.
3124 dnl Dictionary termination record.
3127 for variant in be le; do
3128 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3129 AT_DATA([sys-file.sps], [dnl
3130 GET FILE='sys-file.sav'.
3132 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3133 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3135 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3140 AT_SETUP([unquoted attribute value])
3141 AT_KEYWORDS([sack synthetic system file negative])
3142 AT_DATA([sys-file.sack], [dnl
3144 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3145 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3148 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3150 dnl Data file attributes record.
3152 "Attr1(value"; i8 10;
3156 dnl Variable attributes record.
3159 "fred(23"; i8 10; ")"
3162 dnl Dictionary termination record.
3165 for variant in be le; do
3166 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3167 AT_DATA([sys-file.sps], [dnl
3168 GET FILE='sys-file.sav'.
3170 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3171 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3173 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3178 AT_SETUP([bad variable name in long string value label])
3179 AT_KEYWORDS([sack synthetic system file negative])
3180 AT_DATA([sys-file.sack], [dnl
3182 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3183 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3186 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3187 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3188 2; -1; 0; 0; 0; 0; s8 "";
3191 dnl No variable named STR9.
3192 COUNT(>>"STR9"<<); 9;
3193 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3195 dnl NUM1 is numeric.
3196 COUNT(>>"NUM1"<<); 0;
3197 1; COUNT("xyz"); COUNT("value label for 1.0");
3199 dnl Wrong width for STR14.
3200 COUNT("STR14"); >>9<<;
3201 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3203 dnl Wrong width for value.
3205 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3207 dnl Duplicate value label.
3208 COUNT("STR14"); 14; 2;
3209 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3210 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3213 dnl Dictionary termination record.
3216 for variant in be le; do
3217 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3218 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3220 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3221 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3223 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3225 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).
3227 "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."
3229 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3234 AT_SETUP([fewer data records than indicated by file header])
3235 AT_KEYWORDS([sack synthetic system file negative])
3236 AT_DATA([sys-file.sack], [dnl
3238 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3239 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3241 dnl Numeric variables.
3242 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3243 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3251 dnl Missing record here.
3253 for variant in be le; do
3254 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3255 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3258 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3259 [error: Error reading case from file `sys-file.sav'.
3271 AT_SETUP([partial data record between variables])
3272 AT_KEYWORDS([sack synthetic system file negative])
3273 AT_DATA([sys-file.sack], [dnl
3275 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3276 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3278 dnl Numeric variables.
3279 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3280 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3287 for variant in be le; do
3288 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3289 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3292 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3293 [error: `sys-file.sav' near offset 0x110: File ends in partial case.
3302 AT_SETUP([partial data record within long string])
3303 AT_KEYWORDS([sack synthetic system file negative])
3304 AT_DATA([sys-file.sack], [dnl
3306 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3307 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3309 dnl Numeric variables.
3310 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3311 2; -1; 0; 0; 0; 0; s8 "";
3315 s14 "one data item";
3318 for variant in be le; do
3319 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3320 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3323 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3324 [error: `sys-file.sav' near offset 0x10e: Unexpected end of file.
3333 AT_SETUP([partial compressed data record])
3334 AT_KEYWORDS([sack synthetic system file positive])
3335 AT_DATA([sys-file.sack], [dnl
3337 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3339 6; dnl Nominal case size
3342 -1; dnl Unspecified number of cases.
3344 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3347 dnl Numeric variables.
3348 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3349 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3351 dnl String variable.
3352 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3353 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3354 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3355 2; -1; 0; 0; 0; 0; s8 "";
3357 dnl Dictionary termination record.
3360 dnl Compressed data.
3361 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3363 for variant in be le; do
3364 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3365 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3368 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3369 [error: `sys-file.sav' near offset 0x190: File ends in partial case.
3372 num1,num2,str4,str8,str15
3373 -99,0,,abcdefgh,0123 @&t@
3378 AT_SETUP([zcompressed data - bad zheader_ofs])
3379 AT_KEYWORDS([sack synthetic system file negative zlib])
3380 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3381 for variant in be le; do
3382 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3383 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3385 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x178: Wrong ZLIB data header offset 0 (expected 0x178).
3390 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3391 AT_KEYWORDS([sack synthetic system file negative zlib])
3392 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3393 for variant in be le; do
3394 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3395 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3397 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x178: Impossible ZLIB trailer offset 0x0.
3402 # ztrailer_len must be a multiple of 24 and at least 48,
3403 # so a value of 12 is impossible.
3404 AT_SETUP([zcompressed data - invalid ztrailer_len])
3405 AT_KEYWORDS([sack synthetic system file negative zlib])
3406 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3407 for variant in be le; do
3408 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3409 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3411 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x178: Invalid ZLIB trailer length 12.
3416 # ztrailer_ofs + ztrailer_len must be the file size.
3417 AT_SETUP([zcompressed data - wrong ztrailer_len])
3418 AT_KEYWORDS([sack synthetic system file negative zlib])
3419 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3420 for variant in be le; do
3421 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3422 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3424 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [warning: `sys-file.sav' near offset 0x190: End of ZLIB trailer (0x231) is not file size (0x219).
3425 error: `sys-file.sav' near offset 0x201: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3430 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3431 AT_KEYWORDS([sack synthetic system file negative zlib])
3432 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3433 for variant in be le; do
3434 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3435 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3437 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x1f1: ZLIB trailer bias (0) differs from file header bias (100.00).
3442 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3443 AT_KEYWORDS([sack synthetic system file negative zlib])
3444 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3445 for variant in be le; do
3446 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3447 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3449 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x1f9: ZLIB trailer "zero" field has nonzero value 100.
3454 AT_SETUP([zcompressed data - wrong block_size])
3455 AT_KEYWORDS([sack synthetic system file negative zlib])
3456 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3457 for variant in be le; do
3458 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3459 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3461 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x1fd: ZLIB trailer specifies unexpected 4096-byte block size.
3466 AT_SETUP([zcompressed data - wrong n_blocks])
3467 AT_KEYWORDS([sack synthetic system file negative zlib])
3468 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3469 for variant in be le; do
3470 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3471 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3473 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x201: 48-byte ZLIB trailer specifies 2 data blocks (expected 1).
3478 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3479 AT_KEYWORDS([sack synthetic system file negative zlib])
3480 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3481 for variant in be le; do
3482 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3483 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3485 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x201: ZLIB block descriptor 0 reported uncompressed data offset 0x177, when 0x178 was expected.
3490 AT_SETUP([zcompressed data - wrong compressed_ofs])
3491 AT_KEYWORDS([sack synthetic system file negative zlib])
3492 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3493 for variant in be le; do
3494 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3495 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3497 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x201: ZLIB block descriptor 0 reported compressed data offset 0x191, when 0x190 was expected.
3502 AT_SETUP([zcompressed data - compressed sizes don't add up])
3503 AT_KEYWORDS([sack synthetic system file negative zlib])
3504 AT_DATA([sys-file.sack], [dnl
3506 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3508 6; dnl Nominal case size
3509 2; dnl zlib compressed
3511 -1; dnl Unspecified number of cases.
3513 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3516 dnl Numeric variables.
3517 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3518 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3520 dnl String variable.
3521 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3522 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3523 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3524 2; -1; 0; 0; 0; 0; s8 "";
3526 dnl Dictionary termination record.
3529 dnl ZLIB data header.
3530 i64 0x178; # zheader_ofs
3531 i64 0x190; # ztrailer_ofs
3532 i64 72; # ztrailer_len
3534 dnl This is where the ZLIB data blocks would go, but we don't need any to
3535 dnl provoke this message so we omit them.
3537 dnl ZLIB data trailer fixed header:
3538 i64 -100; # ztrailer_bias
3539 i64 0; # ztrailer_zero
3540 0x3ff000; # block_size
3543 dnl ZLIB block descriptor 1:
3544 i64 0x178; # uncompressed_ofs
3545 i64 0x190; # compressed_ofs
3546 0x100000; # uncompressed_size
3547 0x12345; # compressed_size
3549 dnl ZLIB block descriptor 2:
3550 i64 0x100178; # uncompressed_ofs
3551 i64 0x12405; # compressed_ofs
3552 0x100000; # uncompressed_size
3553 0x12345; # compressed_size
3555 for variant in be le; do
3556 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3557 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3559 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [warning: `sys-file.sav' near offset 0x1a8: ZLIB block descriptor 0 reported block size 0x100000, when 0x3ff000 was expected.
3560 error: `sys-file.sav' near offset 0x1c0: ZLIB block descriptor 1 reported compressed data offset 0x12405, when 0x124d5 was expected.
3565 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3566 AT_KEYWORDS([sack synthetic system file negative zlib])
3567 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3568 for variant in be le; do
3569 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3570 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3572 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x201: ZLIB block descriptor 0 reported block size 0x400000, when at most 0x3ff000 was expected.
3577 AT_SETUP([zcompressed data - compression expands data too much])
3578 AT_KEYWORDS([sack synthetic system file negative zlib])
3579 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3580 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
3581 for variant in be le; do
3582 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3583 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3585 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x201: ZLIB block descriptor 0 reports compressed size 100 and uncompressed size 50.
3590 AT_SETUP([zcompressed data - compressed sizes don't add up])
3591 AT_KEYWORDS([sack synthetic system file negative zlib])
3592 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3593 for variant in be le; do
3594 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3595 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3597 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x219: ZLIB trailer is at offset 0x1e9 but 0x1e8 would be expected from block descriptors.