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