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