VARIABLE ROLE: Document the format and add a test.
[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   "$@Role('1'"; i8 10; ")";
1066 "/S"; i8 233; "condVariable:";
1067   "xyzzy('quux'"; i8 10; ")";
1068 );
1069
1070
1071 dnl Character encoding record.
1072 7; 20; 1; 12; "windows-1252";
1073
1074 dnl Dictionary termination record.
1075 999; 0;
1076 ])
1077 for variant in \
1078         "be 7fff0c04f697adf45f55d8be4aaa8712" \
1079         "le 7331339199344aa58bc60d7d05d538a7"
1080 do
1081   set $variant
1082   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1083 ])
1084   AT_DATA([sys-file.sps], [dnl
1085 GET FILE='sys-file.sav'.
1086 DISPLAY @ATTRIBUTES.
1087 ])
1088   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1089   AT_CHECK([cat pspp.csv], [0],
1090 [[Variable,Description,
1091 FirstVariable,Custom attributes:,
1092 ,$@Role,1
1093 ,adèle[1],23
1094 ,adèle[2],34
1095 ,bert,123
1096 SécondVariable,Custom attributes:,
1097 ,xyzzy,quux
1098
1099 Table: Custom data file attributes.
1100 Attribute,Value
1101 Attr1[1],Value1
1102 Attr1[2],'déclaration'
1103 SécondAttr[1],123
1104 SécondAttr[2],456
1105 ]])
1106   AT_DATA([sys-file.sps], [dnl
1107 GET FILE='sys-file.sav'.
1108 DISPLAY DICTIONARY.
1109 ])
1110   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1111   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0],
1112 [[Variable,Description,,Position
1113 FirstVariable,Format: F8.0,,1
1114 ,Role: Output,,
1115 ,Custom attributes:,,
1116 ,adèle[1],23,
1117 ,adèle[2],34,
1118 ,bert,123,
1119 SécondVariable,Format: F8.0,,2
1120 ,Custom attributes:,,
1121 ,xyzzy,quux,
1122
1123 Table: Custom data file attributes.
1124 Attribute,Value
1125 Attr1[1],Value1
1126 Attr1[2],'déclaration'
1127 SécondAttr[1],123
1128 SécondAttr[2],456
1129 ]])
1130 done
1131 AT_CLEANUP
1132
1133 AT_SETUP([variable roles])
1134 AT_KEYWORDS([sack synthetic system file positive])
1135 AT_DATA([sys-file.sack], [dnl
1136 dnl File header.
1137 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1138 2; dnl Layout code
1139 7; dnl Nominal case size
1140 0; dnl Not compressed
1141 0; dnl Not weighted
1142 0; dnl 1 case.
1143 100.0; dnl Bias.
1144 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1145 i8 0 *3;
1146
1147 dnl Variables.
1148 2; 0; 0; 0; 0x050800 *2; s8 "I";
1149 2; 0; 0; 0; 0x050800 *2; s8 "O";
1150 2; 0; 0; 0; 0x050800 *2; s8 "B";
1151 2; 0; 0; 0; 0x050800 *2; s8 "N";
1152 2; 0; 0; 0; 0x050800 *2; s8 "P";
1153 2; 0; 0; 0; 0x050800 *2; s8 "S";
1154 2; 0; 0; 0; 0x050800 *2; s8 "X";
1155
1156 dnl Machine integer info record.
1157 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1158
1159 dnl Variable attributes record.
1160 7; 18; 1; COUNT (
1161 "I:$@Role('0'"; i8 10; ")";
1162 "/O:$@Role('1'"; i8 10; ")";
1163 "/B:$@Role('2'"; i8 10; ")";
1164 "/N:$@Role('3'"; i8 10; ")";
1165 "/P:$@Role('4'"; i8 10; ")";
1166 "/S:$@Role('5'"; i8 10; ")";
1167 "/X:$@Role('6'"; i8 10; ")";
1168 );
1169
1170 dnl Character encoding record.
1171 7; 20; 1; 12; "windows-1252";
1172
1173 dnl Dictionary termination record.
1174 999; 0;
1175 ])
1176 for variant in \
1177         "be b08b39cd005682f680d132d272f5158d" \
1178         "le 176e4ac91197f5cb8732258033cfabdc"
1179 do
1180   set $variant
1181   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1182 ])
1183   AT_DATA([sys-file.sps], [dnl
1184 GET FILE='sys-file.sav'.
1185 DISPLAY DICTIONARY.
1186 ])
1187   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1188 warning: `sys-file.sav': Invalid role for variable x.
1189 ])
1190   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1191 warning: `sys-file.sav': Invalid role for variable x.
1192
1193 Variable,Description,,Position
1194 i,Format: F8.0,,1
1195 o,Format: F8.0,,2
1196 ,Role: Output,,
1197 b,Format: F8.0,,3
1198 ,Role: Both,,
1199 n,Format: F8.0,,4
1200 ,Role: None,,
1201 p,Format: F8.0,,5
1202 ,Role: Partition,,
1203 s,Format: F8.0,,6
1204 ,Role: Split,,
1205 x,Format: F8.0,,7
1206 ])
1207 done
1208 AT_CLEANUP
1209
1210 AT_SETUP([compressed data])
1211 AT_KEYWORDS([sack synthetic system file positive])
1212 AT_DATA([sys-file.sack], [dnl
1213 dnl File header.
1214 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1215 2; dnl Layout code
1216 6; dnl Nominal case size
1217 1; dnl Not compressed
1218 0; dnl Not weighted 
1219 -1; dnl Unspecified number of cases.
1220 100.0; dnl Bias.
1221 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1222 i8 0 *3;
1223
1224 dnl Numeric variables.
1225 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1226 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1227
1228 dnl String variable.
1229 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1230 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1231 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1232 2; -1; 0; 0; 0; 0; s8 "";
1233
1234 dnl Dictionary termination record.
1235 999; 0;
1236
1237 dnl Compressed data.
1238 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1239 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1240 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1241 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1242
1243 ])
1244 for variant in \
1245         "be c0670e436b068f45710b98f6f7d01dc5" \
1246         "le 2e43a7f8861df4e714a192dfb3c8b2f4"
1247 do
1248   set $variant
1249   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1250 ])
1251   AT_DATA([sys-file.sps], [dnl
1252 GET FILE='sys-file.sav'.
1253 DISPLAY DICTIONARY.
1254 LIST.
1255 ])
1256   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1257   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1258 Variable,Description,,Position
1259 num1,Format: F8.0,,1
1260 num2,Format: F8.0,,2
1261 str4,Format: A4,,3
1262 str8,Format: A8,,4
1263 str15,Format: A15,,5
1264
1265 Table: Data List
1266 num1,num2,str4,str8,str15
1267 -99,0,,abcdefgh,0123   @&t@
1268 .,151,jklm,nopqrstu,vwxyzABC       @&t@
1269 1,2,DEFG,HIJKLMNO,PQRSTUV
1270 ])
1271 done
1272 AT_CLEANUP
1273
1274 AT_SETUP([compressed data, zero bias])
1275 AT_KEYWORDS([sack synthetic system file positive])
1276 AT_DATA([sys-file.sack], [dnl
1277 dnl File header.
1278 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1279 2; dnl Layout code
1280 6; dnl Nominal case size
1281 1; dnl Not compressed
1282 0; dnl Not weighted 
1283 -1; dnl Unspecified number of cases.
1284 0.0; dnl Bias.
1285 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1286 i8 0 *3;
1287
1288 dnl Numeric variables.
1289 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1290 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1291
1292 dnl String variable.
1293 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1294 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1295 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1296 2; -1; 0; 0; 0; 0; s8 "";
1297
1298 dnl Dictionary termination record.
1299 999; 0;
1300
1301 dnl Compressed data.
1302 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1303 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1304 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1305 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1306
1307 ])
1308 for variant in \
1309         "be 2f0d25704ee497ae833213a3e4ff5e8b" \
1310         "le 49f68a9e1ba02a2f7e9166686a0db9d9"
1311 do
1312   set $variant
1313   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1314 ])
1315   AT_DATA([sys-file.sps], [dnl
1316 GET FILE='sys-file.sav'.
1317 DISPLAY DICTIONARY.
1318 LIST.
1319 ])
1320   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1321   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1322 Variable,Description,,Position
1323 num1,Format: F8.0,,1
1324 num2,Format: F8.0,,2
1325 str4,Format: A4,,3
1326 str8,Format: A8,,4
1327 str15,Format: A15,,5
1328
1329 Table: Data List
1330 num1,num2,str4,str8,str15
1331 1,100,,abcdefgh,0123   @&t@
1332 .,251,jklm,nopqrstu,vwxyzABC       @&t@
1333 101,102,DEFG,HIJKLMNO,PQRSTUV
1334 ])
1335 done
1336 AT_CLEANUP
1337
1338 AT_SETUP([compressed data, other bias])
1339 AT_KEYWORDS([sack synthetic system file positive])
1340 AT_DATA([sys-file.sack], [dnl
1341 dnl File header.
1342 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1343 2; dnl Layout code
1344 6; dnl Nominal case size
1345 1; dnl Not compressed
1346 0; dnl Not weighted 
1347 -1; dnl Unspecified number of cases.
1348 50.0; dnl Bias.
1349 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1350 i8 0 *3;
1351
1352 dnl Numeric variables.
1353 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1354 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1355
1356 dnl String variable.
1357 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1358 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1359 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1360 2; -1; 0; 0; 0; 0; s8 "";
1361
1362 dnl Dictionary termination record.
1363 999; 0;
1364
1365 dnl Compressed data.
1366 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1367 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1368 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1369 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1370
1371 ])
1372 for variant in \
1373         "be 668b85e3dee0797883e9933a096b8c18" \
1374         "le 5e7a9c4e88cd2dbc2322943da663868e"
1375 do
1376   set $variant
1377   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1378 ])
1379   AT_DATA([sys-file.sps], [dnl
1380 GET FILE='sys-file.sav'.
1381 DISPLAY DICTIONARY.
1382 LIST.
1383 ])
1384   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], 
1385     [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1386 ])
1387   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1388 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1389
1390 Variable,Description,,Position
1391 num1,Format: F8.0,,1
1392 num2,Format: F8.0,,2
1393 str4,Format: A4,,3
1394 str8,Format: A8,,4
1395 str15,Format: A15,,5
1396
1397 Table: Data List
1398 num1,num2,str4,str8,str15
1399 -49,50,,abcdefgh,0123   @&t@
1400 .,201,jklm,nopqrstu,vwxyzABC       @&t@
1401 51,52,DEFG,HIJKLMNO,PQRSTUV
1402 ])
1403 done
1404 AT_CLEANUP
1405 \f
1406 AT_BANNER([system file reader - negative])
1407
1408 AT_SETUP([misplaced type 4 record])
1409 AT_KEYWORDS([sack synthetic system file negative])
1410 AT_DATA([sys-file.sack], [dnl
1411 dnl File header.
1412 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1413 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1414
1415 dnl Numeric variable.
1416 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1417
1418 dnl Type 4 record.
1419 >>4<<;
1420 ])
1421 for variant in \
1422         "be 6e0bb549fff1fd1af333d51b8a6e0f43" \
1423         "le 7b62734edcee2a1689c463f2866d11b8"
1424 do
1425   set $variant
1426   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1427 ])
1428   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1429 ])
1430   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1431    [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1432 ])
1433 done
1434 AT_CLEANUP
1435
1436 AT_SETUP([bad record type])
1437 AT_KEYWORDS([sack synthetic system file negative])
1438 AT_DATA([sys-file.sack], [dnl
1439 dnl File header.
1440 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1441 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1442
1443 dnl Numeric variable.
1444 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1445
1446 dnl Type 8 record (not a valid type).
1447 >>8<<;
1448 ])
1449 for variant in \
1450         "be dc8f078c23046ee7db74ec1003178a11" \
1451         "le dc7f111642f0629f4370630fd092eee3"
1452 do
1453   set $variant
1454   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1455 ])
1456   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1457 ])
1458   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1459    [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1460 ])
1461 done
1462 AT_CLEANUP
1463
1464 AT_SETUP([wrong number of variable positions])
1465 AT_KEYWORDS([sack synthetic system file negative])
1466 AT_DATA([sys-file.sack], [dnl
1467 dnl File header.
1468 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1469 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1470
1471 dnl Numeric variable.
1472 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1473
1474 dnl End of dictionary.
1475 999; 0;
1476 ])
1477 for variant in \
1478         "be c57e91aa426f61813c3ad91ea3a56dda" \
1479         "le 5d1a6c114b135b219473c8ad5bb44bda"
1480 do
1481   set $variant
1482   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1483 ])
1484   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1485 ])
1486   AT_CHECK([pspp -O format=csv sys-file.sps], [0], 
1487    [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1488 ])
1489 done
1490 AT_CLEANUP
1491
1492 AT_SETUP([variable name may not begin with `#'])
1493 AT_KEYWORDS([sack synthetic system file negative])
1494 AT_DATA([sys-file.sack], [dnl
1495 dnl File header.
1496 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1497 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1498
1499 dnl Numeric variable.
1500 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1501
1502 dnl End of dictionary.
1503 999; 0;
1504 ])
1505 for variant in \
1506         "be decb7ac6defa1ab3cc7a386d1843c1ae" \
1507         "le 5279b6275633bac55d167faebccfdb14"
1508 do
1509   set $variant
1510   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1511 ])
1512   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1513 ])
1514   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1515    [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1516 ])
1517 done
1518 AT_CLEANUP
1519
1520 AT_SETUP([variable name may not be reserved word])
1521 AT_KEYWORDS([sack synthetic system file negative])
1522 AT_DATA([sys-file.sack], [dnl
1523 dnl File header.
1524 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1525 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1526
1527 dnl Numeric variable.
1528 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1529
1530 dnl End of dictionary.
1531 999; 0;
1532 ])
1533 for variant in \
1534         "be 57e6ad709668bbf538e2efee4af49916" \
1535         "le 523f14b611efa380bbadf7a16ea43fed"
1536 do
1537   set $variant
1538   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1539 ])
1540   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1541 ])
1542   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1543    [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1544 ])
1545 done
1546 AT_CLEANUP
1547
1548 AT_SETUP([variable width must be between 0 and 255])
1549 AT_KEYWORDS([sack synthetic system file negative])
1550 AT_DATA([sys-file.sack], [dnl
1551 dnl File header.
1552 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1553 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1554
1555 dnl String variable with invalid width 256.
1556 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1557
1558 dnl End of dictionary.
1559 999; 0;
1560 ])
1561 for variant in \
1562         "be 170bb18589ba264a0ed2d57b41fe77e1" \
1563         "le 9528b4b5936ef5630bbd3bdd60a123c3"
1564 do
1565   set $variant
1566   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1567 ])
1568   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1569 ])
1570   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1571    [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1572 ])
1573 done
1574 AT_CLEANUP
1575
1576 AT_SETUP([duplicate variable name])
1577 AT_KEYWORDS([sack synthetic system file negative])
1578 AT_DATA([sys-file.sack], [dnl
1579 dnl File header.
1580 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1581 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1582
1583 dnl Numeric variables.
1584 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1585 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1586
1587 dnl End of dictionary.
1588 999; 0;
1589 ])
1590 for variant in \
1591         "be d8f5fd768ab1d641f9330a4840c71343" \
1592         "le f01e123d384cdaa7c2f7fc4791325ebf"
1593 do
1594   set $variant
1595   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1596 ])
1597   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1598 ])
1599   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1600    [error: `sys-file.sav' near offset 0xd4: Duplicate variable name `VAR1'.
1601 ])
1602 done
1603 AT_CLEANUP
1604
1605 AT_SETUP([variable label indicator not 0 or 1])
1606 AT_KEYWORDS([sack synthetic system file negative])
1607 AT_DATA([sys-file.sack], [dnl
1608 dnl File header.
1609 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1610 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1611
1612 dnl Numeric variable.
1613 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1614
1615 dnl End of dictionary.
1616 999; 0;
1617 ])
1618 for variant in \
1619         "be 3c5ff8d8f146457a385ca92d3d23ca8a" \
1620         "le 37e9f956d321ae57b0bf7fe2384e892b"
1621 do
1622   set $variant
1623   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1624 ])
1625   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1626 ])
1627   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1628    [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1629 ])
1630 done
1631 AT_CLEANUP
1632
1633 AT_SETUP([invalid numeric missing value indicator])
1634 AT_KEYWORDS([sack synthetic system file negative])
1635 AT_DATA([sys-file.sack], [dnl
1636 dnl File header.
1637 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1638 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1639
1640 dnl Numeric variable.
1641 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1642
1643 dnl End of dictionary.
1644 999; 0;
1645 ])
1646 for variant in \
1647         "be d1d0d4aedf9f053452c4b1e658ade5e2" \
1648         "le df697575499fe12921185a3d23a5d61d"
1649 do
1650   set $variant
1651   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1652 ])
1653   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1654 ])
1655   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1656    ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1657 ])
1658 done
1659 AT_CLEANUP
1660
1661 AT_SETUP([invalid string missing value indicator])
1662 AT_KEYWORDS([sack synthetic system file negative])
1663 AT_DATA([sys-file.sack], [dnl
1664 dnl File header.
1665 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1666 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1667
1668 dnl String variable.
1669 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1670
1671 dnl End of dictionary.
1672 999; 0;
1673 ])
1674 for variant in \
1675         "be f833033be7b102fae19159989f62faa6" \
1676         "le 9704ba828bb7a36ef0262838f6b7936b"
1677 do
1678   set $variant
1679   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1680 ])
1681   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1682 ])
1683   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1684    ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1685 ])
1686 done
1687 AT_CLEANUP
1688
1689 AT_SETUP([missing string continuation record])
1690 AT_KEYWORDS([sack synthetic system file negative])
1691 AT_DATA([sys-file.sack], [dnl
1692 dnl File header.
1693 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1694 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1695
1696 dnl String variable.
1697 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1698 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1699
1700 dnl End of dictionary.
1701 999; 0;
1702 ])
1703 for variant in \
1704         "be c8f9ad2b2acd2918055e2b78c1e0b4b8" \
1705         "le 1afab4d6aee90a6fe8d2dbf229e06409"
1706 do
1707   set $variant
1708   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1709 ])
1710   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1711 ])
1712   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1713    [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1714 ])
1715 done
1716 AT_CLEANUP
1717
1718 AT_SETUP([invalid variable format])
1719 AT_KEYWORDS([sack synthetic system file negative])
1720 AT_DATA([sys-file.sack], [dnl
1721 dnl File header.
1722 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1723 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1724
1725 dnl Numeric variable, invalid format types.
1726 dnl No warning is issued for type 0 because it has been observed in real
1727 dnl system files.
1728 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1729
1730 dnl Numeric variable, string formats.
1731 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1732
1733 dnl String variable, numeric formats.
1734 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1735
1736 dnl String variable, wrong width formats.
1737 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1738
1739 dnl End of dictionary.
1740 999; 0;
1741 ])
1742 for variant in \
1743         "be c6ef5d8fded46443aba89adfafe15cad" \
1744         "le fccaf1764c973892f2d5adbcc2c36fb7"
1745 do
1746   set $variant
1747   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1748 ])
1749   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1750 ])
1751   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1752 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1753
1754 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1755
1756 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1757
1758 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1759
1760 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1761
1762 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1763
1764 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1765 ])
1766 done
1767 AT_CLEANUP
1768
1769 AT_SETUP([weighting variable must be numeric])
1770 AT_KEYWORDS([sack synthetic system file negative])
1771 AT_DATA([sys-file.sack], [dnl
1772 dnl File header.
1773 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1774 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1775
1776 dnl Numeric variable.
1777 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1778
1779 dnl String variable.
1780 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1781
1782 dnl End of dictionary.
1783 999; 0;
1784 ])
1785 for variant in \
1786         "be 82d30105e46c4896c24f9dcec26c4749" \
1787         "le 32e235119be70050eb78bf4186a5a046"
1788 do
1789   set $variant
1790   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1791 ])
1792   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1793 ])
1794   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1795    [error: `sys-file.sav': Weighting variable must be numeric (not string variable `STR1').
1796 ])
1797 done
1798 AT_CLEANUP
1799
1800 AT_SETUP([bad weighting variable index])
1801 AT_KEYWORDS([sack synthetic system file negative])
1802 AT_DATA([sys-file.sack], [dnl
1803 dnl File header.
1804 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1805 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1806
1807 dnl Numeric variable.
1808 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1809
1810 dnl String variable.
1811 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1812
1813 dnl End of dictionary.
1814 999; 0;
1815 ])
1816 for variant in \
1817         "be cd9af924ff20bc75834aa2c696254c97" \
1818         "le cbe0f2f514f5e95f27644d0b4314bc78"
1819 do
1820   set $variant
1821   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1822 ])
1823   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1824 ])
1825   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1826    [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
1827 ])
1828 done
1829 AT_CLEANUP
1830
1831 AT_SETUP([variable index is long string contination])
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; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1837
1838 dnl Numeric variable.
1839 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1840
1841 dnl Long string variable.
1842 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1843 (2; -1; 0; 0; 0; 0; s8 "");
1844
1845 dnl End of dictionary.
1846 999; 0;
1847 ])
1848 for variant in \
1849         "be 0c395354df56ea5ff374aafcc535d633" \
1850         "le d977f684ea9d4648ed40f8c6dddde9f7"
1851 do
1852   set $variant
1853   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1854 ])
1855   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1856 ])
1857   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1858    [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
1859 ])
1860 done
1861 AT_CLEANUP
1862
1863 AT_SETUP([multiple documents records])
1864 AT_KEYWORDS([sack synthetic system file negative])
1865 AT_DATA([sys-file.sack], [dnl
1866 dnl File header.
1867 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1868 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1869
1870 dnl Numeric variable, no label or missing values.
1871 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1872
1873 dnl Two document records.
1874 (6; 1; s80 "One line of documents") >>* 2<<;
1875
1876 dnl Dictionary termination record.
1877 999; 0;
1878
1879 dnl Data.
1880 1.0;
1881 ])
1882 for variant in \
1883         "be 18aa3348a216ed494efe28285b348fa8" \
1884         "le 19b21522bcef1dcc60af328f923f307e"
1885 do
1886   set $variant
1887   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1888 ])
1889   AT_DATA([sys-file.sps], [dnl
1890 GET FILE='sys-file.sav'.
1891 ])
1892   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1893 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
1894 ])
1895 done
1896 AT_CLEANUP
1897
1898
1899 AT_SETUP([empty document record])
1900 AT_KEYWORDS([sack synthetic system file negative])
1901 AT_DATA([sys-file.sack], [dnl
1902 dnl File header.
1903 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1904 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1905
1906 dnl Numeric variable, no label or missing values.
1907 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1908
1909 dnl Empty document record.
1910 6; >>0<<;
1911
1912 dnl Dictionary termination record.
1913 999; 0;
1914
1915 dnl Data.
1916 1.0;
1917 ])
1918 for variant in \
1919         "be d8ef29c1b97f9ed226cbd938c9c49b6e" \
1920         "le f6a560c5b62e2c472429d85294f36e61"
1921 do
1922   set $variant
1923   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1924 ])
1925   AT_DATA([sys-file.sps], [dnl
1926 GET FILE='sys-file.sav'.
1927 ])
1928   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1929 error: `sys-file.sav' near offset 0xd4: Number of document lines (0) must be greater than 0 and less than 26843545.
1930 ])
1931 done
1932 AT_CLEANUP
1933
1934 AT_SETUP([extension record too large])
1935 AT_KEYWORDS([sack synthetic system file negative])
1936 AT_DATA([sys-file.sack], [dnl
1937 dnl File header.
1938 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1939 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1940
1941 dnl Numeric variable, no label or missing values.
1942 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1943
1944 dnl Too-large extension record.
1945 7; 3; >>0xfffff000 * 2<<;
1946 ])
1947 for variant in \
1948         "be 5a6679dc41ac349b0b73fc430937c05c" \
1949         "le d4769c7f650cfbf160e0386d0d33be04"
1950 do
1951   set $variant
1952   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1953 ])
1954   AT_DATA([sys-file.sps], [dnl
1955 GET FILE='sys-file.sav'.
1956 ])
1957   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1958 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
1959 ])
1960 done
1961 AT_CLEANUP
1962
1963 AT_SETUP([unknown extension record])
1964 AT_KEYWORDS([sack synthetic system file negative])
1965 AT_DATA([sys-file.sack], [dnl
1966 dnl File header.
1967 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1968 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1969
1970 dnl Numeric variable, no label or missing values.
1971 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1972
1973 dnl Unknown extension record type.
1974 7; 30; 1; 1; i8 0;
1975
1976 dnl End of dictionary.
1977 999; 0;
1978 ])
1979 for variant in \
1980         "be ac8395e27677408189bcb8655e56cc0e" \
1981         "le e308bfcd51f1e3c28d7379c29271f9d6"
1982 do
1983   set $variant
1984   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1985 ])
1986   AT_DATA([sys-file.sps], [dnl
1987 GET FILE='sys-file.sav'.
1988 ])
1989   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1990 "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."
1991 ])
1992 done
1993 AT_CLEANUP
1994
1995 AT_SETUP([bad machine integer info size])
1996 AT_KEYWORDS([sack synthetic system file negative])
1997 AT_DATA([sys-file.sack], [dnl
1998 dnl File header.
1999 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2000 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2001
2002 dnl Numeric variable, no label or missing values.
2003 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2004
2005 dnl Machine integer info record.
2006 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2007
2008 dnl End of dictionary.
2009 999; 0;
2010 ])
2011 for variant in \
2012         "be 21ec84826886b0a266d1360f8279d769" \
2013         "le 15dcba7b2b89b7d8a21ebcc872f515af"
2014 do
2015   set $variant
2016   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [ignore])
2017   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2018 ])
2019   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2020 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2021 ])
2022 done
2023 AT_CLEANUP
2024
2025 AT_SETUP([bad machine integer info float format])
2026 AT_KEYWORDS([sack synthetic system file negative])
2027 AT_DATA([sys-file.sack], [dnl
2028 dnl File header.
2029 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2030 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2031
2032 dnl Numeric variable, no label or missing values.
2033 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2034
2035 dnl Machine integer info record.
2036 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2037
2038 dnl End of dictionary.
2039 999; 0;
2040 ])
2041 for variant in \
2042         "be d510ed28278649eee997fb6881a4c04f" \
2043         "le fbf1eca561a4e243b7ae844ed1677035"
2044 do
2045   set $variant
2046   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [ignore])
2047   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2048 ])
2049   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2050 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2051 ])
2052 done
2053 AT_CLEANUP
2054
2055 AT_SETUP([bad machine integer info endianness])
2056 AT_KEYWORDS([sack synthetic system file negative])
2057 AT_DATA([sys-file.sack], [dnl
2058 dnl File header.
2059 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2060 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2061
2062 dnl Numeric variable, no label or missing values.
2063 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2064
2065 dnl Machine integer info record.
2066 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2067
2068 dnl End of dictionary.
2069 999; 0;
2070 ])
2071 for variant in \
2072         "be 855123d16d5e1560b91d60753dad79ad 1" \
2073         "le d6626b4fa2e46a91f26c2fc609b2f1e0 2"
2074 do
2075   set $variant
2076   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2077 ])
2078   AT_DATA([sys-file.sps], [dnl
2079 GET FILE='sys-file.sav'.
2080 DISPLAY DICTIONARY.
2081 ])
2082   AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2083 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[3]).
2084
2085 Variable,Description,,Position
2086 num1,Format: F8.0,,1
2087 ,Measure: Scale,,
2088 ,Display Alignment: Right,,
2089 ,Display Width: 8,,
2090 ])
2091 done
2092 AT_CLEANUP
2093
2094
2095 AT_SETUP([bad machine floating-point info size])
2096 AT_KEYWORDS([sack synthetic system file negative])
2097 AT_DATA([sys-file.sack], [dnl
2098 dnl File header.
2099 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2100 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2101
2102 dnl Numeric variable, no label or missing values.
2103 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2104
2105 dnl Machine floating-point info record.
2106 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2107
2108 dnl End of dictionary.
2109 999; 0;
2110 ])
2111 for variant in \
2112         "be 29c9a173638fbb8bb1efe1176c4d670f" \
2113         "le 5cb49eb1084e5b9cd573a54705ff86a7"
2114 do
2115   set $variant
2116   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [ignore])
2117   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2118 ])
2119   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2120 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2121 ])
2122 done
2123 AT_CLEANUP
2124
2125 AT_SETUP([wrong special floating point values])
2126 AT_KEYWORDS([sack synthetic system file negative])
2127 AT_DATA([sys-file.sack], [dnl
2128 dnl File header.
2129 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2130 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2131
2132 dnl Numeric variable, no label or missing values.
2133 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2134
2135 dnl Machine floating-point info record.
2136 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2137
2138 dnl End of dictionary.
2139 999; 0;
2140 ])
2141 for variant in \
2142         "be 1e7452d9bb0a2397bf6084a25437514e" \
2143         "le f59f9a83f723cde1611869ff6d91d325"
2144 do
2145   set $variant
2146   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2147 ])
2148   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2149 ])
2150   AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2151 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2152
2153 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2154
2155 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2156 ])
2157 done
2158 AT_CLEANUP
2159
2160 AT_SETUP([bad mrsets name])
2161 AT_KEYWORDS([sack synthetic system file negative multiple response])
2162 AT_DATA([sys-file.sack], [dnl
2163 dnl File header.
2164 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2165 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2166
2167 dnl Numeric variable, no label or missing values.
2168 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2169
2170 dnl Multiple response sets.
2171 7; 7; 1; COUNT("a=C");
2172 7; 19; 1; COUNT("xyz=D");
2173
2174 999; 0;
2175 ])
2176 for variant in \
2177         "be 15a9bf44d0cd6186a60629b77079c5a5" \
2178         "le 161c99aca5e7a3684df096137e72ce5b"
2179 do
2180   set $variant
2181   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2182 ])
2183   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2184 ])
2185   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2186 warning: `sys-file.sav' near offset 0xd8: `a' does not begin with `$' at offset 2 in MRSETS record.
2187
2188 warning: `sys-file.sav' near offset 0xeb: `xyz' does not begin with `$' at offset 4 in MRSETS record.
2189 ])
2190 done
2191 AT_CLEANUP
2192
2193 AT_SETUP([missing space after C in mrsets])
2194 AT_KEYWORDS([sack synthetic system file negative multiple response])
2195 AT_DATA([sys-file.sack], [dnl
2196 dnl File header.
2197 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2198 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2199
2200 dnl Numeric variable, no label or missing values.
2201 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2202
2203 dnl Multiple response sets.
2204 7; 7; 1; COUNT("$a=Cx");
2205
2206 999; 0;
2207 ])
2208 for variant in \
2209         "be c5e5656ba3d74c3a967850f29ad89970" \
2210         "le 29f110509c3d6893a7d21ae2d66aad9d"
2211 do
2212   set $variant
2213   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2214 ])
2215   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2216 ])
2217   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2218 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2219 ])
2220 done
2221 AT_CLEANUP
2222
2223 AT_SETUP([missing space after E in mrsets])
2224 AT_KEYWORDS([sack synthetic system file negative multiple response])
2225 AT_DATA([sys-file.sack], [dnl
2226 dnl File header.
2227 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2228 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2229
2230 dnl Numeric variable, no label or missing values.
2231 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2232
2233 dnl Multiple response sets.
2234 7; 7; 1; COUNT("$a=Ex");
2235
2236 999; 0;
2237 ])
2238 for variant in \
2239         "be a9e1dc63e2524882a5e3d2949a2da9d4" \
2240         "le ac709ca1928f65f47a8c8efdd9454b50"
2241 do
2242   set $variant
2243   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2244 ])
2245   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2246 ])
2247   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2248 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2249 ])
2250 done
2251 AT_CLEANUP
2252
2253 AT_SETUP([unexpected label source in mrsets])
2254 AT_KEYWORDS([sack synthetic system file negative multiple response])
2255 AT_DATA([sys-file.sack], [dnl
2256 dnl File header.
2257 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2258 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2259
2260 dnl Numeric variable, no label or missing values.
2261 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2262
2263 dnl Multiple response sets.
2264 7; 7; 1; COUNT("$a=E 2");
2265
2266 999; 0;
2267 ])
2268 for variant in \
2269         "be 8c710e85a0a1609d0d03dec80aaf5f94" \
2270         "le 4682440b82f22d4bd2ac56afb7fa3152"
2271 do
2272   set $variant
2273   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2274 ])
2275   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2276 ])
2277   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2278 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value `2' following `E' at offset 7 in MRSETS record.
2279
2280 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2281 ])
2282 done
2283 AT_CLEANUP
2284
2285 AT_SETUP([bad type character in mrsets])
2286 AT_KEYWORDS([sack synthetic system file negative multiple response])
2287 AT_DATA([sys-file.sack], [dnl
2288 dnl File header.
2289 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2290 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2291
2292 dnl Numeric variable, no label or missing values.
2293 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2294
2295 dnl Multiple response sets.
2296 7; 7; 1; COUNT("$a=");
2297
2298 999; 0;
2299 ])
2300 for variant in \
2301         "be fc5e5200d8f56b9a5a713e4a95313a3b" \
2302         "le 578a61e8a06b20216612f566c2050879"
2303 do
2304   set $variant
2305   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2306 ])
2307   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2308 ])
2309   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2310 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2311 ])
2312 done
2313 AT_CLEANUP
2314
2315 AT_SETUP([bad counted string length in mrsets])
2316 AT_KEYWORDS([sack synthetic system file negative multiple response])
2317 AT_DATA([sys-file.sack], [dnl
2318 dnl File header.
2319 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2320 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2321
2322 dnl Numeric variable, no label or missing values.
2323 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2324
2325 dnl Multiple response sets.
2326 7; 7; 1; COUNT("$a=Dx");
2327
2328 999; 0;
2329 ])
2330 for variant in \
2331         "be 23d0e2f65c7c5f93bbedcc0f2b260c69" \
2332         "le c3860c1d80e08842264948056e72c0db"
2333 do
2334   set $variant
2335   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2336 ])
2337   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2338 ])
2339   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2340 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2341 ])
2342 done
2343 AT_CLEANUP
2344
2345 AT_SETUP([missing space in counted string in mrsets])
2346 AT_KEYWORDS([sack synthetic system file negative multiple response])
2347 AT_DATA([sys-file.sack], [dnl
2348 dnl File header.
2349 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2350 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2351
2352 dnl Numeric variable, no label or missing values.
2353 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2354
2355 dnl Multiple response sets.
2356 7; 7; 1; COUNT("$a=D1x");
2357
2358 999; 0;
2359 ])
2360 for variant in \
2361         "be c9ce001723763e0698878b7e43a887e8" \
2362         "le e258a1e4491d5a1d1e7d2272ef631a22"
2363 do
2364   set $variant
2365   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2366 ])
2367   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2368 ])
2369   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2370 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2371 ])
2372 done
2373 AT_CLEANUP
2374
2375 AT_SETUP([counted string too long in mrsets])
2376 AT_KEYWORDS([sack synthetic system file negative multiple response])
2377 AT_DATA([sys-file.sack], [dnl
2378 dnl File header.
2379 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2380 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2381
2382 dnl Numeric variable, no label or missing values.
2383 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2384
2385 dnl Multiple response sets.
2386 7; 7; 1; COUNT("$a=D4 abc");
2387
2388 999; 0;
2389 ])
2390 for variant in \
2391         "be 196d1266fa0e8e315769dcbe3130e3df" \
2392         "le 23df1ba7b77a26da8ce1c2cfbcaadce0"
2393 do
2394   set $variant
2395   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2396 ])
2397   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2398 ])
2399   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2400 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2401 ])
2402 done
2403 AT_CLEANUP
2404
2405 AT_SETUP([missing space after counted string in mrsets])
2406 AT_KEYWORDS([sack synthetic system file negative multiple response])
2407 AT_DATA([sys-file.sack], [dnl
2408 dnl File header.
2409 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2410 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2411
2412 dnl Numeric variable, no label or missing values.
2413 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2414
2415 dnl Multiple response sets.
2416 7; 7; 1; COUNT("$a=D3 abcx");
2417
2418 999; 0;
2419 ])
2420 for variant in \
2421         "be 86314bb0bbdfad48c10af8b8d8106d6e" \
2422         "le 2b8d05ff501ca78e51f7110ce88a2364"
2423 do
2424   set $variant
2425   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2426 ])
2427   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2428 ])
2429   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2430 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2431 ])
2432 done
2433 AT_CLEANUP
2434
2435 AT_SETUP([missing newline after variable name in mrsets])
2436 AT_KEYWORDS([sack synthetic system file negative multiple response])
2437 AT_DATA([sys-file.sack], [dnl
2438 dnl File header.
2439 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2440 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2441
2442 dnl Numeric variable, no label or missing values.
2443 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2444
2445 dnl Multiple response sets.
2446 7; 7; 1; COUNT("$a=C 0  NUM1");
2447
2448 999; 0;
2449 ])
2450 for variant in \
2451         "be cea939cf3e6a5f88cb45e8fa871c5e13" \
2452         "le 52135afec082f50f37eafacadbb2cd65"
2453 do
2454   set $variant
2455   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2456 ])
2457   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2458 ])
2459   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2460 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2461
2462 warning: `sys-file.sav' near offset 0xd8: MRSET $a has only 1 variables.
2463 ])
2464 done
2465 AT_CLEANUP
2466
2467 AT_SETUP([duplicate variable name in mrsets])
2468 AT_KEYWORDS([sack synthetic system file negative multiple response])
2469 AT_DATA([sys-file.sack], [dnl
2470 dnl File header.
2471 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2472 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2473
2474 dnl Numeric variable, no label or missing values.
2475 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2476
2477 dnl Multiple response sets.
2478 7; 7; 1; COUNT("$a=C 0  NUM1 NUM1"; i8 10);
2479
2480 999; 0;
2481 ])
2482 for variant in \
2483         "be 4b1b5fa2dc22cf0afdd35422290b0a29" \
2484         "le e4304b57976440a036f25f8dd8ac1404"
2485 do
2486   set $variant
2487   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2488 ])
2489   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2490 ])
2491   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2492 warning: `sys-file.sav' near offset 0xd8: Duplicate variable name NUM1 at offset 18 in MRSETS record.
2493
2494 warning: `sys-file.sav' near offset 0xd8: MRSET $a has only 1 variables.
2495 ])
2496 done
2497 AT_CLEANUP
2498
2499 AT_SETUP([mixed variable types in mrsets])
2500 AT_KEYWORDS([sack synthetic system file negative multiple response])
2501 AT_DATA([sys-file.sack], [dnl
2502 dnl File header.
2503 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2504 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2505
2506 dnl Variables.
2507 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2508 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2509
2510 dnl Multiple response sets.
2511 7; 7; 1; COUNT("$a=C 0  NUM1 STR1"; i8 10);
2512
2513 999; 0;
2514 ])
2515 for variant in \
2516         "be 0f130e967e4097823f85b8711eb20727" \
2517         "le 4dc987b4303fd115f1cae9be3963acc9"
2518 do
2519   set $variant
2520   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2521 ])
2522   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2523 ])
2524   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2525 warning: `sys-file.sav' near offset 0xf8: MRSET $a contains both string and numeric variables.
2526
2527 warning: `sys-file.sav' near offset 0xf8: MRSET $a has only 1 variables.
2528 ])
2529 done
2530 AT_CLEANUP
2531
2532 AT_SETUP([missing newline after variable name in mrsets])
2533 AT_KEYWORDS([sack synthetic system file negative multiple response])
2534 AT_DATA([sys-file.sack], [dnl
2535 dnl File header.
2536 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2537 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2538
2539 dnl Numeric variable, no label or missing values.
2540 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2541
2542 dnl Multiple response sets.
2543 7; 7; 1; COUNT("$a=C 0  NUM1"; i8 10);
2544
2545 999; 0;
2546 ])
2547 for variant in \
2548         "be 3a891e0a467afb3d622629c70f329ada" \
2549         "le 432998ec08370510411af4f5207c015e"
2550 do
2551   set $variant
2552   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2553 ])
2554   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2555 ])
2556   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2557 warning: `sys-file.sav' near offset 0xd8: MRSET $a has only 1 variables.
2558 ])
2559 done
2560 AT_CLEANUP
2561
2562 AT_SETUP([only one variable in mrset])
2563 AT_KEYWORDS([sack synthetic system file negative multiple response])
2564 AT_DATA([sys-file.sack], [dnl
2565 dnl File header.
2566 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2567 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2568
2569 dnl Numeric variable, no label or missing values.
2570 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2571
2572 dnl Multiple response sets.
2573 7; 7; 1; COUNT("$a=C 0  NUM1"; i8 10);
2574
2575 999; 0;
2576 ])
2577 for variant in \
2578         "be 3a891e0a467afb3d622629c70f329ada" \
2579         "le 432998ec08370510411af4f5207c015e"
2580 do
2581   set $variant
2582   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2583 ])
2584   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2585 ])
2586   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2587 warning: `sys-file.sav' near offset 0xd8: MRSET $a has only 1 variables.
2588 ])
2589 done
2590 AT_CLEANUP
2591
2592 AT_SETUP([wrong display parameter size])
2593 AT_KEYWORDS([sack synthetic system file negative])
2594 AT_DATA([sys-file.sack], [dnl
2595 dnl File header.
2596 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2597 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2598
2599 dnl Numeric variable, no label or missing values.
2600 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2601
2602 dnl Display parameters record.
2603 7; 11; >>8<<; 2; 1.0; 1.0;
2604
2605 dnl End of dictionary.
2606 999; 0;
2607 ])
2608 for variant in \
2609         "be 7c0f1ae47ae11e37d435c4abaceca226" \
2610         "le c29d05a1f8f15ed2201f31f8b787aaa0"
2611 do
2612   set $variant
2613   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2614 ])
2615   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2616 ])
2617   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2618 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2619 ])
2620 done
2621 AT_CLEANUP
2622
2623 AT_SETUP([wrong display parameter count])
2624 AT_KEYWORDS([sack synthetic system file negative])
2625 AT_DATA([sys-file.sack], [dnl
2626 dnl File header.
2627 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2628 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2629
2630 dnl Numeric variable, no label or missing values.
2631 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2632
2633 dnl Display parameters record.
2634 7; 11; 4; >>4<<; 1; 1; 2; 2;
2635
2636 dnl End of dictionary.
2637 999; 0;
2638 ])
2639 for variant in \
2640         "be 372b57e73c69b05047b60bf6c596e2a1" \
2641         "le 2a550d8c5ceae4de7ced77df66e49d0f"
2642 do
2643   set $variant
2644   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2645 ])
2646   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2647 ])
2648   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2649 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2650 ])
2651 done
2652 AT_CLEANUP
2653
2654 AT_SETUP([wrong display measurement level])
2655 AT_KEYWORDS([sack synthetic system file negative])
2656 AT_DATA([sys-file.sack], [dnl
2657 dnl File header.
2658 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2659 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2660
2661 dnl Numeric variable, no label or missing values.
2662 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2663
2664 dnl Display parameters record.
2665 7; 11; 4; 2; >>4<<; 0;
2666
2667 dnl End of dictionary.
2668 999; 0;
2669 ])
2670 for variant in \
2671         "be d43e7616b03743339f37292dec6c2204" \
2672         "le 821533c29a070cefdd8f07f4e1741d2a"
2673 do
2674   set $variant
2675   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2676 ])
2677   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2678 ])
2679   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2680 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1).  Default parameters substituted.
2681 ])
2682 done
2683 AT_CLEANUP
2684
2685 AT_SETUP([wrong display alignment])
2686 AT_KEYWORDS([sack synthetic system file negative])
2687 AT_DATA([sys-file.sack], [dnl
2688 dnl File header.
2689 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2690 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2691
2692 dnl Numeric variable, no label or missing values.
2693 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2694
2695 dnl Display parameters record.
2696 7; 11; 4; 2; 1; >>-1<<;
2697
2698 dnl End of dictionary.
2699 999; 0;
2700 ])
2701 for variant in \
2702         "be c54bc48b5767e2ec3a9ef31df790cb7c" \
2703         "le a4d8b14af64221abe83adb417d110e10"
2704 do
2705   set $variant
2706   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2707 ])
2708   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2709 ])
2710   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2711 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1).  Default parameters substituted.
2712 ])
2713 done
2714 AT_CLEANUP
2715
2716 AT_SETUP([bad variable name in variable/value pair])
2717 AT_KEYWORDS([sack synthetic system file negative])
2718 AT_DATA([sys-file.sack], [dnl
2719 dnl File header.
2720 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2721 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2722
2723 dnl Numeric variables.
2724 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2725
2726 dnl Long variable names.
2727 7; 13; 1; COUNT (>>"xyzzy"<<);
2728
2729 dnl Dictionary termination record.
2730 999; 0;
2731 ])
2732 for variant in \
2733         "be b67b6e3c1900e5a9cc691055008f0447" \
2734         "le 26cc52e601f830f9087a0ea2bd9527df"
2735 do
2736   set $variant
2737   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2738 ])
2739   AT_DATA([sys-file.sps], [dnl
2740 GET FILE='sys-file.sav'.
2741 ])
2742   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2743 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
2744 ])
2745 done
2746 AT_CLEANUP
2747
2748 AT_SETUP([duplicate long variable name])
2749 AT_KEYWORDS([sack synthetic system file negative])
2750 AT_DATA([sys-file.sack], [dnl
2751 dnl File header.
2752 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2753 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2754
2755 dnl Numeric variables.
2756 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2757 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
2758 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
2759 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
2760
2761 dnl Long variable names.
2762 7; 13; 1; COUNT (
2763 "LONGVARI=_Invalid"; i8 9;
2764 "LONGVA_A=LongVariableName"; i8 9;
2765 "LONGVA_B=LONGVARIABLENAME"; i8 9;
2766 );
2767
2768 dnl Dictionary termination record.
2769 999; 0;
2770 ])
2771 for variant in \
2772         "be 9b4b4daa00084d984efb8f889bcb727c" \
2773         "le c1b1470d5cd615106e9ae507c9948d8e"
2774 do
2775   set $variant
2776   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2777 ])
2778   AT_DATA([sys-file.sps], [dnl
2779 GET FILE='sys-file.sav'.
2780 ])
2781   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2782 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
2783
2784 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
2785 ])
2786 done
2787 AT_CLEANUP
2788
2789 AT_SETUP([bad very long string length])
2790 AT_KEYWORDS([sack synthetic system file negative])
2791 AT_DATA([sys-file.sack], [dnl
2792 dnl File header.
2793 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2794 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2795
2796 dnl Numeric variable.
2797 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2798
2799 dnl Very long string map.
2800 7; 14; 1; COUNT (
2801 "NUM1=00000"; i8 0; i8 9;
2802 "NUM1=00255"; i8 0; i8 9;
2803 "NUM1=00256"; i8 0; i8 9;
2804 );
2805
2806 dnl Dictionary termination record.
2807 999; 0;
2808 ])
2809 for variant in \
2810         "be 1309d8d9fb24bcf08952dce9b0f39a94" \
2811         "le 94a39de88f8034001b3e467c4cc04d0f"
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 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
2821
2822 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
2823
2824 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
2825 ])
2826 done
2827 AT_CLEANUP
2828
2829 AT_SETUP([bad very long string segment width])
2830 AT_KEYWORDS([sack synthetic system file negative])
2831 AT_DATA([sys-file.sack], [dnl
2832 dnl File header.
2833 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2834 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2835
2836 dnl Variables.
2837 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
2838 (2; -1; 0; 0; 0; 0; s8 "") * 31;
2839 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
2840 >>2; -1; 0; 0; 0; 0; s8 "";<<
2841
2842 dnl Very long string map.
2843 7; 14; 1; COUNT (
2844 "STR1=00256"; i8 0; i8 9;
2845 );
2846
2847 dnl Dictionary termination record.
2848 999; 0;
2849 ])
2850 for variant in \
2851         "be 1d09a44a46859e6eda28e053dd4b7a8b" \
2852         "le 63b9ac0b3953f3e0d5ee248ebe257794"
2853 do
2854   set $variant
2855   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2856 ])
2857   AT_DATA([sys-file.sps], [dnl
2858 GET FILE='sys-file.sav'.
2859 ])
2860   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2861 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
2862 ])
2863 done
2864 AT_CLEANUP
2865
2866 AT_SETUP([too many value labels])
2867 dnl Skip the test if multiplying a small number by INT32_MAX would not
2868 dnl cause an overflow in size_t.
2869 AT_SKIP_IF([test $SIZEOF_SIZE_T -gt 4])
2870 AT_KEYWORDS([sack synthetic system file negative])
2871 AT_DATA([sys-file.sack], [dnl
2872 dnl File header.
2873 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2874 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2875
2876 dnl Numeric variable.
2877 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2878 3; >>0x7fffffff<<;
2879 ])
2880 for variant in \
2881         "be 975b2668dde395ddf619977958b37412" \
2882         "le 0c14aa278cfc2a4b801f91c14321f03b"
2883 do
2884   set $variant
2885   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2886 ])
2887   AT_DATA([sys-file.sps], [dnl
2888 GET FILE='sys-file.sav'.
2889 ])
2890   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2891 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
2892 ])
2893 done
2894 AT_CLEANUP
2895
2896 AT_SETUP([missing type 4 record])
2897 AT_KEYWORDS([sack synthetic system file negative])
2898 AT_DATA([sys-file.sack], [dnl
2899 dnl File header.
2900 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2901 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2902
2903 dnl Numeric variable.
2904 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2905
2906 dnl Value label with missing type 4 record.
2907 3; 1; 1.0; i8 3; s7 "one";
2908
2909 dnl End of dictionary.
2910 >>999; 0<<;
2911 ])
2912 for variant in \
2913         "be 5e1286ac92e3f25ff98492bc5019d608" \
2914         "le b33c12f776bbcaa43aa3bfdd4799e0c0"
2915 do
2916   set $variant
2917   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2918 ])
2919   AT_DATA([sys-file.sps], [dnl
2920 GET FILE='sys-file.sav'.
2921 ])
2922   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2923 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
2924 ])
2925 done
2926 AT_CLEANUP
2927
2928 AT_SETUP([value label with no associated variables])
2929 AT_KEYWORDS([sack synthetic system file negative])
2930 AT_DATA([sys-file.sack], [dnl
2931 dnl File header.
2932 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2933 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2934
2935 dnl Numeric variable.
2936 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2937
2938 dnl Value label with no variables.
2939 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
2940 ])
2941 for variant in \
2942         "be b0dcec30a936cbcad21c4f3d6fe10fcf" \
2943         "le 3b9fdfce5c8c248048232fd6eac018e3"
2944 do
2945   set $variant
2946   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2947 ])
2948   AT_DATA([sys-file.sps], [dnl
2949 GET FILE='sys-file.sav'.
2950 ])
2951   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2952 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).
2953 ])
2954 done
2955 AT_CLEANUP
2956
2957 AT_SETUP([type 4 record names long string variable])
2958 AT_KEYWORDS([sack synthetic system file negative])
2959 AT_DATA([sys-file.sack], [dnl
2960 dnl File header.
2961 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2962 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2963
2964 dnl Long string variable.
2965 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2966 2; -1; 0; 0; 0; 0; s8 "";
2967
2968 dnl Value label that names long string variable.
2969 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
2970
2971 dnl End of dictionary.
2972 999; 0;
2973 ])
2974 for variant in \
2975         "be 14053a4f09de4c7c4c55281534dd66f4" \
2976         "le 8a61cc994c659fd66307d2f0fd64ce20"
2977 do
2978   set $variant
2979   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [ignore])
2980   AT_DATA([sys-file.sps], [dnl
2981 GET FILE='sys-file.sav'.
2982 ])
2983   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2984 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.
2985 ])
2986 done
2987 AT_CLEANUP
2988
2989 AT_SETUP([variables for value label must all be same type])
2990 AT_KEYWORDS([sack synthetic system file negative])
2991 AT_DATA([sys-file.sack], [dnl
2992 dnl File header.
2993 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2994 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2995
2996 dnl Variables.
2997 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
2998 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2999
3000 dnl Value label that names numeric and string variables.
3001 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3002
3003 dnl End of dictionary.
3004 999; 0;
3005 ])
3006 for variant in \
3007         "be 7577c456726a88f52bbef63a8b47bf1a" \
3008         "le 3ba5c6af9ad0ae5cc88f9f63e726e414"
3009 do
3010   set $variant
3011   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [ignore])
3012   AT_DATA([sys-file.sps], [dnl
3013 GET FILE='sys-file.sav'.
3014 ])
3015   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3016 "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."
3017 ])
3018 done
3019 AT_CLEANUP
3020
3021 AT_SETUP([duplicate value labels type])
3022 AT_KEYWORDS([sack synthetic system file negative])
3023 AT_DATA([sys-file.sack], [dnl
3024 dnl File header.
3025 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3026 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3027
3028 dnl Variables.
3029 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3030 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3031
3032 dnl Duplicate value labels.
3033 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3034 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3035
3036 dnl End of dictionary.
3037 999; 0;
3038 ])
3039 for variant in \
3040         "be ef0f5b2ebddb5a3bfcda16c93a2508f4" \
3041         "le c00e27abd9a6c06bf29a108d7220435a"
3042 do
3043   set $variant
3044   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3045 ])
3046   AT_DATA([sys-file.sps], [dnl
3047 GET FILE='sys-file.sav'.
3048 ])
3049   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3050 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3051
3052 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3053 ])
3054 done
3055 AT_CLEANUP
3056
3057 AT_SETUP([missing attribute value])
3058 AT_KEYWORDS([sack synthetic system file negative])
3059 AT_DATA([sys-file.sack], [dnl
3060 dnl File header.
3061 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3062 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3063
3064 dnl Variables.
3065 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3066
3067 dnl Data file attributes record.
3068 7; 17; 1; COUNT (
3069 "Attr1("
3070 );
3071
3072 dnl Variable attributes record.
3073 7; 18; 1; COUNT (
3074 "FIRSTVAR:";
3075   "fred('23'"; i8 10
3076 );
3077
3078 dnl Dictionary termination record.
3079 999; 0;
3080 ])
3081 for variant in \
3082         "be 0fc71f5e3cdb6b7f2dd73d011d4885c2" \
3083         "le e519b44715400156a2bfe648eb5cff34"
3084 do
3085   set $variant
3086   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3087 ])
3088   AT_DATA([sys-file.sps], [dnl
3089 GET FILE='sys-file.sav'.
3090 ])
3091   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3092 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3093
3094 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3095 ])
3096 done
3097 AT_CLEANUP
3098
3099 AT_SETUP([unquoted attribute value])
3100 AT_KEYWORDS([sack synthetic system file negative])
3101 AT_DATA([sys-file.sack], [dnl
3102 dnl File header.
3103 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3104 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3105
3106 dnl Variables.
3107 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3108
3109 dnl Data file attributes record.
3110 7; 17; 1; COUNT (
3111 "Attr1(value"; i8 10;
3112 ")"
3113 );
3114
3115 dnl Variable attributes record.
3116 7; 18; 1; COUNT (
3117 "FIRSTVAR:";
3118   "fred(23"; i8 10; ")"
3119 );
3120
3121 dnl Dictionary termination record.
3122 999; 0;
3123 ])
3124 for variant in \
3125         "be 33dba37c2247e63c04bb74a7b472293d" \
3126         "le 041025a9d9d9e21a7fabd90ba7341934"
3127 do
3128   set $variant
3129   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3130 ])
3131   AT_DATA([sys-file.sps], [dnl
3132 GET FILE='sys-file.sav'.
3133 ])
3134   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3135 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3136
3137 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3138 ])
3139 done
3140 AT_CLEANUP
3141
3142 AT_SETUP([bad variable name in long string value label])
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; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3148
3149 dnl Variables.
3150 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3151 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3152 2; -1; 0; 0; 0; 0; s8 "";
3153
3154 7; 21; 1; COUNT (
3155 dnl No variable named STR9.
3156 COUNT(>>"STR9"<<); 9;
3157 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3158
3159 dnl NUM1 is numeric.
3160 COUNT(>>"NUM1"<<); 0;
3161 1; COUNT("xyz"); COUNT("value label for 1.0");
3162
3163 dnl Wrong width for STR14.
3164 COUNT("STR14"); >>9<<;
3165 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3166
3167 dnl Wrong width for value.
3168 COUNT("STR14"); 14;
3169 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3170
3171 dnl Duplicate value label.
3172 COUNT("STR14"); 14; 2;
3173 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3174 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3175 );
3176
3177 dnl Dictionary termination record.
3178 999; 0;
3179 ])
3180 for variant in \
3181         "be cf2e883dadb00e2c6404c09ea0a4e388" \
3182         "le 89c340faf0a7e4a8c834f9687684c091"
3183 do
3184   set $variant
3185   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3186 ])
3187   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3188 ])
3189   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3190 warning: `sys-file.sav' near offset 0x128: Ignoring long string value record for unknown variable STR9.
3191
3192 warning: `sys-file.sav' near offset 0x164: Ignoring long string value record for numeric variable NUM1.
3193
3194 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).
3195
3196 "warning: `sys-file.sav' near offset 0x1d4: Ignoring long string value 0 for variable str14, with width 14, that has bad value width 9."
3197
3198 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3199 ])
3200 done
3201 AT_CLEANUP
3202
3203 AT_SETUP([fewer data records than indicated by file header])
3204 AT_KEYWORDS([sack synthetic system file negative])
3205 AT_DATA([sys-file.sack], [dnl
3206 dnl File header.
3207 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3208 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3209
3210 dnl Numeric variables.
3211 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3212 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3213
3214 dnl Data.
3215 999; 0;
3216 1.0; 2.0;
3217 3.0; 4.0;
3218 5.0; 6.0;
3219 7.0; 8.0;
3220 dnl Missing record here.
3221 ])
3222 for variant in \
3223         "be 6ee097c3934055d0c4564641636f4b5a" \
3224         "le ae03fe1b888091d6938b5a436d44ac60"
3225 do
3226   set $variant
3227   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3228 ])
3229   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3230 LIST.
3231 ])
3232   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3233    [error: Error reading case from file `sys-file.sav'.
3234
3235 Table: Data List
3236 num1,num2
3237 1,2
3238 3,4
3239 5,6
3240 7,8
3241 ])
3242 done
3243 AT_CLEANUP
3244
3245 AT_SETUP([partial data record between variables])
3246 AT_KEYWORDS([sack synthetic system file negative])
3247 AT_DATA([sys-file.sack], [dnl
3248 dnl File header.
3249 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3250 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3251
3252 dnl Numeric variables.
3253 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3254 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3255
3256 dnl Data.
3257 999; 0;
3258 1.0; 2.0;
3259 3.0;
3260 ])
3261 for variant in \
3262         "be 4bcc085d7d8f0f09c6a4ba8064ffe61c" \
3263         "le 7387fc5edd2740aff92c30ca688d6d9b"
3264 do
3265   set $variant
3266   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3267 ])
3268   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3269 LIST.
3270 ])
3271   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3272    [error: `sys-file.sav' near offset 0x110: File ends in partial case.
3273
3274 Table: Data List
3275 num1,num2
3276 1,2
3277 ])
3278 done
3279 AT_CLEANUP
3280
3281 AT_SETUP([partial data record within long string])
3282 AT_KEYWORDS([sack synthetic system file negative])
3283 AT_DATA([sys-file.sack], [dnl
3284 dnl File header.
3285 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3286 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3287
3288 dnl Numeric variables.
3289 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3290 2; -1; 0; 0; 0; 0; s8 "";
3291
3292 dnl Data.
3293 999; 0;
3294 s14 "one data item";
3295 s8 "partial";
3296 ])
3297 for variant in \
3298         "be 4a9e84f9e679afb7bb71acd0bb7eab89" \
3299         "le 30752606f14ee2deec2854e8e6de4b3b"
3300 do
3301   set $variant
3302   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3303 ])
3304   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3305 LIST.
3306 ])
3307   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3308    [error: `sys-file.sav' near offset 0x10e: Unexpected end of file.
3309
3310 Table: Data List
3311 str14
3312 one data item @&t@
3313 ])
3314 done
3315 AT_CLEANUP
3316
3317 AT_SETUP([partial compressed data record])
3318 AT_KEYWORDS([sack synthetic system file positive])
3319 AT_DATA([sys-file.sack], [dnl
3320 dnl File header.
3321 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3322 2; dnl Layout code
3323 6; dnl Nominal case size
3324 1; dnl Compressed
3325 0; dnl Not weighted 
3326 -1; dnl Unspecified number of cases.
3327 100.0; dnl Bias.
3328 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3329 i8 0 *3;
3330
3331 dnl Numeric variables.
3332 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3333 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3334
3335 dnl String variable.
3336 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3337 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3338 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3339 2; -1; 0; 0; 0; 0; s8 "";
3340
3341 dnl Dictionary termination record.
3342 999; 0;
3343
3344 dnl Compressed data.
3345 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3346 ])
3347 for variant in \
3348         "be ef01b16e2e397d979a3a7d20725ebe6d" \
3349         "le 51f7a61e9bc68992469d16c55d6ecd88"
3350 do
3351   set $variant
3352   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3353 ])
3354   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3355 LIST.
3356 ])
3357   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3358    [error: `sys-file.sav' near offset 0x190: File ends in partial case.
3359
3360 Table: Data List
3361 num1,num2,str4,str8,str15
3362 -99,0,,abcdefgh,0123   @&t@
3363 ])
3364 done
3365 AT_CLEANUP
3366