sys-file-reader: Add character encoding record to all the tests.
[pspp] / tests / data / sys-file-reader.at
1 AT_BANNER([system file reader - positive])
2
3 AT_SETUP([variable labels and missing values])
4 AT_KEYWORDS([sack synthetic system file positive])
5 AT_DATA([sys-file.sack], [dnl
6 dnl File header.
7 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
8 2; dnl Layout code
9 28; dnl Nominal case size
10 0; dnl Not compressed
11 0; dnl Not weighted
12 1; dnl 1 case.
13 100.0; dnl Bias.
14 "01 Jan 11"; "20:53:52";
15 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
16 i8 0 *3;
17
18 dnl Numeric variable, no label or missing values.
19 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
20
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; ")";
24
25 dnl Numeric variable, one missing value.
26 2; 0; 0; 1; 0x050800 *2; s8 "NUM3";
27 1.0;
28
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;
32 1.0;
33
34 dnl Numeric variable, two missing values.
35 2; 0; 0; 2; 0x050800 *2; s8 "NUM5"; 1.0; 2.0;
36
37 dnl Numeric variable, three missing values.
38 2; 0; 0; 3; 0x050800 *2; s8 "NUM6"; 1.0; 2.0; 3.0;
39
40 dnl Numeric variable, range of missing values.
41 2; 0; 0; -2; 0x050800 *2; s8 "NUM7"; 1.0; 3.0;
42
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;
47 LOWEST; 1.0; 5.0;
48
49 dnl String variable, no label or missing values.
50 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
51
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;
55
56 dnl String variable, one missing value.
57 2; 4; 0; 1; 0x010400 *2; s8 "STR3"; s8 "MISS";
58
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;
62 s8 "OTHR";
63
64 dnl String variable, two missing values.
65 2; 4; 0; 2; 0x010400 *2; s8 "STR5"; s8 "MISS"; s8 "OTHR";
66
67 dnl String variable, three missing values.
68 2; 4; 0; 3; 0x010400 *2; s8 "STR6"; s8 "MISS"; s8 "OTHR"; s8 "MORE";
69
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
74 dnl compatibility.
75 2; 11; 0; 1; 0x010b00 *2; s8 "STR7"; "first8by";
76 2; -1; 0; 0; 0; 0; s8 "";
77
78 dnl Long string variables that will have missing values added with a
79 dnl later record.
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 "";
86
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";
93
94 dnl Machine integer info record.
95 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
96
97 dnl Machine floating-point info record.
98 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
99
100 dnl Long string variable missing values record.
101 7; 22; 1; COUNT (
102 dnl One missing value for STR8.
103 COUNT("STR8"); i8 1; 8; "abcdefgh";
104
105 dnl Two missing values for STR9.
106 COUNT("STR9"); i8 2; 8; "abcdefgh"; 8; "01234567";
107
108 dnl Three missing values for STR9.
109 COUNT("STR10"); i8 3; 8; "abcdefgh"; 8; "01234567"; 8; "0       ";
110 );
111
112 dnl Character encoding record.
113 7; 20; 1; 12; "windows-1252";
114
115 dnl Dictionary termination record.
116 999; 0;
117
118 dnl Data.
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";
123 ])
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'.
128 DISPLAY FILE LABEL.
129 DISPLAY DICTIONARY.
130 LIST.
131 ])
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: ôõöø
135
136 Variable,Description,,Position
137 num1,Format: F8.0,,1
138 num2,Label: Numeric variable 2's label (ùúû),,2
139 ,Format: F8.0,,
140 num3,Format: F8.0,,3
141 ,Missing Values: 1,,
142 num4,Label: Another numeric variable label,,4
143 ,Format: F8.0,,
144 ,Missing Values: 1,,
145 num5,Format: F8.0,,5
146 ,Missing Values: 1; 2,,
147 num6,Format: F8.0,,6
148 ,Missing Values: 1; 2; 3,,
149 num7,Format: F8.0,,7
150 ,Missing Values: 1 THRU 3,,
151 num8,Format: F8.0,,8
152 ,Missing Values: 1 THRU 3; 5,,
153 num9,Format: F8.0,,9
154 ,Missing Values: 1 THRU HIGHEST; -5,,
155 numàèìñò,Format: F8.0,,10
156 ,Missing Values: LOWEST THRU 1; 5,,
157 str1,Format: A4,,11
158 str2,Label: String variable 2's label,,12
159 ,Format: A4,,
160 str3,Format: A4,,13
161 ,"Missing Values: ""MISS""",,
162 str4,Label: Another string variable label,,14
163 ,Format: A4,,
164 ,"Missing Values: ""OTHR""",,
165 str5,Format: A4,,15
166 ,"Missing Values: ""MISS""; ""OTHR""",,
167 str6,Format: A4,,16
168 ,"Missing Values: ""MISS""; ""OTHR""; ""MORE""",,
169 str7,Format: A11,,17
170 ,"Missing Values: ""first8by""",,
171 str8,Format: A9,,18
172 ,"Missing Values: ""abcdefgh""",,
173 str9,Format: A10,,19
174 ,"Missing Values: ""abcdefgh""; ""01234567""",,
175 str10,Format: A11,,20
176 ,"Missing Values: ""abcdefgh""; ""01234567""; ""0       """,,
177 str11,Label: 25-byte string,,21
178 ,Format: A25,,
179
180 Table: Data List
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
183 ])
184 done
185 AT_CLEANUP
186
187 AT_SETUP([unspecified number of variable positions])
188 AT_KEYWORDS([sack synthetic system file positive])
189 AT_DATA([sys-file.sack], [dnl
190 dnl File header.
191 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
192 2; dnl Layout code
193 -1; dnl Nominal case size (unspecified)
194 0; dnl Not compressed
195 0; dnl Not weighted 
196 1; dnl 1 case.
197 100.0; dnl Bias.
198 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
199 i8 0 *3;
200
201 dnl Numeric variable, no label or missing values.
202 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
203
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;
207
208 dnl Character encoding record.
209 7; 20; 1; 12; "windows-1252";
210
211 dnl Dictionary termination record.
212 999; 0;
213
214 dnl Data.
215 1.0; 2.0; 
216 ])
217 for variant in be le; do
218   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
219   AT_DATA([sys-file.sps], [dnl
220 GET FILE='sys-file.sav'.
221 DISPLAY DICTIONARY.
222 LIST.
223 ])
224   AT_CHECK([pspp -o pspp.csv sys-file.sps])
225   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
226 Variable,Description,,Position
227 num1,Format: F8.0,,1
228 num2,Label: Numeric variable 2's label,,2
229 ,Format: F8.0,,
230
231 Table: Data List
232 num1,num2
233 1,2
234 ])
235 done
236 AT_CLEANUP
237
238 AT_SETUP([wrong number of variable positions but version 13])
239 AT_KEYWORDS([sack synthetic system file positive])
240 AT_DATA([sys-file.sack], [dnl
241 dnl File header.
242 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
243 2; dnl Layout code
244 -1; dnl Nominal case size (unspecified)
245 0; dnl Not compressed
246 0; dnl Not weighted 
247 1; dnl 1 case.
248 100.0; dnl Bias.
249 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
250 i8 0 *3;
251
252 dnl Numeric variable, no label or missing values.
253 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
254
255 dnl Numeric variable, variable label.
256 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
257 26; "Numeric variable 2's label"; i8 0 *2;
258
259 dnl Machine integer info record (SPSS 13).
260 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
261
262 dnl Character encoding record.
263 7; 20; 1; 12; "windows-1252";
264
265 dnl Dictionary termination record.
266 999; 0;
267
268 dnl Data.
269 1.0; 2.0; 
270 ])
271 for variant in be le; do
272   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
273   AT_DATA([sys-file.sps], [dnl
274 GET FILE='sys-file.sav'.
275 DISPLAY DICTIONARY.
276 LIST.
277 ])
278   AT_CHECK([pspp -o pspp.csv sys-file.sps])
279   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
280 Variable,Description,,Position
281 num1,Format: F8.0,,1
282 num2,Label: Numeric variable 2's label,,2
283 ,Format: F8.0,,
284
285 Table: Data List
286 num1,num2
287 1,2
288 ])
289 done
290 AT_CLEANUP
291
292 AT_SETUP([value labels])
293 AT_KEYWORDS([sack synthetic system file positive])
294 AT_DATA([sys-file.sack], [dnl
295 dnl File header.
296 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
297 2; dnl Layout code
298 22; dnl Nominal case size
299 0; dnl Not compressed
300 0; dnl Not weighted 
301 1; dnl 1 case.
302 100.0; dnl Bias.
303 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
304 i8 0 *3;
305
306 dnl Numeric variables.
307 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
308 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
309 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
310 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
311 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
312
313 dnl String variables.
314 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
315 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
316 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
317 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
318 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
319 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
320 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
321 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
322 2; 9; 0; 0; 0x010900 *2; "STR9"; i8 230; s3 ""; dnl index 14
323 2; -1; 0; 0; 0; 0; s8 "";
324 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
325 2; -1; 0; 0; 0; 0; s8 "";
326 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
327 2; -1; 0; 0; 0; 0; s8 "";
328 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
329 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
330
331 dnl One value label for NUM1.
332 3; 1; 1.0; i8 17; i8 238; i8 228; i8 232; i8 237; s19 " (in Russian)"; 4; 1; 1;
333
334 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
335 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
336
337 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
338 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
339 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
340
341 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
342 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
343 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
344 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
345 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
346 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
347
348 dnl One value label for STR1.
349 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
350
351 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
352 3; 2;
353 s8 "bc"; i8 20; s23 "value label for `bc'";
354 s8 "de"; i8 20; s23 "value label for `de'";
355 4; 1; 7;
356
357 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
358 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
359 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
360
361 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
362 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
363 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
364 3; 2;
365 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
366 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
367 4; 2; 9; 10;
368 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
369 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
370
371 dnl One value label for STR6, STR7, STR8.
372 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
373 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
374 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
375
376 dnl Machine integer info record.
377 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1251;
378
379 dnl Character encoding record.
380 7; 20; 1; 12; "windows-1251";
381
382 7; 21; 1; COUNT (
383 dnl One value label for STR9ж,
384 COUNT("STR9"; i8 230); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
385
386 dnl Two value labels for STR12.
387 COUNT("STR12"); 12; 2;
388 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
389 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
390
391 dnl Three value labels for STR16.
392 COUNT("STR16"); 16; 3;
393 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
394 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
395 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789' with Cyrillic letters: `"; i8 244; i8 245; i8 246; "'");
396
397 dnl One value label for STR17.
398 COUNT("STR17"); 17; 1;
399 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
400 );
401
402 dnl Dictionary termination record.
403 999; 0;
404 ])
405 for variant in be le; do
406   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
407   AT_DATA([sys-file.sps], [dnl
408 GET FILE='sys-file.sav'.
409 DISPLAY DICTIONARY.
410 ])
411   AT_CHECK([pspp -o pspp.csv sys-file.sps])
412   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
413 Variable,Description,,Position
414 num1,Format: F8.0,,1
415 ,1,один (in Russian),
416 num2,Format: F8.0,,2
417 ,1,one,
418 ,2,two,
419 num3,Format: F8.0,,3
420 ,3,three,
421 ,4,four,
422 num4,Format: F8.0,,4
423 ,5,five,
424 ,7,seven,
425 ,8,eight,
426 ,9,nine,
427 num5,Format: F8.0,,5
428 ,6,six,
429 ,7,seven,
430 ,8,eight,
431 ,10,ten,
432 str1,Format: A1,,6
433 ,a,value label for `a',
434 str2,Format: A2,,7
435 ,bc,value label for `bc',
436 ,de,value label for `de',
437 str3,Format: A3,,8
438 ,fgh,value label for `fgh',
439 ,ijk,value label for `ijk',
440 str4,Format: A4,,9
441 ,BCDE,value label for `BCDE',
442 ,lmno,value label for `lmno',
443 ,tuvw,value label for `tuvw',
444 ,xyzA,value label for `xyzA',
445 str5,Format: A4,,10
446 ,FGHI,value label for `FGHI',
447 ,pqrs,value label for `pqrs',
448 ,tuvw,value label for `tuvw',
449 ,xyzA,value label for `xyzA',
450 str6,Format: A6,,11
451 ,JKLMNO,value label for `JKLMNO',
452 str7,Format: A7,,12
453 ,JKLMNOP,value label for `JKLMNOP',
454 str8,Format: A8,,13
455 ,JKLMNOPQ,value label for `JKLMNOPQ',
456 str9ж,Format: A9,,14
457 ,RSTUVWXYZ,value label for `RSTUVWXYZ',
458 str12,Format: A12,,15
459 ,0123456789ab,value label for `0123456789ab',
460 ,cdefghijklmn,value label for `cdefghijklmn',
461 str16,Format: A16,,16
462 ,EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST',
463 ,UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц',
464 ,opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD',
465 str17,Format: A17,,17
466 ,abcdefghijklmnopq,value label for `abcdefghijklmnopq',
467 ])
468 done
469 AT_CLEANUP
470
471 AT_SETUP([documents])
472 AT_KEYWORDS([sack synthetic system file positive])
473 AT_DATA([sys-file.sack], [dnl
474 dnl File header.
475 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
476 2; dnl Layout code
477 1; dnl Nominal case size
478 0; dnl Not compressed
479 0; dnl Not weighted 
480 1; dnl 1 case.
481 100.0; dnl Bias.
482 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
483 i8 0 *3;
484
485 dnl Numeric variable, no label or missing values.
486 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
487
488 dnl Machine integer info record.
489 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
490
491 dnl Document record.
492 6; 5;
493 s80 "First line of documents";
494 s80 "Second line of documents";
495 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
496 s25 "";
497 s80 "";
498 s80 "Last line of documents";
499
500 dnl Character encoding record.
501 7; 20; 1; 12; "windows-1252";
502
503 dnl Dictionary termination record.
504 999; 0;
505
506 dnl Data.
507 1.0;
508 ])
509 for variant in be le; do
510   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
511   AT_DATA([sys-file.sps], [dnl
512 GET FILE='sys-file.sav'.
513 DISPLAY DOCUMENTS.
514 LIST.
515 ])
516   AT_CHECK([pspp -o pspp.csv sys-file.sps])
517   AT_CHECK([cat pspp.csv], [0], [dnl
518 Documents in the active dataset:
519
520 First line of documents
521
522 Second line of documents
523
524 abbé appliqué attaché blasé café canapé cliché consommé
525
526
527
528 Last line of documents
529
530 Table: Data List
531 num1
532 1
533 ])
534 done
535 AT_CLEANUP
536
537 AT_SETUP([multiple response sets])
538 AT_KEYWORDS([sack synthetic system file positive])
539 AT_DATA([sys-file.sack], [dnl
540 dnl File header.
541 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
542 2; dnl Layout code
543 16; dnl Nominal case size
544 0; dnl Not compressed
545 0; dnl Not weighted 
546 0; dnl No cases.
547 100.0; dnl Bias.
548 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
549 i8 0 *3;
550
551 dnl $a
552 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
553 2; 0; 0; 0; 0x050800 *2; s8 "B";
554 2; 0; 0; 0; 0x050800 *2; s8 "C";
555
556 dnl $b
557 2; 0; 0; 0; 0x050800 *2; s8 "D";
558 2; 0; 0; 0; 0x050800 *2; s8 "E";
559 2; 0; 0; 0; 0x050800 *2; s8 "F";
560 2; 0; 0; 0; 0x050800 *2; s8 "G";
561
562 dnl $c
563 2; 4; 0; 0; 0x010400 *2; s8 "H";
564 2; 4; 0; 0; 0x010400 *2; s8 "I";
565 2; 4; 0; 0; 0x010400 *2; s8 "J";
566
567 dnl $d
568 2; 0; 0; 0; 0x050800 *2; s8 "K";
569 2; 0; 0; 0; 0x050800 *2; s8 "L";
570 2; 0; 0; 0; 0x050800 *2; s8 "M";
571
572 dnl $e
573 2; 6; 0; 0; 0x010600 *2; s8 "N";
574 2; 6; 0; 0; 0x010600 *2; s8 "O";
575 2; 6; 0; 0; 0x010600 *2; s8 "P";
576
577 dnl Machine integer info record.
578 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
579
580 7; 7; 1;
581 COUNT(
582   "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
583   "$b=D2 55 0  g e f d"; i8 10; i8 10;
584   "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
585
586 7; 19; 1;
587 COUNT(
588   i8 10;
589   "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
590   "$e=E 11 6 choice 0  n o p"; i8 10; i8 10; i8 10; i8 10);
591
592 dnl Character encoding record.
593 7; 20; 1; 9; "shift_jis";
594
595 dnl Dictionary termination record.
596 999; 0;
597 ])
598 for variant in be le; do
599   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
600   AT_DATA([sys-file.sps], [dnl
601 GET FILE='sys-file.sav'.
602 MRSETS /DISPLAY NAME=ALL.
603 ])
604   AT_CHECK([pspp -o pspp.csv sys-file.sps])
605   AT_CHECK([cat pspp.csv], [0], [dnl
606 Table: Multiple Response Sets
607 Name,Variables,Details
608 $a,"あ
609 b
610 c
611 ","Multiple category set
612 Label: my mcgroup
613 "
614 $b,"g
615 e
616 f
617 d
618 ","Multiple dichotomy set
619 Counted value: 55
620 Category label source: Variable labels
621 "
622 $c,"h
623 i
624 j
625 ","Multiple dichotomy set
626 Label: mdgroup #2
627 Label source: Provided by user
628 Counted value: `はい'
629 Category label source: Variable labels
630 "
631 $d,"k
632 l
633 m
634 ","Multiple dichotomy set
635 Label: third mdgroup
636 Label source: Provided by user
637 Counted value: 34
638 Category label source: Value labels of counted value
639 "
640 $e,"n
641 o
642 p
643 ","Multiple dichotomy set
644 Label source: First variable label among variables
645 Counted value: `choice'
646 Category label source: Value labels of counted value
647 "
648 ])
649 done
650 AT_CLEANUP
651
652 dnl Also checks for handling of CR-only line ends in file label and
653 dnl extra product info.
654 AT_SETUP([extra product info])
655 AT_KEYWORDS([sack synthetic system file positive])
656 AT_DATA([sys-file.sack], [dnl
657 dnl File header.
658 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
659 2; dnl Layout code
660 4; dnl Nominal case size
661 0; dnl Not compressed
662 0; dnl Not weighted
663 0; dnl No cases.
664 100.0; dnl Bias.
665 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
666 i8 0 *3;
667
668 dnl Numeric variables.
669 2; 0; 0; 0; 0x050800 *2; s8 "A";
670 2; 0; 0; 0; 0x050800 *2; s8 "B";
671 2; 0; 0; 0; 0x050800 *2; s8 "C";
672 2; 0; 0; 0; 0x050800 *2; s8 "D";
673
674 dnl Extra product info.
675 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
676
677 dnl Character encoding record.
678 7; 20; 1; 12; "windows-1252";
679
680 dnl Dictionary termination record.
681 999; 0;
682 ])
683 for variant in be le; do
684   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
685   AT_DATA([sys-file.sps], [dnl
686 SYSFILE INFO FILE='sys-file.sav'.
687 ])
688   AT_CHECK([pspp -o pspp.csv sys-file.sps])
689   AT_CHECK([sed 7q pspp.csv], [0], [dnl
690 File:,sys-file.sav
691 Label:,"PSPP synthetic
692 test file"
693 Created:,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
694 Product:,"Extra product info
695 another line
696 blah"
697 ])
698 done
699 AT_CLEANUP
700
701 AT_SETUP([variable display parameters, without width])
702 AT_KEYWORDS([sack synthetic system file positive])
703 AT_DATA([sys-file.sack], [dnl
704 dnl File header.
705 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
706 2; dnl Layout code
707 19; dnl Nominal case size
708 0; dnl Not compressed
709 0; dnl Not weighted 
710 0; dnl No cases.
711 100.0; dnl Bias.
712 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
713 i8 0 *3;
714
715 dnl Numeric variables.
716 2; 0; 0; 0; 0x050800 *2; s8 "A";
717 2; 0; 0; 0; 0x050800 *2; s8 "B";
718 2; 0; 0; 0; 0x050800 *2; s8 "C";
719 2; 0; 0; 0; 0x050800 *2; s8 "D";
720
721 dnl Short string variables.
722 2; 3; 0; 0; 0x010300 *2; s8 "H";
723 2; 3; 0; 0; 0x010300 *2; s8 "I";
724 2; 3; 0; 0; 0x010300 *2; s8 "J";
725 2; 3; 0; 0; 0x010300 *2; s8 "K";
726
727 dnl Long string variables.
728 2; 9; 0; 0; 0x010900 *2; s8 "L";
729 2; -1; 0; 0; 0; 0; s8 "";
730 2; 10; 0; 0; 0x010a00 *2; s8 "M";
731 2; -1; 0; 0; 0; 0; s8 "";
732 2; 17; 0; 0; 0x011100 *2; s8 "N";
733 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
734 2; 25; 0; 0; 0x011900 *2; s8 "O";
735 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
736
737 dnl Variable display parameters
738 7; 11; 4; 24;
739 1; 0;
740 2; 0;
741 3; 0;
742 1; 1;
743 2; 1;
744 3; 1;
745 1; 2;
746 2; 2;
747 3; 2;
748 0; 0;
749 0; 1;
750 0; 2;
751
752 dnl Character encoding record.
753 7; 20; 1; 12; "windows-1252";
754
755 dnl Dictionary termination record.
756 999; 0;
757 ])
758 for variant in be le; do
759   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
760   AT_DATA([sys-file.sps], [dnl
761 GET FILE='sys-file.sav'.
762 DISPLAY DICTIONARY.
763 ])
764   AT_CHECK([pspp -o pspp.csv sys-file.sps])
765   AT_CHECK([cat pspp.csv], [0], [dnl
766 Variable,Description,,Position
767 a,Format: F8.0,,1
768 ,Measure: Nominal,,
769 ,Display Alignment: Left,,
770 ,Display Width: 8,,
771 b,Format: F8.0,,2
772 ,Measure: Ordinal,,
773 ,Display Alignment: Left,,
774 ,Display Width: 8,,
775 c,Format: F8.0,,3
776 ,Measure: Scale,,
777 ,Display Alignment: Left,,
778 ,Display Width: 8,,
779 d,Format: F8.0,,4
780 ,Measure: Nominal,,
781 ,Display Alignment: Right,,
782 ,Display Width: 8,,
783 h,Format: A3,,5
784 ,Measure: Ordinal,,
785 ,Display Alignment: Right,,
786 ,Display Width: 3,,
787 i,Format: A3,,6
788 ,Measure: Scale,,
789 ,Display Alignment: Right,,
790 ,Display Width: 3,,
791 j,Format: A3,,7
792 ,Measure: Nominal,,
793 ,Display Alignment: Center,,
794 ,Display Width: 3,,
795 k,Format: A3,,8
796 ,Measure: Ordinal,,
797 ,Display Alignment: Center,,
798 ,Display Width: 3,,
799 l,Format: A9,,9
800 ,Measure: Scale,,
801 ,Display Alignment: Center,,
802 ,Display Width: 9,,
803 m,Format: A10,,10
804 ,Measure: Nominal,,
805 ,Display Alignment: Left,,
806 ,Display Width: 10,,
807 n,Format: A17,,11
808 ,Measure: Nominal,,
809 ,Display Alignment: Right,,
810 ,Display Width: 17,,
811 o,Format: A25,,12
812 ,Measure: Nominal,,
813 ,Display Alignment: Center,,
814 ,Display Width: 25,,
815 ])
816 done
817 AT_CLEANUP
818
819 AT_SETUP([variable display parameters, with width])
820 AT_KEYWORDS([sack synthetic system file positive])
821 AT_DATA([sys-file.sack], [dnl
822 dnl File header.
823 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
824 2; dnl Layout code
825 19; dnl Nominal case size
826 0; dnl Not compressed
827 0; dnl Not weighted 
828 0; dnl No cases.
829 100.0; dnl Bias.
830 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
831 i8 0 *3;
832
833 dnl Numeric variables.
834 2; 0; 0; 0; 0x050800 *2; s8 "A";
835 2; 0; 0; 0; 0x050800 *2; s8 "B";
836 2; 0; 0; 0; 0x050800 *2; s8 "C";
837 2; 0; 0; 0; 0x050800 *2; s8 "D";
838
839 dnl Short string variables.
840 2; 3; 0; 0; 0x010300 *2; s8 "H";
841 2; 3; 0; 0; 0x010300 *2; s8 "I";
842 2; 3; 0; 0; 0x010300 *2; s8 "J";
843 2; 3; 0; 0; 0x010300 *2; s8 "K";
844
845 dnl Long string variables.
846 2; 9; 0; 0; 0x010900 *2; s8 "L";
847 2; -1; 0; 0; 0; 0; s8 "";
848 2; 10; 0; 0; 0x010a00 *2; s8 "M";
849 2; -1; 0; 0; 0; 0; s8 "";
850 2; 17; 0; 0; 0x011100 *2; s8 "N";
851 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
852 2; 25; 0; 0; 0x011900 *2; s8 "O";
853 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
854
855 dnl Variable display parameters
856 7; 11; 4; 36;
857 1; 1; 0;
858 2; 2; 0;
859 3; 3; 0;
860 1; 4; 1;
861 2; 5; 1;
862 3; 6; 1;
863 1; 7; 2;
864 2; 8; 2;
865 3; 9; 2;
866 0; 10; 0;
867 0; 11; 1;
868 0; 12; 2;
869
870 dnl Character encoding record.
871 7; 20; 1; 12; "windows-1252";
872
873 dnl Dictionary termination record.
874 999; 0;
875 ])
876 for variant in be le; do
877   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
878   AT_DATA([sys-file.sps], [dnl
879 GET FILE='sys-file.sav'.
880 DISPLAY DICTIONARY.
881 ])
882   AT_CHECK([pspp -o pspp.csv sys-file.sps])
883   AT_CHECK([cat pspp.csv], [0], [dnl
884 Variable,Description,,Position
885 a,Format: F8.0,,1
886 ,Measure: Nominal,,
887 ,Display Alignment: Left,,
888 ,Display Width: 1,,
889 b,Format: F8.0,,2
890 ,Measure: Ordinal,,
891 ,Display Alignment: Left,,
892 ,Display Width: 2,,
893 c,Format: F8.0,,3
894 ,Measure: Scale,,
895 ,Display Alignment: Left,,
896 ,Display Width: 3,,
897 d,Format: F8.0,,4
898 ,Measure: Nominal,,
899 ,Display Alignment: Right,,
900 ,Display Width: 4,,
901 h,Format: A3,,5
902 ,Measure: Ordinal,,
903 ,Display Alignment: Right,,
904 ,Display Width: 5,,
905 i,Format: A3,,6
906 ,Measure: Scale,,
907 ,Display Alignment: Right,,
908 ,Display Width: 6,,
909 j,Format: A3,,7
910 ,Measure: Nominal,,
911 ,Display Alignment: Center,,
912 ,Display Width: 7,,
913 k,Format: A3,,8
914 ,Measure: Ordinal,,
915 ,Display Alignment: Center,,
916 ,Display Width: 8,,
917 l,Format: A9,,9
918 ,Measure: Scale,,
919 ,Display Alignment: Center,,
920 ,Display Width: 9,,
921 m,Format: A10,,10
922 ,Measure: Nominal,,
923 ,Display Alignment: Left,,
924 ,Display Width: 10,,
925 n,Format: A17,,11
926 ,Measure: Nominal,,
927 ,Display Alignment: Right,,
928 ,Display Width: 11,,
929 o,Format: A25,,12
930 ,Measure: Nominal,,
931 ,Display Alignment: Center,,
932 ,Display Width: 12,,
933 ])
934 done
935 AT_CLEANUP
936
937 AT_SETUP([long variable names])
938 AT_KEYWORDS([sack synthetic system file positive])
939 AT_DATA([sys-file.sack], [dnl
940 dnl File header.
941 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
942 2; dnl Layout code
943 7; dnl Nominal case size
944 0; dnl Not compressed
945 0; dnl Not weighted 
946 0; dnl No cases.
947 100.0; dnl Bias.
948 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
949 i8 0 *3;
950
951 dnl Numeric variables.
952 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
953 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
954 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
955 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
956 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
957 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
958 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
959
960 dnl Machine integer info record.
961 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
962
963 dnl Machine floating-point info record.
964 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
965
966 dnl Long variable names.
967 7; 13; 1; COUNT (
968 "LONGVARI=LongVariableName1"; i8 9;
969 "LONGVA_A=LongVariableName2"; i8 9;
970 "LONGVA_B=LongVariableName3"; i8 9;
971 "LONGVA_C=LongVariableName4"; i8 9;
972 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
973 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
974 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
975 );
976
977 dnl Character encoding record.
978 7; 20; 1; 12; "windows-1252";
979
980 dnl Dictionary termination record.
981 999; 0;
982 ])
983 for variant in be le; do
984   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
985   AT_DATA([sys-file.sps], [dnl
986 GET FILE='sys-file.sav'.
987 DISPLAY DICTIONARY.
988 ])
989   AT_CHECK([pspp -o pspp.csv sys-file.sps])
990   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
991 Variable,Description,,Position
992 LongVariableName1,Format: F8.0,,1
993 LongVariableName2,Format: F8.0,,2
994 LongVariableName3,Format: F8.0,,3
995 LongVariableName4,Format: F8.0,,4
996 Coördinate_X,Format: F8.0,,5
997 Coördinate_Y,Format: F8.0,,6
998 Coördinate_Z,Format: F8.0,,7
999 ])
1000 done
1001 AT_CLEANUP
1002
1003 AT_SETUP([very long strings])
1004 AT_KEYWORDS([sack synthetic system file positive])
1005 AT_DATA([sys-file.sack], [dnl
1006 dnl File header.
1007 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1008 2; dnl Layout code
1009 109; dnl Nominal case size
1010 0; dnl Not compressed
1011 0; dnl Not weighted 
1012 1; dnl No cases.
1013 100.0; dnl Bias.
1014 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1015 i8 0 *3;
1016
1017 dnl 256-byte string.
1018 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1019 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1020 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1021
1022 dnl 600-byte string.
1023 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1024 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1025 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1026 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1027 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1028 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1029
1030 dnl Machine integer info record.
1031 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1032
1033 dnl Very long string record.
1034 7; 14; 1; COUNT (
1035 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1036 "STR600=00600"; i8 0; i8 9;
1037 );
1038
1039 dnl Character encoding record.
1040 7; 20; 1; 12; "windows-1252";
1041
1042 dnl Dictionary termination record.
1043 999; 0;
1044
1045 dnl Data.
1046 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1047 "abcdefgh";
1048 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1049 "abcdefghijklmnopqrstuvwxyzABCDEF";
1050 ])
1051 for variant in be le; do
1052   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1053   AT_DATA([sys-file.sps], [dnl
1054 GET FILE='sys-file.sav'.
1055 DISPLAY DICTIONARY.
1056 LIST.
1057 ])
1058   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1059   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1060 Variable,Description,,Position
1061 séq256,Format: A256,,1
1062 str600,Format: A600,,2
1063
1064 Table: Data List
1065 séq256,str600
1066 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1067 ])
1068 done
1069 AT_CLEANUP
1070
1071 AT_SETUP([data file and variable attributes])
1072 AT_KEYWORDS([sack synthetic system file positive])
1073 AT_DATA([sys-file.sack], [dnl
1074 dnl File header.
1075 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1076 2; dnl Layout code
1077 2; dnl Nominal case size
1078 0; dnl Not compressed
1079 0; dnl Not weighted 
1080 0; dnl 1 case.
1081 100.0; dnl Bias.
1082 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1083 i8 0 *3;
1084
1085 dnl Variables.
1086 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1087 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1088
1089 dnl Machine integer info record.
1090 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1091
1092 dnl Long variable names.
1093 7; 13; 1; COUNT (
1094 "FIRSTVAR=FirstVariable"; i8 9;
1095 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1096 );
1097
1098 dnl Data file attributes record.
1099 7; 17; 1; COUNT (
1100 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1101 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1102 );
1103
1104 dnl Variable attributes record.
1105 7; 18; 1; COUNT (
1106 "FirstVariable:";
1107   "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1108   "bert('123'"; i8 10; ")";
1109   "$@Role('1'"; i8 10; ")";
1110 "/S"; i8 233; "condVariable:";
1111   "xyzzy('quux'"; i8 10; ")";
1112 );
1113
1114
1115 dnl Character encoding record.
1116 7; 20; 1; 12; "windows-1252";
1117
1118 dnl Dictionary termination record.
1119 999; 0;
1120 ])
1121 for variant in be le; do
1122   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1123   AT_DATA([sys-file.sps], [dnl
1124 GET FILE='sys-file.sav'.
1125 DISPLAY @ATTRIBUTES.
1126 ])
1127   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1128   AT_CHECK([cat pspp.csv], [0],
1129 [[Variable,Description,
1130 FirstVariable,Custom attributes:,
1131 ,$@Role,1
1132 ,adèle[1],23
1133 ,adèle[2],34
1134 ,bert,123
1135 SécondVariable,Custom attributes:,
1136 ,xyzzy,quux
1137
1138 Table: Custom data file attributes.
1139 Attribute,Value
1140 Attr1[1],Value1
1141 Attr1[2],'déclaration'
1142 SécondAttr[1],123
1143 SécondAttr[2],456
1144 ]])
1145   AT_DATA([sys-file.sps], [dnl
1146 GET FILE='sys-file.sav'.
1147 DISPLAY DICTIONARY.
1148 ])
1149   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1150   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0],
1151 [[Variable,Description,,Position
1152 FirstVariable,Format: F8.0,,1
1153 ,Role: Output,,
1154 ,Custom attributes:,,
1155 ,adèle[1],23,
1156 ,adèle[2],34,
1157 ,bert,123,
1158 SécondVariable,Format: F8.0,,2
1159 ,Custom attributes:,,
1160 ,xyzzy,quux,
1161
1162 Table: Custom data file attributes.
1163 Attribute,Value
1164 Attr1[1],Value1
1165 Attr1[2],'déclaration'
1166 SécondAttr[1],123
1167 SécondAttr[2],456
1168 ]])
1169 done
1170 AT_CLEANUP
1171
1172 AT_SETUP([variable roles])
1173 AT_KEYWORDS([sack synthetic system file positive])
1174 AT_DATA([sys-file.sack], [dnl
1175 dnl File header.
1176 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1177 2; dnl Layout code
1178 7; dnl Nominal case size
1179 0; dnl Not compressed
1180 0; dnl Not weighted
1181 0; dnl 1 case.
1182 100.0; dnl Bias.
1183 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1184 i8 0 *3;
1185
1186 dnl Variables.
1187 2; 0; 0; 0; 0x050800 *2; s8 "I";
1188 2; 0; 0; 0; 0x050800 *2; s8 "O";
1189 2; 0; 0; 0; 0x050800 *2; s8 "B";
1190 2; 0; 0; 0; 0x050800 *2; s8 "N";
1191 2; 0; 0; 0; 0x050800 *2; s8 "P";
1192 2; 0; 0; 0; 0x050800 *2; s8 "S";
1193 2; 0; 0; 0; 0x050800 *2; s8 "X";
1194
1195 dnl Machine integer info record.
1196 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1197
1198 dnl Variable attributes record.
1199 7; 18; 1; COUNT (
1200 "I:$@Role('0'"; i8 10; ")";
1201 "/O:$@Role('1'"; i8 10; ")";
1202 "/B:$@Role('2'"; i8 10; ")";
1203 "/N:$@Role('3'"; i8 10; ")";
1204 "/P:$@Role('4'"; i8 10; ")";
1205 "/S:$@Role('5'"; i8 10; ")";
1206 "/X:$@Role('6'"; i8 10; ")";
1207 );
1208
1209 dnl Character encoding record.
1210 7; 20; 1; 12; "windows-1252";
1211
1212 dnl Dictionary termination record.
1213 999; 0;
1214 ])
1215 for variant in be le; do
1216   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1217   AT_DATA([sys-file.sps], [dnl
1218 GET FILE='sys-file.sav'.
1219 DISPLAY DICTIONARY.
1220 ])
1221   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1222 warning: `sys-file.sav': Invalid role for variable x.
1223 ])
1224   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1225 warning: `sys-file.sav': Invalid role for variable x.
1226
1227 Variable,Description,,Position
1228 i,Format: F8.0,,1
1229 o,Format: F8.0,,2
1230 ,Role: Output,,
1231 b,Format: F8.0,,3
1232 ,Role: Both,,
1233 n,Format: F8.0,,4
1234 ,Role: None,,
1235 p,Format: F8.0,,5
1236 ,Role: Partition,,
1237 s,Format: F8.0,,6
1238 ,Role: Split,,
1239 x,Format: F8.0,,7
1240 ])
1241 done
1242 AT_CLEANUP
1243
1244 AT_SETUP([compressed data])
1245 AT_KEYWORDS([sack synthetic system file positive])
1246 AT_DATA([sys-file.sack], [dnl
1247 dnl File header.
1248 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1249 2; dnl Layout code
1250 6; dnl Nominal case size
1251 1; dnl Simple compression
1252 0; dnl Not weighted 
1253 -1; dnl Unspecified number of cases.
1254 100.0; dnl Bias.
1255 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1256 i8 0 *3;
1257
1258 dnl Numeric variables.
1259 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1260 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1261
1262 dnl String variable.
1263 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1264 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1265 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1266 2; -1; 0; 0; 0; 0; s8 "";
1267
1268 dnl Character encoding record.
1269 7; 20; 1; 12; "windows-1252";
1270
1271 dnl Dictionary termination record.
1272 999; 0;
1273
1274 dnl Compressed data.
1275 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1276 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1277 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1278 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1279
1280 ])
1281 for variant in be le; do
1282   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1283   AT_DATA([sys-file.sps], [dnl
1284 GET FILE='sys-file.sav'.
1285 DISPLAY DICTIONARY.
1286 LIST.
1287 ])
1288   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1289   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1290 Variable,Description,,Position
1291 num1,Format: F8.0,,1
1292 num2,Format: F8.0,,2
1293 str4,Format: A4,,3
1294 str8,Format: A8,,4
1295 str15,Format: A15,,5
1296
1297 Table: Data List
1298 num1,num2,str4,str8,str15
1299 -99,0,,abcdefgh,0123   @&t@
1300 .,151,jklm,nopqrstu,vwxyzABC       @&t@
1301 1,2,DEFG,HIJKLMNO,PQRSTUV
1302 ])
1303 done
1304 AT_CLEANUP
1305
1306 AT_SETUP([compressed data, zero bias])
1307 AT_KEYWORDS([sack synthetic system file positive])
1308 AT_DATA([sys-file.sack], [dnl
1309 dnl File header.
1310 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1311 2; dnl Layout code
1312 6; dnl Nominal case size
1313 1; dnl Simple compression.
1314 0; dnl Not weighted 
1315 -1; dnl Unspecified number of cases.
1316 0.0; dnl Bias.
1317 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1318 i8 0 *3;
1319
1320 dnl Numeric variables.
1321 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1322 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1323
1324 dnl String variable.
1325 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1326 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1327 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1328 2; -1; 0; 0; 0; 0; s8 "";
1329
1330 dnl Character encoding record.
1331 7; 20; 1; 12; "windows-1252";
1332
1333 dnl Dictionary termination record.
1334 999; 0;
1335
1336 dnl Compressed data.
1337 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1338 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1339 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1340 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1341
1342 ])
1343 for variant in be le; do
1344   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1345   AT_DATA([sys-file.sps], [dnl
1346 GET FILE='sys-file.sav'.
1347 DISPLAY DICTIONARY.
1348 LIST.
1349 ])
1350   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1351   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1352 Variable,Description,,Position
1353 num1,Format: F8.0,,1
1354 num2,Format: F8.0,,2
1355 str4,Format: A4,,3
1356 str8,Format: A8,,4
1357 str15,Format: A15,,5
1358
1359 Table: Data List
1360 num1,num2,str4,str8,str15
1361 1,100,,abcdefgh,0123   @&t@
1362 .,251,jklm,nopqrstu,vwxyzABC       @&t@
1363 101,102,DEFG,HIJKLMNO,PQRSTUV
1364 ])
1365 done
1366 AT_CLEANUP
1367
1368 AT_SETUP([compressed data, other bias])
1369 AT_KEYWORDS([sack synthetic system file positive])
1370 AT_DATA([sys-file.sack], [dnl
1371 dnl File header.
1372 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1373 2; dnl Layout code
1374 6; dnl Nominal case size
1375 1; dnl Simple compression.
1376 0; dnl Not weighted 
1377 -1; dnl Unspecified number of cases.
1378 50.0; dnl Bias.
1379 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1380 i8 0 *3;
1381
1382 dnl Numeric variables.
1383 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1384 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1385
1386 dnl String variable.
1387 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1388 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1389 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1390 2; -1; 0; 0; 0; 0; s8 "";
1391
1392 dnl Character encoding record.
1393 7; 20; 1; 12; "windows-1252";
1394
1395 dnl Dictionary termination record.
1396 999; 0;
1397
1398 dnl Compressed data.
1399 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1400 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1401 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1402 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1403
1404 ])
1405 for variant in be le; do
1406   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1407   AT_DATA([sys-file.sps], [dnl
1408 GET FILE='sys-file.sav'.
1409 DISPLAY DICTIONARY.
1410 LIST.
1411 ])
1412   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], 
1413     [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1414 ])
1415   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1416 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1417
1418 Variable,Description,,Position
1419 num1,Format: F8.0,,1
1420 num2,Format: F8.0,,2
1421 str4,Format: A4,,3
1422 str8,Format: A8,,4
1423 str15,Format: A15,,5
1424
1425 Table: Data List
1426 num1,num2,str4,str8,str15
1427 -49,50,,abcdefgh,0123   @&t@
1428 .,201,jklm,nopqrstu,vwxyzABC       @&t@
1429 51,52,DEFG,HIJKLMNO,PQRSTUV
1430 ])
1431 done
1432 AT_CLEANUP
1433
1434 m4_divert_push([PREPARE_TESTS])
1435 zcompressed_sack () {
1436     cat <<'EOF'
1437 dnl File header.
1438 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1439 2; dnl Layout code
1440 6; dnl Nominal case size
1441 2; dnl zlib compressed
1442 0; dnl Not weighted
1443 -1; dnl Unspecified number of cases.
1444 100.0; dnl Bias.
1445 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1446 i8 0 *3;
1447
1448 dnl Numeric variables.
1449 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1450 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1451
1452 dnl String variable.
1453 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1454 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1455 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1456 2; -1; 0; 0; 0; 0; s8 "";
1457
1458 dnl Character encoding record.
1459 7; 20; 1; 12; "windows-1252";
1460
1461 dnl Dictionary termination record.
1462 999; 0;
1463
1464 dnl ZLIB data header.
1465 i64 0x194;    # zheader_ofs
1466 i64 0x205;    # ztrailer_ofs
1467 i64 48;       # ztrailer_len
1468
1469 dnl ZLIB data block.
1470 dnl
1471 dnl This is the compressed form of:
1472 dnl
1473 dnl 01 64 fe fd fe fd ff fb  61 62 63 64 65 66 67 68  |.d......abcdefgh|
1474 dnl 30 31 32 33 20 20 20 20  fd fd fd fe 65 66 fd fd  |0123    ....ef..|
1475 dnl 6a 6b 6c 6d 20 20 20 20  6e 6f 70 71 72 73 74 75  |jklm    nopqrstu|
1476 dnl 76 77 78 79 7a 41 42 43  44 45 46 47 20 20 20 20  |vwxyzABCDEFG    |
1477 dnl 48 49 4a 4b 4c 4d 4e 4f  fe fd fc 00 00 00 00 00  |HIJKLMNO........|
1478 dnl 50 51 52 53 54 55 56 57                           |PQRSTUVW|
1479 dnl
1480 dnl which is the data from the "compressed data" test.
1481 hex "78 01 63 4c f9 f7 f7 df  df ff bf 13 93 92 53 52";
1482 hex "d3 d2 33 0c 0c 8d 8c 15  80 e0 ef df bf ff 52 d3";
1483 hex "fe fe cd ca ce c9 05 f1  f3 f2 0b 0a 8b 8a 4b 4a";
1484 hex "cb ca 2b 2a ab 1c 9d 9c  5d 5c dd dc 41 e2 1e 9e";
1485 hex "5e de 3e be 7e fe ff fe  fe 61 00 81 80 c0 a0 e0";
1486 hex "90 d0 b0 70 00 0f 3f 23  d7";
1487
1488 dnl ZLIB data trailer fixed header:
1489 i64 -100;     # ztrailer_bias
1490 i64 0;        # ztrailer_zero
1491 0x3ff000;     # block_size
1492 1;            # n_blocks
1493
1494 dnl ZLIB block descriptor:
1495 i64 0x194;    # uncompressed_ofs
1496 i64 0x1ac;    # compressed_ofs
1497 88;           # uncompressed_size
1498 89;           # compressed_size
1499 EOF
1500 }
1501 m4_divert_pop([PREPARE_TESTS])
1502
1503 AT_SETUP([zcompressed data])
1504 AT_KEYWORDS([sack synthetic system file positive zlib])
1505 zcompressed_sack > sys-file.sack
1506 for variant in be le; do
1507   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1508   AT_DATA([sys-file.sps], [dnl
1509 GET FILE='sys-file.sav'.
1510 DISPLAY DICTIONARY.
1511 LIST.
1512 ])
1513   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1514   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1515 Variable,Description,,Position
1516 num1,Format: F8.0,,1
1517 num2,Format: F8.0,,2
1518 str4,Format: A4,,3
1519 str8,Format: A8,,4
1520 str15,Format: A15,,5
1521
1522 Table: Data List
1523 num1,num2,str4,str8,str15
1524 -99,0,,abcdefgh,0123   @&t@
1525 .,151,jklm,nopqrstu,vwxyzABC       @&t@
1526 1,2,DEFG,HIJKLMNO,PQRSTUV
1527 ])
1528 done
1529 AT_CLEANUP
1530 \f
1531 AT_BANNER([system file reader - negative])
1532
1533 AT_SETUP([misplaced type 4 record])
1534 AT_KEYWORDS([sack synthetic system file negative])
1535 AT_DATA([sys-file.sack], [dnl
1536 dnl File header.
1537 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1538 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1539
1540 dnl Numeric variable.
1541 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1542
1543 dnl Type 4 record.
1544 >>4<<;
1545 ])
1546 for variant in be le; do
1547   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1548   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1549 ])
1550   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1551    [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1552 ])
1553 done
1554 AT_CLEANUP
1555
1556 AT_SETUP([bad record type])
1557 AT_KEYWORDS([sack synthetic system file negative])
1558 AT_DATA([sys-file.sack], [dnl
1559 dnl File header.
1560 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1561 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1562
1563 dnl Numeric variable.
1564 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1565
1566 dnl Type 8 record (not a valid type).
1567 >>8<<;
1568 ])
1569 for variant in be le; do
1570   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1571   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1572 ])
1573   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1574    [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1575 ])
1576 done
1577 AT_CLEANUP
1578
1579 AT_SETUP([wrong number of variable positions])
1580 AT_KEYWORDS([sack synthetic system file negative])
1581 AT_DATA([sys-file.sack], [dnl
1582 dnl File header.
1583 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1584 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1585
1586 dnl Numeric variable.
1587 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1588
1589 dnl Character encoding record.
1590 7; 20; 1; 12; "windows-1252";
1591
1592 dnl End of dictionary.
1593 999; 0;
1594 ])
1595 for variant in be le; do
1596   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1597   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1598 ])
1599   AT_CHECK([pspp -O format=csv sys-file.sps], [0], 
1600    [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1601 ])
1602 done
1603 AT_CLEANUP
1604
1605 AT_SETUP([variable name may not begin with `#'])
1606 AT_KEYWORDS([sack synthetic system file negative])
1607 AT_DATA([sys-file.sack], [dnl
1608 dnl File header.
1609 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1610 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1611
1612 dnl Numeric variable.
1613 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1614
1615 dnl Character encoding record.
1616 7; 20; 1; 12; "windows-1252";
1617
1618 dnl End of dictionary.
1619 999; 0;
1620 ])
1621 for variant in be le; do
1622   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1623   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1624 ])
1625   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1626    [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1627 ])
1628 done
1629 AT_CLEANUP
1630
1631 AT_SETUP([variable name may not be reserved word])
1632 AT_KEYWORDS([sack synthetic system file negative])
1633 AT_DATA([sys-file.sack], [dnl
1634 dnl File header.
1635 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1636 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1637
1638 dnl Numeric variable.
1639 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1640
1641 dnl Character encoding record.
1642 7; 20; 1; 12; "windows-1252";
1643
1644 dnl End of dictionary.
1645 999; 0;
1646 ])
1647 for variant in be le; do
1648   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1649   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1650 ])
1651   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1652    [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1653 ])
1654 done
1655 AT_CLEANUP
1656
1657 AT_SETUP([variable width must be between 0 and 255])
1658 AT_KEYWORDS([sack synthetic system file negative])
1659 AT_DATA([sys-file.sack], [dnl
1660 dnl File header.
1661 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1662 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1663
1664 dnl String variable with invalid width 256.
1665 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1666
1667 dnl Character encoding record.
1668 7; 20; 1; 12; "windows-1252";
1669
1670 dnl End of dictionary.
1671 999; 0;
1672 ])
1673 for variant in be le; do
1674   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1675   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1676 ])
1677   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1678    [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1679 ])
1680 done
1681 AT_CLEANUP
1682
1683 dnl SPSS-generated system file can contain duplicate variable names
1684 dnl (see bug #41475).
1685 AT_SETUP([duplicate variable name])
1686 AT_KEYWORDS([sack synthetic system file negative])
1687 AT_DATA([sys-file.sack], [dnl
1688 dnl File header.
1689 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1690 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1691
1692 dnl Numeric variables.
1693 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1694 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1695
1696 dnl Character encoding record.
1697 7; 20; 1; 12; "windows-1252";
1698
1699 dnl End of dictionary.
1700 999; 0;
1701 ])
1702 for variant in be le; do
1703   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1704   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1705 DISPLAY DICTIONARY.
1706 ])
1707   AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1708    [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1709
1710 Variable,Description,,Position
1711 var1,Format: F8.0,,1
1712 ,Measure: Scale,,
1713 ,Display Alignment: Right,,
1714 ,Display Width: 8,,
1715 var001,Format: F8.0,,2
1716 ,Measure: Scale,,
1717 ,Display Alignment: Right,,
1718 ,Display Width: 8,,
1719 ])
1720 done
1721 AT_CLEANUP
1722
1723 AT_SETUP([variable label indicator not 0 or 1])
1724 AT_KEYWORDS([sack synthetic system file negative])
1725 AT_DATA([sys-file.sack], [dnl
1726 dnl File header.
1727 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1728 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1729
1730 dnl Numeric variable.
1731 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1732
1733 dnl Character encoding record.
1734 7; 20; 1; 12; "windows-1252";
1735
1736 dnl End of dictionary.
1737 999; 0;
1738 ])
1739 for variant in be le; do
1740   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1741   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1742 ])
1743   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1744    [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1745 ])
1746 done
1747 AT_CLEANUP
1748
1749 AT_SETUP([invalid numeric missing value indicator])
1750 AT_KEYWORDS([sack synthetic system file negative])
1751 AT_DATA([sys-file.sack], [dnl
1752 dnl File header.
1753 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1754 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1755
1756 dnl Numeric variable.
1757 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1758
1759 dnl Character encoding record.
1760 7; 20; 1; 12; "windows-1252";
1761
1762 dnl End of dictionary.
1763 999; 0;
1764 ])
1765 for variant in be le; do
1766   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1767   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1768 ])
1769   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1770    ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1771 ])
1772 done
1773 AT_CLEANUP
1774
1775 AT_SETUP([invalid string missing value indicator])
1776 AT_KEYWORDS([sack synthetic system file negative])
1777 AT_DATA([sys-file.sack], [dnl
1778 dnl File header.
1779 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1780 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1781
1782 dnl String variable.
1783 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1784
1785 dnl Character encoding record.
1786 7; 20; 1; 12; "windows-1252";
1787
1788 dnl End of dictionary.
1789 999; 0;
1790 ])
1791 for variant in be le; do
1792   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1793   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1794 ])
1795   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1796    ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1797 ])
1798 done
1799 AT_CLEANUP
1800
1801 AT_SETUP([missing string continuation record])
1802 AT_KEYWORDS([sack synthetic system file negative])
1803 AT_DATA([sys-file.sack], [dnl
1804 dnl File header.
1805 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1806 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1807
1808 dnl String variable.
1809 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1810 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1811
1812 dnl Character encoding record.
1813 7; 20; 1; 12; "windows-1252";
1814
1815 dnl End of dictionary.
1816 999; 0;
1817 ])
1818 for variant in be le; do
1819   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1820   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1821 ])
1822   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1823    [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1824 ])
1825 done
1826 AT_CLEANUP
1827
1828 AT_SETUP([invalid variable format])
1829 AT_KEYWORDS([sack synthetic system file negative])
1830 AT_DATA([sys-file.sack], [dnl
1831 dnl File header.
1832 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1833 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1834
1835 dnl Numeric variable, invalid format types.
1836 dnl No warning is issued for type 0 because it has been observed in real
1837 dnl system files.
1838 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1839
1840 dnl Numeric variable, string formats.
1841 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1842
1843 dnl String variable, numeric formats.
1844 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1845
1846 dnl String variable, wrong width formats.
1847 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1848
1849 dnl Character encoding record.
1850 7; 20; 1; 12; "windows-1252";
1851
1852 dnl End of dictionary.
1853 999; 0;
1854 ])
1855 for variant in be le; do
1856   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1857   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1858 ])
1859   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1860 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1861
1862 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1863
1864 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1865
1866 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1867
1868 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1869
1870 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1871
1872 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1873 ])
1874 done
1875 AT_CLEANUP
1876
1877 AT_SETUP([invalid long string missing values])
1878 AT_KEYWORDS([sack synthetic system file negative])
1879 AT_DATA([sys-file.sack], [dnl
1880 dnl File header.
1881 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1882 2; dnl Layout code
1883 7; dnl Nominal case size
1884 0; dnl Not compressed
1885 0; dnl Not weighted
1886 1; dnl 1 case.
1887 100.0; dnl Bias.
1888 "01 Jan 11"; "20:53:52";
1889 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1890 i8 0 *3;
1891
1892 dnl One numeric variable.
1893 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1894
1895 dnl Long string variables that will have missing values added with a
1896 dnl later record.
1897 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1898 2; -1; 0; 0; 0; 0; s8 "";
1899 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
1900 2; -1; 0; 0; 0; 0; s8 "";
1901 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
1902 2; -1; 0; 0; 0; 0; s8 "";
1903
1904 dnl Machine integer info record.
1905 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1906
1907 dnl Machine floating-point info record.
1908 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1909
1910 dnl Long string variable missing values record.
1911 7; 22; 1; COUNT (
1912 dnl Zero missing values (not allowed) for STR1 .
1913 COUNT("STR1"); i8 >>0<<;
1914
1915 dnl Four missing values (not allowed) for STR2.
1916 COUNT("STR2"); i8 4;
1917 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
1918
1919 dnl Missing values for unknown variable
1920 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
1921
1922 dnl Missing values for numeric variable
1923 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
1924
1925 dnl Too long missing value
1926 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
1927 );
1928
1929 dnl Character encoding record.
1930 7; 20; 1; 12; "windows-1252";
1931
1932 dnl Dictionary termination record.
1933 999; 0;
1934 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
1935 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
1936 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
1937 ])
1938
1939 for variant in be le; do
1940   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1941   AT_DATA([sys-file.sps], [dnl
1942 GET FILE='sys-file.sav'.
1943 DISPLAY DICTIONARY.
1944 ])
1945   AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1946    ["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."
1947
1948 "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."
1949
1950 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
1951
1952 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
1953
1954 "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."
1955
1956 Variable,Description,,Position
1957 num1,Format: F8.0,,1
1958 ,Measure: Scale,,
1959 ,Display Alignment: Right,,
1960 ,Display Width: 8,,
1961 str1,Format: A9,,2
1962 ,Measure: Nominal,,
1963 ,Display Alignment: Left,,
1964 ,Display Width: 9,,
1965 str2,Format: A10,,3
1966 ,Measure: Nominal,,
1967 ,Display Alignment: Left,,
1968 ,Display Width: 10,,
1969 ,"Missing Values: ""abcdefgh""; ""ijklmnop""; ""qrstuvwx""",,
1970 str3,Format: A11,,4
1971 ,Measure: Nominal,,
1972 ,Display Alignment: Left,,
1973 ,Display Width: 11,,
1974 ])
1975 done
1976 AT_CLEANUP
1977
1978 AT_SETUP([weighting variable must be numeric])
1979 AT_KEYWORDS([sack synthetic system file negative])
1980 AT_DATA([sys-file.sack], [dnl
1981 dnl File header.
1982 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1983 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1984
1985 dnl Numeric variable.
1986 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1987
1988 dnl String variable.
1989 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1990
1991 dnl Character encoding record.
1992 7; 20; 1; 12; "windows-1252";
1993
1994 dnl End of dictionary.
1995 999; 0;
1996 ])
1997 for variant in be le; do
1998   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1999   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2000 DISPLAY DICTIONARY.
2001 ])
2002   AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2003    [warning: `sys-file.sav': Ignoring string variable `STR1' set as weighting variable.
2004
2005 Variable,Description,,Position
2006 num1,Format: F8.0,,1
2007 ,Measure: Scale,,
2008 ,Display Alignment: Right,,
2009 ,Display Width: 8,,
2010 str1,Format: A4,,2
2011 ,Measure: Nominal,,
2012 ,Display Alignment: Left,,
2013 ,Display Width: 4,,
2014 ])
2015 done
2016 AT_CLEANUP
2017
2018 AT_SETUP([bad weighting variable index])
2019 AT_KEYWORDS([sack synthetic system file negative])
2020 AT_DATA([sys-file.sack], [dnl
2021 dnl File header.
2022 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2023 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2024
2025 dnl Numeric variable.
2026 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2027
2028 dnl String variable.
2029 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2030
2031 dnl Character encoding record.
2032 7; 20; 1; 12; "windows-1252";
2033
2034 dnl End of dictionary.
2035 999; 0;
2036 ])
2037 for variant in be le; do
2038   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2039   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2040 ])
2041   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
2042    [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
2043 ])
2044 done
2045 AT_CLEANUP
2046
2047 AT_SETUP([variable index is long string contination])
2048 AT_KEYWORDS([sack synthetic system file negative])
2049 AT_DATA([sys-file.sack], [dnl
2050 dnl File header.
2051 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2052 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2053
2054 dnl Numeric variable.
2055 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2056
2057 dnl Long string variable.
2058 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2059 (2; -1; 0; 0; 0; 0; s8 "");
2060
2061 dnl Character encoding record.
2062 7; 20; 1; 12; "windows-1252";
2063
2064 dnl End of dictionary.
2065 999; 0;
2066 ])
2067 for variant in be le; do
2068   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2069   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2070 ])
2071   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
2072    [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
2073 ])
2074 done
2075 AT_CLEANUP
2076
2077 AT_SETUP([multiple documents records])
2078 AT_KEYWORDS([sack synthetic system file negative])
2079 AT_DATA([sys-file.sack], [dnl
2080 dnl File header.
2081 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2082 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2083
2084 dnl Numeric variable, no label or missing values.
2085 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2086
2087 dnl Two document records.
2088 (6; 1; s80 "One line of documents") >>* 2<<;
2089
2090 dnl Dictionary termination record.
2091 999; 0;
2092
2093 dnl Character encoding record.
2094 7; 20; 1; 12; "windows-1252";
2095
2096 dnl Data.
2097 1.0;
2098 ])
2099 for variant in be le; do
2100   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2101   AT_DATA([sys-file.sps], [dnl
2102 GET FILE='sys-file.sav'.
2103 ])
2104   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2105 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
2106 ])
2107 done
2108 AT_CLEANUP
2109
2110
2111 AT_SETUP([empty document record])
2112 AT_KEYWORDS([sack synthetic system file negative])
2113 AT_DATA([sys-file.sack], [dnl
2114 dnl File header.
2115 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2116 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2117
2118 dnl Numeric variable, no label or missing values.
2119 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2120
2121 dnl Empty document record.
2122 6; >>0<<;
2123
2124 dnl Dictionary termination record.
2125 999; 0;
2126
2127 dnl Data.
2128 1.0;
2129 ])
2130 for variant in be le; do
2131   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2132   AT_DATA([sys-file.sps], [dnl
2133 GET FILE='sys-file.sav'.
2134 ])
2135   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2136 error: `sys-file.sav' near offset 0xd4: Number of document lines (0) must be greater than 0 and less than 26843545.
2137 ])
2138 done
2139 AT_CLEANUP
2140
2141 AT_SETUP([extension record too large])
2142 AT_KEYWORDS([sack synthetic system file negative])
2143 AT_DATA([sys-file.sack], [dnl
2144 dnl File header.
2145 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2146 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2147
2148 dnl Numeric variable, no label or missing values.
2149 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2150
2151 dnl Too-large extension record.
2152 7; 3; >>0xfffff000 * 2<<;
2153 ])
2154 for variant in be le; do
2155   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2156   AT_DATA([sys-file.sps], [dnl
2157 GET FILE='sys-file.sav'.
2158 ])
2159   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2160 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2161 ])
2162 done
2163 AT_CLEANUP
2164
2165 AT_SETUP([unknown extension record])
2166 AT_KEYWORDS([sack synthetic system file negative])
2167 AT_DATA([sys-file.sack], [dnl
2168 dnl File header.
2169 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2170 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2171
2172 dnl Numeric variable, no label or missing values.
2173 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2174
2175 dnl Unknown extension record type.
2176 7; 30; 1; 1; i8 0;
2177
2178 dnl Character encoding record.
2179 7; 20; 1; 12; "windows-1252";
2180
2181 dnl End of dictionary.
2182 999; 0;
2183 ])
2184 for variant in be le; do
2185   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2186   AT_DATA([sys-file.sps], [dnl
2187 GET FILE='sys-file.sav'.
2188 ])
2189   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2190 "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."
2191 ])
2192 done
2193 AT_CLEANUP
2194
2195 AT_SETUP([bad machine integer info size])
2196 AT_KEYWORDS([sack synthetic system file negative])
2197 AT_DATA([sys-file.sack], [dnl
2198 dnl File header.
2199 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2200 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2201
2202 dnl Numeric variable, no label or missing values.
2203 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2204
2205 dnl Machine integer info record.
2206 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2207
2208 dnl Character encoding record.
2209 7; 20; 1; 12; "windows-1252";
2210
2211 dnl End of dictionary.
2212 999; 0;
2213 ])
2214 for variant in be le; do
2215   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2216   AT_DATA([sys-file.sps], [dnl
2217 GET FILE='sys-file.sav'.
2218 ])
2219   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2220 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2221 ])
2222 done
2223 AT_CLEANUP
2224
2225 AT_SETUP([bad machine integer info float format])
2226 AT_KEYWORDS([sack synthetic system file negative])
2227 AT_DATA([sys-file.sack], [dnl
2228 dnl File header.
2229 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2230 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2231
2232 dnl Numeric variable, no label or missing values.
2233 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2234
2235 dnl Machine integer info record.
2236 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2237
2238 dnl Character encoding record.
2239 7; 20; 1; 12; "windows-1252";
2240
2241 dnl End of dictionary.
2242 999; 0;
2243 ])
2244 for variant in be le; do
2245   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2246   AT_DATA([sys-file.sps], [dnl
2247 GET FILE='sys-file.sav'.
2248 ])
2249   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2250 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2251 ])
2252 done
2253 AT_CLEANUP
2254
2255 AT_SETUP([bad machine integer info endianness])
2256 AT_KEYWORDS([sack synthetic system file negative])
2257 AT_DATA([sys-file.sack], [dnl
2258 dnl File header.
2259 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2260 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2261
2262 dnl Numeric variable, no label or missing values.
2263 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2264
2265 dnl Machine integer info record.
2266 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2267
2268 dnl Character encoding record.
2269 7; 20; 1; 12; "windows-1252";
2270
2271 dnl End of dictionary.
2272 999; 0;
2273 ])
2274 for variant in "be 1" "le 2"; do
2275   set $variant
2276   AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2277   AT_DATA([sys-file.sps], [dnl
2278 GET FILE='sys-file.sav'.
2279 DISPLAY DICTIONARY.
2280 ])
2281   AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2282 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2283
2284 Variable,Description,,Position
2285 num1,Format: F8.0,,1
2286 ,Measure: Scale,,
2287 ,Display Alignment: Right,,
2288 ,Display Width: 8,,
2289 ])
2290 done
2291 AT_CLEANUP
2292
2293
2294 AT_SETUP([bad machine floating-point info size])
2295 AT_KEYWORDS([sack synthetic system file negative])
2296 AT_DATA([sys-file.sack], [dnl
2297 dnl File header.
2298 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2299 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2300
2301 dnl Numeric variable, no label or missing values.
2302 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2303
2304 dnl Machine floating-point info record.
2305 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2306
2307 dnl Character encoding record.
2308 7; 20; 1; 12; "windows-1252";
2309
2310 dnl End of dictionary.
2311 999; 0;
2312 ])
2313 for variant in be le; do
2314   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2315   AT_DATA([sys-file.sps], [dnl
2316 GET FILE='sys-file.sav'.
2317 ])
2318   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2319 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2320 ])
2321 done
2322 AT_CLEANUP
2323
2324 AT_SETUP([wrong special floating point values])
2325 AT_KEYWORDS([sack synthetic system file negative])
2326 AT_DATA([sys-file.sack], [dnl
2327 dnl File header.
2328 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2329 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2330
2331 dnl Numeric variable, no label or missing values.
2332 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2333
2334 dnl Machine floating-point info record.
2335 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2336
2337 dnl Character encoding record.
2338 7; 20; 1; 12; "windows-1252";
2339
2340 dnl End of dictionary.
2341 999; 0;
2342 ])
2343 for variant in be le; do
2344   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2345   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2346 ])
2347   AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2348 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2349
2350 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2351
2352 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2353 ])
2354 done
2355 AT_CLEANUP
2356
2357 AT_SETUP([bad mrsets name])
2358 AT_KEYWORDS([sack synthetic system file negative multiple response])
2359 AT_DATA([sys-file.sack], [dnl
2360 dnl File header.
2361 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2362 2; dnl Layout code
2363 16; dnl Nominal case size
2364 0; dnl Not compressed
2365 0; dnl Not weighted
2366 0; dnl No cases.
2367 100.0; dnl Bias.
2368 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2369 i8 0 *3;
2370
2371 dnl $a
2372 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2373 2; 0; 0; 0; 0x050800 *2; s8 "B";
2374 2; 0; 0; 0; 0x050800 *2; s8 "C";
2375
2376 dnl $b
2377 2; 0; 0; 0; 0x050800 *2; s8 "D";
2378 2; 0; 0; 0; 0x050800 *2; s8 "E";
2379 2; 0; 0; 0; 0x050800 *2; s8 "F";
2380 2; 0; 0; 0; 0x050800 *2; s8 "G";
2381
2382 dnl $c
2383 2; 4; 0; 0; 0x010400 *2; s8 "H";
2384 2; 4; 0; 0; 0x010400 *2; s8 "I";
2385 2; 4; 0; 0; 0x010400 *2; s8 "J";
2386
2387 dnl $d
2388 2; 0; 0; 0; 0x050800 *2; s8 "K";
2389 2; 0; 0; 0; 0x050800 *2; s8 "L";
2390 2; 0; 0; 0; 0x050800 *2; s8 "M";
2391
2392 dnl $e
2393 2; 6; 0; 0; 0x010600 *2; s8 "N";
2394 2; 6; 0; 0; 0x010600 *2; s8 "O";
2395 2; 6; 0; 0; 0x010600 *2; s8 "P";
2396
2397 dnl Machine integer info record.
2398 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2399
2400 7; 7; 1;
2401 COUNT(
2402   "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2403   "b=D2 55 0  g e f d"; i8 10;
2404   "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2405
2406 7; 19; 1;
2407 COUNT(
2408   "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2409   "e=E 11 6 choice 0  n o p"; i8 10);
2410
2411 dnl Character encoding record.
2412 7; 20; 1; 9; "shift_jis";
2413
2414 dnl Dictionary termination record.
2415 999; 0;
2416 ])
2417 for variant in be le; do
2418   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2419   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2420 MRSETS /DISPLAY NAME=ALL.
2421 ])
2422   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2423 warning: `sys-file.sav': Multiple response set name `b' does not begin with `$'.
2424
2425 warning: `sys-file.sav': Multiple response set name `e' does not begin with `$'.
2426
2427 Table: Multiple Response Sets
2428 Name,Variables,Details
2429 $a,"あ
2430 b
2431 c
2432 ","Multiple category set
2433 Label: my mcgroup
2434 "
2435 $c,"h
2436 i
2437 j
2438 ","Multiple dichotomy set
2439 Label: mdgroup #2
2440 Label source: Provided by user
2441 Counted value: `はい'
2442 Category label source: Variable labels
2443 "
2444 $d,"k
2445 l
2446 m
2447 ","Multiple dichotomy set
2448 Label: third mdgroup
2449 Label source: Provided by user
2450 Counted value: 34
2451 Category label source: Value labels of counted value
2452 "
2453 ])
2454 done
2455 AT_CLEANUP
2456
2457 AT_SETUP([missing space after C in mrsets])
2458 AT_KEYWORDS([sack synthetic system file negative multiple response])
2459 AT_DATA([sys-file.sack], [dnl
2460 dnl File header.
2461 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2462 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2463
2464 dnl Numeric variable, no label or missing values.
2465 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2466
2467 dnl Multiple response sets.
2468 7; 7; 1; COUNT("$a=Cx");
2469
2470 dnl Character encoding record.
2471 7; 20; 1; 12; "windows-1252";
2472
2473 999; 0;
2474 ])
2475 for variant in be le; do
2476   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2477   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2478 ])
2479   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2480 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2481 ])
2482 done
2483 AT_CLEANUP
2484
2485 AT_SETUP([missing space after E in mrsets])
2486 AT_KEYWORDS([sack synthetic system file negative multiple response])
2487 AT_DATA([sys-file.sack], [dnl
2488 dnl File header.
2489 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2490 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2491
2492 dnl Numeric variable, no label or missing values.
2493 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2494
2495 dnl Multiple response sets.
2496 7; 7; 1; COUNT("$a=Ex");
2497
2498 dnl Character encoding record.
2499 7; 20; 1; 12; "windows-1252";
2500
2501 999; 0;
2502 ])
2503 for variant in be le; do
2504   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2505   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2506 ])
2507   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2508 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2509 ])
2510 done
2511 AT_CLEANUP
2512
2513 AT_SETUP([unexpected label source in mrsets])
2514 AT_KEYWORDS([sack synthetic system file negative multiple response])
2515 AT_DATA([sys-file.sack], [dnl
2516 dnl File header.
2517 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2518 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2519
2520 dnl Numeric variable, no label or missing values.
2521 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2522
2523 dnl Multiple response sets.
2524 7; 7; 1; COUNT("$a=E 2");
2525
2526 dnl Character encoding record.
2527 7; 20; 1; 12; "windows-1252";
2528
2529 999; 0;
2530 ])
2531 for variant in be le; do
2532   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2533   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2534 ])
2535   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2536 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2537
2538 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2539 ])
2540 done
2541 AT_CLEANUP
2542
2543 AT_SETUP([bad type character in mrsets])
2544 AT_KEYWORDS([sack synthetic system file negative multiple response])
2545 AT_DATA([sys-file.sack], [dnl
2546 dnl File header.
2547 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2548 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2549
2550 dnl Numeric variable, no label or missing values.
2551 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2552
2553 dnl Multiple response sets.
2554 7; 7; 1; COUNT("$a=");
2555
2556 dnl Character encoding record.
2557 7; 20; 1; 12; "windows-1252";
2558
2559 999; 0;
2560 ])
2561 for variant in be le; do
2562   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2563   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2564 ])
2565   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2566 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2567 ])
2568 done
2569 AT_CLEANUP
2570
2571 AT_SETUP([bad counted string length in mrsets])
2572 AT_KEYWORDS([sack synthetic system file negative multiple response])
2573 AT_DATA([sys-file.sack], [dnl
2574 dnl File header.
2575 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2576 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2577
2578 dnl Numeric variable, no label or missing values.
2579 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2580
2581 dnl Multiple response sets.
2582 7; 7; 1; COUNT("$a=Dx");
2583
2584 dnl Character encoding record.
2585 7; 20; 1; 12; "windows-1252";
2586
2587 999; 0;
2588 ])
2589 for variant in be le; do
2590   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2591   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2592 ])
2593   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2594 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2595 ])
2596 done
2597 AT_CLEANUP
2598
2599 AT_SETUP([missing space in counted string in mrsets])
2600 AT_KEYWORDS([sack synthetic system file negative multiple response])
2601 AT_DATA([sys-file.sack], [dnl
2602 dnl File header.
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;
2605
2606 dnl Numeric variable, no label or missing values.
2607 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2608
2609 dnl Multiple response sets.
2610 7; 7; 1; COUNT("$a=D1x");
2611
2612 dnl Character encoding record.
2613 7; 20; 1; 12; "windows-1252";
2614
2615 999; 0;
2616 ])
2617 for variant in be le; do
2618   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2619   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2620 ])
2621   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2622 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2623 ])
2624 done
2625 AT_CLEANUP
2626
2627 AT_SETUP([counted string too long in mrsets])
2628 AT_KEYWORDS([sack synthetic system file negative multiple response])
2629 AT_DATA([sys-file.sack], [dnl
2630 dnl File header.
2631 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2632 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2633
2634 dnl Numeric variable, no label or missing values.
2635 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2636
2637 dnl Multiple response sets.
2638 7; 7; 1; COUNT("$a=D4 abc");
2639
2640 dnl Character encoding record.
2641 7; 20; 1; 12; "windows-1252";
2642
2643 999; 0;
2644 ])
2645 for variant in be le; do
2646   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2647   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2648 ])
2649   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2650 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2651 ])
2652 done
2653 AT_CLEANUP
2654
2655 AT_SETUP([missing space after counted string in mrsets])
2656 AT_KEYWORDS([sack synthetic system file negative multiple response])
2657 AT_DATA([sys-file.sack], [dnl
2658 dnl File header.
2659 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2660 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2661
2662 dnl Numeric variable, no label or missing values.
2663 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2664
2665 dnl Multiple response sets.
2666 7; 7; 1; COUNT("$a=D3 abcx");
2667
2668 dnl Character encoding record.
2669 7; 20; 1; 12; "windows-1252";
2670
2671 999; 0;
2672 ])
2673 for variant in be le; do
2674   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2675   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2676 ])
2677   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2678 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2679 ])
2680 done
2681 AT_CLEANUP
2682
2683 AT_SETUP([missing newline after variable name in mrsets])
2684 AT_KEYWORDS([sack synthetic system file negative multiple response])
2685 AT_DATA([sys-file.sack], [dnl
2686 dnl File header.
2687 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2688 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2689
2690 dnl Numeric variable, no label or missing values.
2691 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2692
2693 dnl Multiple response sets.
2694 7; 7; 1; COUNT("$a=C 0  NUM1");
2695
2696 dnl Character encoding record.
2697 7; 20; 1; 12; "windows-1252";
2698
2699 999; 0;
2700 ])
2701 for variant in be le; do
2702   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2703   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2704 ])
2705   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2706 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2707
2708 warning: `sys-file.sav': MRSET $a has only one variable.
2709 ])
2710 done
2711 AT_CLEANUP
2712
2713 AT_SETUP([duplicate variable name in mrsets])
2714 AT_KEYWORDS([sack synthetic system file negative multiple response])
2715 AT_DATA([sys-file.sack], [dnl
2716 dnl File header.
2717 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2718 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2719
2720 dnl Numeric variable, no label or missing values.
2721 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2722
2723 dnl Multiple response sets.
2724 7; 7; 1; COUNT("$a=C 0  NUM1 NUM1"; i8 10);
2725
2726 dnl Character encoding record.
2727 7; 20; 1; 12; "windows-1252";
2728
2729 999; 0;
2730 ])
2731 for variant in be le; do
2732   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2733   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2734 ])
2735   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2736 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2737
2738 warning: `sys-file.sav': MRSET $a has only one variable.
2739 ])
2740 done
2741 AT_CLEANUP
2742
2743 AT_SETUP([mixed variable types in mrsets])
2744 AT_KEYWORDS([sack synthetic system file negative multiple response])
2745 AT_DATA([sys-file.sack], [dnl
2746 dnl File header.
2747 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2748 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2749
2750 dnl Variables.
2751 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2752 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2753
2754 dnl Multiple response sets.
2755 7; 7; 1; COUNT("$a=C 0  NUM1 STR1"; i8 10);
2756
2757 dnl Character encoding record.
2758 7; 20; 1; 12; "windows-1252";
2759
2760 999; 0;
2761 ])
2762 for variant in be le; do
2763   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2764   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2765 ])
2766   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2767 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2768
2769 warning: `sys-file.sav': MRSET $a has only one variable.
2770 ])
2771 done
2772 AT_CLEANUP
2773
2774 AT_SETUP([missing newline after variable name in mrsets])
2775 AT_KEYWORDS([sack synthetic system file negative multiple response])
2776 AT_DATA([sys-file.sack], [dnl
2777 dnl File header.
2778 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2779 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2780
2781 dnl Numeric variable, no label or missing values.
2782 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2783
2784 dnl Multiple response sets.
2785 7; 7; 1; COUNT("$a=C 0  NUM1"; i8 10);
2786
2787 dnl Character encoding record.
2788 7; 20; 1; 12; "windows-1252";
2789
2790 999; 0;
2791 ])
2792 for variant in be le; do
2793   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2794   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2795 ])
2796   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2797 warning: `sys-file.sav': MRSET $a has only one variable.
2798 ])
2799 done
2800 AT_CLEANUP
2801
2802 AT_SETUP([zero or one variable in mrset])
2803 AT_KEYWORDS([sack synthetic system file negative multiple response])
2804 AT_DATA([sys-file.sack], [dnl
2805 dnl File header.
2806 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2807 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2808
2809 dnl Numeric variable, no label or missing values.
2810 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2811
2812 dnl Multiple response sets.
2813 7; 7; 1; COUNT("$a=C 0  NUM1"; i8 10; "$b=C 0  "; i8 10);
2814
2815 dnl Character encoding record.
2816 7; 20; 1; 12; "windows-1252";
2817
2818 999; 0;
2819 ])
2820 for variant in be le; do
2821   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2822   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2823 ])
2824   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2825 warning: `sys-file.sav': MRSET $a has only one variable.
2826
2827 warning: `sys-file.sav': MRSET $b has no variables.
2828 ])
2829 done
2830 AT_CLEANUP
2831
2832 AT_SETUP([wrong display parameter size])
2833 AT_KEYWORDS([sack synthetic system file negative])
2834 AT_DATA([sys-file.sack], [dnl
2835 dnl File header.
2836 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2837 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2838
2839 dnl Numeric variable, no label or missing values.
2840 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2841
2842 dnl Display parameters record.
2843 7; 11; >>8<<; 2; 1.0; 1.0;
2844
2845 dnl Character encoding record.
2846 7; 20; 1; 12; "windows-1252";
2847
2848 dnl End of dictionary.
2849 999; 0;
2850 ])
2851 for variant in be le; do
2852   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2853   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2854 ])
2855   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2856 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2857 ])
2858 done
2859 AT_CLEANUP
2860
2861 AT_SETUP([wrong display parameter count])
2862 AT_KEYWORDS([sack synthetic system file negative])
2863 AT_DATA([sys-file.sack], [dnl
2864 dnl File header.
2865 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2866 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2867
2868 dnl Numeric variable, no label or missing values.
2869 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2870
2871 dnl Display parameters record.
2872 7; 11; 4; >>4<<; 1; 1; 2; 2;
2873
2874 dnl Character encoding record.
2875 7; 20; 1; 12; "windows-1252";
2876
2877 dnl End of dictionary.
2878 999; 0;
2879 ])
2880 for variant in be le; do
2881   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2882   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2883 ])
2884   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2885 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2886 ])
2887 done
2888 AT_CLEANUP
2889
2890 AT_SETUP([wrong display measurement level])
2891 AT_KEYWORDS([sack synthetic system file negative])
2892 AT_DATA([sys-file.sack], [dnl
2893 dnl File header.
2894 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2895 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2896
2897 dnl Numeric variable, no label or missing values.
2898 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2899
2900 dnl Display parameters record.
2901 7; 11; 4; 2; >>4<<; 0;
2902
2903 dnl Character encoding record.
2904 7; 20; 1; 12; "windows-1252";
2905
2906 dnl End of dictionary.
2907 999; 0;
2908 ])
2909 for variant in be le; do
2910   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2911   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2912 ])
2913   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2914 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1).  Default parameters substituted.
2915 ])
2916 done
2917 AT_CLEANUP
2918
2919 AT_SETUP([wrong display alignment])
2920 AT_KEYWORDS([sack synthetic system file negative])
2921 AT_DATA([sys-file.sack], [dnl
2922 dnl File header.
2923 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2924 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2925
2926 dnl Numeric variable, no label or missing values.
2927 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2928
2929 dnl Display parameters record.
2930 7; 11; 4; 2; 1; >>-1<<;
2931
2932 dnl Character encoding record.
2933 7; 20; 1; 12; "windows-1252";
2934
2935 dnl End of dictionary.
2936 999; 0;
2937 ])
2938 for variant in be le; do
2939   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2940   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2941 ])
2942   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2943 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1).  Default parameters substituted.
2944 ])
2945 done
2946 AT_CLEANUP
2947
2948 AT_SETUP([bad variable name in variable/value pair])
2949 AT_KEYWORDS([sack synthetic system file negative])
2950 AT_DATA([sys-file.sack], [dnl
2951 dnl File header.
2952 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2953 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2954
2955 dnl Numeric variables.
2956 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2957
2958 dnl Long variable names.
2959 7; 13; 1; COUNT (>>"xyzzy"<<);
2960
2961 dnl Character encoding record.
2962 7; 20; 1; 12; "windows-1252";
2963
2964 dnl Dictionary termination record.
2965 999; 0;
2966 ])
2967 for variant in be le; do
2968   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2969   AT_DATA([sys-file.sps], [dnl
2970 GET FILE='sys-file.sav'.
2971 ])
2972   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2973 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
2974 ])
2975 done
2976 AT_CLEANUP
2977
2978 AT_SETUP([duplicate long variable name])
2979 AT_KEYWORDS([sack synthetic system file negative])
2980 AT_DATA([sys-file.sack], [dnl
2981 dnl File header.
2982 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2983 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2984
2985 dnl Numeric variables.
2986 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2987 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
2988 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
2989 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
2990
2991 dnl Long variable names.
2992 7; 13; 1; COUNT (
2993 "LONGVARI=_Invalid"; i8 9;
2994 "LONGVA_A=LongVariableName"; i8 9;
2995 "LONGVA_B=LONGVARIABLENAME"; i8 9;
2996 );
2997
2998 dnl Character encoding record.
2999 7; 20; 1; 12; "windows-1252";
3000
3001 dnl Dictionary termination record.
3002 999; 0;
3003 ])
3004 for variant in be le; do
3005   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3006   AT_DATA([sys-file.sps], [dnl
3007 GET FILE='sys-file.sav'.
3008 ])
3009   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3010 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3011
3012 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3013 ])
3014 done
3015 AT_CLEANUP
3016
3017 AT_SETUP([bad very long string length])
3018 AT_KEYWORDS([sack synthetic system file negative])
3019 AT_DATA([sys-file.sack], [dnl
3020 dnl File header.
3021 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3022 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3023
3024 dnl Numeric variable.
3025 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3026
3027 dnl Very long string map.
3028 7; 14; 1; COUNT (
3029 "NUM1=00000"; i8 0; i8 9;
3030 "NUM1=00255"; i8 0; i8 9;
3031 "NUM1=00256"; i8 0; i8 9;
3032 );
3033
3034 dnl Character encoding record.
3035 7; 20; 1; 12; "windows-1252";
3036
3037 dnl Dictionary termination record.
3038 999; 0;
3039 ])
3040 for variant in be le; do
3041   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3042   AT_DATA([sys-file.sps], [dnl
3043 GET FILE='sys-file.sav'.
3044 ])
3045   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3046 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3047
3048 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3049
3050 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3051 ])
3052 done
3053 AT_CLEANUP
3054
3055 AT_SETUP([bad very long string segment width])
3056 AT_KEYWORDS([sack synthetic system file negative])
3057 AT_DATA([sys-file.sack], [dnl
3058 dnl File header.
3059 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3060 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3061
3062 dnl Variables.
3063 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3064 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3065 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3066 >>2; -1; 0; 0; 0; 0; s8 "";<<
3067
3068 dnl Very long string map.
3069 7; 14; 1; COUNT (
3070 "STR1=00256"; i8 0; i8 9;
3071 );
3072
3073 dnl Character encoding record.
3074 7; 20; 1; 12; "windows-1252";
3075
3076 dnl Dictionary termination record.
3077 999; 0;
3078 ])
3079 for variant in be le; do
3080   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3081   AT_DATA([sys-file.sps], [dnl
3082 GET FILE='sys-file.sav'.
3083 ])
3084   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3085 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3086 ])
3087 done
3088 AT_CLEANUP
3089
3090 AT_SETUP([too many value labels])
3091 dnl Skip the test if multiplying a small number by INT32_MAX would not
3092 dnl cause an overflow in size_t.
3093 AT_SKIP_IF([test $SIZEOF_SIZE_T -gt 4])
3094 AT_KEYWORDS([sack synthetic system file negative])
3095 AT_DATA([sys-file.sack], [dnl
3096 dnl File header.
3097 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3098 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3099
3100 dnl Numeric variable.
3101 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3102 3; >>0x7fffffff<<;
3103 ])
3104 for variant in be le; do
3105   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3106   AT_DATA([sys-file.sps], [dnl
3107 GET FILE='sys-file.sav'.
3108 ])
3109   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3110 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3111 ])
3112 done
3113 AT_CLEANUP
3114
3115 AT_SETUP([missing type 4 record])
3116 AT_KEYWORDS([sack synthetic system file negative])
3117 AT_DATA([sys-file.sack], [dnl
3118 dnl File header.
3119 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3120 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3121
3122 dnl Numeric variable.
3123 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3124
3125 dnl Value label with missing type 4 record.
3126 3; 1; 1.0; i8 3; s7 "one";
3127
3128 dnl Character encoding record.
3129 7; 20; 1; 12; "windows-1252";
3130
3131 dnl End of dictionary.
3132 >>999; 0<<;
3133 ])
3134 for variant in be le; do
3135   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3136   AT_DATA([sys-file.sps], [dnl
3137 GET FILE='sys-file.sav'.
3138 ])
3139   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3140 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3141 ])
3142 done
3143 AT_CLEANUP
3144
3145 AT_SETUP([value label with no associated variables])
3146 AT_KEYWORDS([sack synthetic system file negative])
3147 AT_DATA([sys-file.sack], [dnl
3148 dnl File header.
3149 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3150 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3151
3152 dnl Numeric variable.
3153 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3154
3155 dnl Value label with no variables.
3156 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3157 ])
3158 for variant in be le; do
3159   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3160   AT_DATA([sys-file.sps], [dnl
3161 GET FILE='sys-file.sav'.
3162 ])
3163   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3164 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).
3165 ])
3166 done
3167 AT_CLEANUP
3168
3169 AT_SETUP([type 4 record names long string variable])
3170 AT_KEYWORDS([sack synthetic system file negative])
3171 AT_DATA([sys-file.sack], [dnl
3172 dnl File header.
3173 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3174 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3175
3176 dnl Long string variable.
3177 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3178 2; -1; 0; 0; 0; 0; s8 "";
3179
3180 dnl Value label that names long string variable.
3181 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3182
3183 dnl Character encoding record.
3184 7; 20; 1; 12; "windows-1252";
3185
3186 dnl End of dictionary.
3187 999; 0;
3188 ])
3189 for variant in be le; do
3190   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3191   AT_DATA([sys-file.sps], [dnl
3192 GET FILE='sys-file.sav'.
3193 ])
3194   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3195 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.
3196 ])
3197 done
3198 AT_CLEANUP
3199
3200 AT_SETUP([variables for value label must all be same type])
3201 AT_KEYWORDS([sack synthetic system file negative])
3202 AT_DATA([sys-file.sack], [dnl
3203 dnl File header.
3204 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3205 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3206
3207 dnl Variables.
3208 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3209 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3210
3211 dnl Value label that names numeric and string variables.
3212 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3213
3214 dnl Character encoding record.
3215 7; 20; 1; 12; "windows-1252";
3216
3217 dnl End of dictionary.
3218 999; 0;
3219 ])
3220 for variant in be le; do
3221   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3222   AT_DATA([sys-file.sps], [dnl
3223 GET FILE='sys-file.sav'.
3224 ])
3225   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3226 "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."
3227 ])
3228 done
3229 AT_CLEANUP
3230
3231 AT_SETUP([duplicate value labels type])
3232 AT_KEYWORDS([sack synthetic system file negative])
3233 AT_DATA([sys-file.sack], [dnl
3234 dnl File header.
3235 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3236 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3237
3238 dnl Variables.
3239 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3240 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3241
3242 dnl Duplicate value labels.
3243 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3244 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3245
3246 dnl Character encoding record.
3247 7; 20; 1; 12; "windows-1252";
3248
3249 dnl End of dictionary.
3250 999; 0;
3251 ])
3252 for variant in be le; do
3253   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3254   AT_DATA([sys-file.sps], [dnl
3255 GET FILE='sys-file.sav'.
3256 ])
3257   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3258 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3259
3260 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3261 ])
3262 done
3263 AT_CLEANUP
3264
3265 AT_SETUP([missing attribute value])
3266 AT_KEYWORDS([sack synthetic system file negative])
3267 AT_DATA([sys-file.sack], [dnl
3268 dnl File header.
3269 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3270 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3271
3272 dnl Variables.
3273 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3274
3275 dnl Data file attributes record.
3276 7; 17; 1; COUNT (
3277 "Attr1("
3278 );
3279
3280 dnl Variable attributes record.
3281 7; 18; 1; COUNT (
3282 "FIRSTVAR:";
3283   "fred('23'"; i8 10
3284 );
3285
3286 dnl Character encoding record.
3287 7; 20; 1; 12; "windows-1252";
3288
3289 dnl Dictionary termination record.
3290 999; 0;
3291 ])
3292 for variant in be le; do
3293   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3294   AT_DATA([sys-file.sps], [dnl
3295 GET FILE='sys-file.sav'.
3296 ])
3297   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3298 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3299
3300 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3301 ])
3302 done
3303 AT_CLEANUP
3304
3305 AT_SETUP([unquoted attribute value])
3306 AT_KEYWORDS([sack synthetic system file negative])
3307 AT_DATA([sys-file.sack], [dnl
3308 dnl File header.
3309 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3310 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3311
3312 dnl Variables.
3313 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3314
3315 dnl Data file attributes record.
3316 7; 17; 1; COUNT (
3317 "Attr1(value"; i8 10;
3318 ")"
3319 );
3320
3321 dnl Variable attributes record.
3322 7; 18; 1; COUNT (
3323 "FIRSTVAR:";
3324   "fred(23"; i8 10; ")"
3325 );
3326
3327 dnl Character encoding record.
3328 7; 20; 1; 12; "windows-1252";
3329
3330 dnl Dictionary termination record.
3331 999; 0;
3332 ])
3333 for variant in be le; do
3334   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3335   AT_DATA([sys-file.sps], [dnl
3336 GET FILE='sys-file.sav'.
3337 ])
3338   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3339 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3340
3341 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3342 ])
3343 done
3344 AT_CLEANUP
3345
3346 AT_SETUP([bad variable name in long string value label])
3347 AT_KEYWORDS([sack synthetic system file negative])
3348 AT_DATA([sys-file.sack], [dnl
3349 dnl File header.
3350 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3351 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3352
3353 dnl Variables.
3354 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3355 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3356 2; -1; 0; 0; 0; 0; s8 "";
3357
3358 7; 21; 1; COUNT (
3359 dnl No variable named STR9.
3360 COUNT(>>"STR9"<<); 9;
3361 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3362
3363 dnl NUM1 is numeric.
3364 COUNT(>>"NUM1"<<); 0;
3365 1; COUNT("xyz"); COUNT("value label for 1.0");
3366
3367 dnl Wrong width for STR14.
3368 COUNT("STR14"); >>9<<;
3369 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3370
3371 dnl Wrong width for value.
3372 COUNT("STR14"); 14;
3373 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3374
3375 dnl Duplicate value label.
3376 COUNT("STR14"); 14; 2;
3377 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3378 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3379 );
3380
3381 dnl Character encoding record.
3382 7; 20; 1; 12; "windows-1252";
3383
3384 dnl Dictionary termination record.
3385 999; 0;
3386 ])
3387 for variant in be le; do
3388   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3389   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3390 ])
3391   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3392 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3393
3394 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3395
3396 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).
3397
3398 "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."
3399
3400 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3401 ])
3402 done
3403 AT_CLEANUP
3404
3405 AT_SETUP([fewer data records than indicated by file header])
3406 AT_KEYWORDS([sack synthetic system file negative])
3407 AT_DATA([sys-file.sack], [dnl
3408 dnl File header.
3409 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3410 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3411
3412 dnl Numeric variables.
3413 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3414 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3415
3416 dnl Character encoding record.
3417 7; 20; 1; 12; "windows-1252";
3418
3419 dnl Data.
3420 999; 0;
3421 1.0; 2.0;
3422 3.0; 4.0;
3423 5.0; 6.0;
3424 7.0; 8.0;
3425 dnl Missing record here.
3426 ])
3427 for variant in be le; do
3428   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3429   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3430 LIST.
3431 ])
3432   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3433    [error: Error reading case from file `sys-file.sav'.
3434
3435 Table: Data List
3436 num1,num2
3437 1,2
3438 3,4
3439 5,6
3440 7,8
3441 ])
3442 done
3443 AT_CLEANUP
3444
3445 AT_SETUP([partial data record between variables])
3446 AT_KEYWORDS([sack synthetic system file negative])
3447 AT_DATA([sys-file.sack], [dnl
3448 dnl File header.
3449 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3450 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3451
3452 dnl Numeric variables.
3453 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3454 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3455
3456 dnl Character encoding record.
3457 7; 20; 1; 12; "windows-1252";
3458
3459 dnl Data.
3460 999; 0;
3461 1.0; 2.0;
3462 3.0;
3463 ])
3464 for variant in be le; do
3465   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3466   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3467 LIST.
3468 ])
3469   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3470    [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3471
3472 Table: Data List
3473 num1,num2
3474 1,2
3475 ])
3476 done
3477 AT_CLEANUP
3478
3479 AT_SETUP([partial data record within long string])
3480 AT_KEYWORDS([sack synthetic system file negative])
3481 AT_DATA([sys-file.sack], [dnl
3482 dnl File header.
3483 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3484 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3485
3486 dnl Numeric variables.
3487 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3488 2; -1; 0; 0; 0; 0; s8 "";
3489
3490 dnl Character encoding record.
3491 7; 20; 1; 12; "windows-1252";
3492
3493 dnl Data.
3494 999; 0;
3495 s14 "one data item";
3496 s8 "partial";
3497 ])
3498 for variant in be le; do
3499   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3500   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3501 LIST.
3502 ])
3503   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3504    [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3505
3506 Table: Data List
3507 str14
3508 one data item @&t@
3509 ])
3510 done
3511 AT_CLEANUP
3512
3513 AT_SETUP([partial compressed data record])
3514 AT_KEYWORDS([sack synthetic system file positive])
3515 AT_DATA([sys-file.sack], [dnl
3516 dnl File header.
3517 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3518 2; dnl Layout code
3519 6; dnl Nominal case size
3520 1; dnl Compressed
3521 0; dnl Not weighted 
3522 -1; dnl Unspecified number of cases.
3523 100.0; dnl Bias.
3524 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3525 i8 0 *3;
3526
3527 dnl Numeric variables.
3528 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3529 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3530
3531 dnl String variable.
3532 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3533 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3534 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3535 2; -1; 0; 0; 0; 0; s8 "";
3536
3537 dnl Character encoding record.
3538 7; 20; 1; 12; "windows-1252";
3539
3540 dnl Dictionary termination record.
3541 999; 0;
3542
3543 dnl Compressed data.
3544 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3545 ])
3546 for variant in be le; do
3547   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3548   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3549 LIST.
3550 ])
3551   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3552    [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3553
3554 Table: Data List
3555 num1,num2,str4,str8,str15
3556 -99,0,,abcdefgh,0123   @&t@
3557 ])
3558 done
3559 AT_CLEANUP
3560
3561 AT_SETUP([zcompressed data - bad zheader_ofs])
3562 AT_KEYWORDS([sack synthetic system file negative zlib])
3563 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3564 for variant in be le; do
3565   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3566   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3567 ])
3568   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Wrong ZLIB data header offset 0 (expected 0x194).
3569 ])
3570 done
3571 AT_CLEANUP
3572
3573 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3574 AT_KEYWORDS([sack synthetic system file negative zlib])
3575 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3576 for variant in be le; do
3577   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3578   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3579 ])
3580   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3581 ])
3582 done
3583 AT_CLEANUP
3584
3585 # ztrailer_len must be a multiple of 24 and at least 48,
3586 # so a value of 12 is impossible.
3587 AT_SETUP([zcompressed data - invalid ztrailer_len])
3588 AT_KEYWORDS([sack synthetic system file negative zlib])
3589 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3590 for variant in be le; do
3591   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3592   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3593 ])
3594   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3595 ])
3596 done
3597 AT_CLEANUP
3598
3599 # ztrailer_ofs + ztrailer_len must be the file size.
3600 AT_SETUP([zcompressed data - wrong ztrailer_len])
3601 AT_KEYWORDS([sack synthetic system file negative zlib])
3602 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3603 for variant in be le; do
3604   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3605   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3606 ])
3607   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [warning: `sys-file.sav' near offset 0x1ac: End of ZLIB trailer (0x24d) is not file size (0x235).
3608 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3609 ])
3610 done
3611 AT_CLEANUP
3612
3613 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3614 AT_KEYWORDS([sack synthetic system file negative zlib])
3615 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3616 for variant in be le; do
3617   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3618   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3619 ])
3620   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x20d: ZLIB trailer bias (0) differs from file header bias (100.00).
3621 ])
3622 done
3623 AT_CLEANUP
3624
3625 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3626 AT_KEYWORDS([sack synthetic system file negative zlib])
3627 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3628 for variant in be le; do
3629   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3630   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3631 ])
3632   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x215: ZLIB trailer "zero" field has nonzero value 100.
3633 ])
3634 done
3635 AT_CLEANUP
3636
3637 AT_SETUP([zcompressed data - wrong block_size])
3638 AT_KEYWORDS([sack synthetic system file negative zlib])
3639 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3640 for variant in be le; do
3641   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3642   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3643 ])
3644   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x219: ZLIB trailer specifies unexpected 4096-byte block size.
3645 ])
3646 done
3647 AT_CLEANUP
3648
3649 AT_SETUP([zcompressed data - wrong n_blocks])
3650 AT_KEYWORDS([sack synthetic system file negative zlib])
3651 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3652 for variant in be le; do
3653   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3654   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3655 ])
3656   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: 48-byte ZLIB trailer specifies 2 data blocks (expected 1).
3657 ])
3658 done
3659 AT_CLEANUP
3660
3661 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3662 AT_KEYWORDS([sack synthetic system file negative zlib])
3663 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3664 for variant in be le; do
3665   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3666   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3667 ])
3668   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported uncompressed data offset 0x177, when 0x194 was expected.
3669 ])
3670 done
3671 AT_CLEANUP
3672
3673 AT_SETUP([zcompressed data - wrong compressed_ofs])
3674 AT_KEYWORDS([sack synthetic system file negative zlib])
3675 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3676 for variant in be le; do
3677   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3678   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3679 ])
3680   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported compressed data offset 0x191, when 0x1ac was expected.
3681 ])
3682 done
3683 AT_CLEANUP
3684
3685 AT_SETUP([zcompressed data - compressed sizes don't add up])
3686 AT_KEYWORDS([sack synthetic system file negative zlib])
3687 AT_DATA([sys-file.sack], [dnl
3688 dnl File header.
3689 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3690 2; dnl Layout code
3691 6; dnl Nominal case size
3692 2; dnl zlib compressed
3693 0; dnl Not weighted
3694 -1; dnl Unspecified number of cases.
3695 100.0; dnl Bias.
3696 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3697 i8 0 *3;
3698
3699 dnl Numeric variables.
3700 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3701 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3702
3703 dnl String variable.
3704 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3705 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3706 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3707 2; -1; 0; 0; 0; 0; s8 "";
3708
3709 dnl Character encoding record.
3710 7; 20; 1; 12; "windows-1252";
3711
3712 dnl Dictionary termination record.
3713 999; 0;
3714
3715 dnl ZLIB data header.
3716 i64 0x194;    # zheader_ofs
3717 i64 0x1ac;    # ztrailer_ofs
3718 i64 72;       # ztrailer_len
3719
3720 dnl This is where the ZLIB data blocks would go, but we don't need any to
3721 dnl provoke this message so we omit them.
3722
3723 dnl ZLIB data trailer fixed header:
3724 i64 -100;     # ztrailer_bias
3725 i64 0;        # ztrailer_zero
3726 0x3ff000;     # block_size
3727 2;            # n_blocks
3728
3729 dnl ZLIB block descriptor 1:
3730 i64 0x194;    # uncompressed_ofs
3731 i64 0x1ac;    # compressed_ofs
3732 0x100000;     # uncompressed_size
3733 0x12345;      # compressed_size
3734
3735 dnl ZLIB block descriptor 2:
3736 i64 0x100194; # uncompressed_ofs
3737 i64 0x12421;  # compressed_ofs
3738 0x100000;     # uncompressed_size
3739 0x12345;      # compressed_size
3740 ])
3741 for variant in be le; do
3742   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3743   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3744 ])
3745   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [warning: `sys-file.sav' near offset 0x1c4: ZLIB block descriptor 0 reported block size 0x100000, when 0x3ff000 was expected.
3746 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
3747 ])
3748 done
3749 AT_CLEANUP
3750
3751 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3752 AT_KEYWORDS([sack synthetic system file negative zlib])
3753 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3754 for variant in be le; do
3755   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3756   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3757 ])
3758   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported block size 0x400000, when at most 0x3ff000 was expected.
3759 ])
3760 done
3761 AT_CLEANUP
3762
3763 AT_SETUP([zcompressed data - compression expands data too much])
3764 AT_KEYWORDS([sack synthetic system file negative zlib])
3765 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3766 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
3767 for variant in be le; do
3768   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3769   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3770 ])
3771   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reports compressed size 100 and uncompressed size 50.
3772 ])
3773 done
3774 AT_CLEANUP
3775
3776 AT_SETUP([zcompressed data - compressed sizes don't add up])
3777 AT_KEYWORDS([sack synthetic system file negative zlib])
3778 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3779 for variant in be le; do
3780   AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3781   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3782 ])
3783   AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x235: ZLIB trailer is at offset 0x205 but 0x204 would be expected from block descriptors.
3784 ])
3785 done
3786 AT_CLEANUP