]> icculus.org git repositories - icculus/xz.git/blob - tests/files/README
Added one more test file.
[icculus/xz.git] / tests / files / README
1
2 .lzma Test Files
3 ----------------
4
5 0. Introduction
6
7     This directory contains bunch of files to test handling of .lzma files
8     in .lzma decoder implementations. Many of the files have been created
9     by hand with a hex editor, thus there is no better "source code" than
10     the files themselves. All the test files (*.lzma) and this README have
11     been put into the public domain.
12
13
14 1. File Types
15
16     Good files (good-*.lzma) must decode successfully without requiring
17     a lot of CPU time or RAM.
18
19     Unsupported files (unsupported-*.lzma) are good files, but headers
20     indicate features not supported by the current file format
21     specification.
22
23     Bad files (bad-*.lzma) must cause the decoder to give an error. Like
24     with the good files, these files must not require a lot of CPU time
25     or RAM before they get detected to be broken.
26
27
28 2. Descriptions of Individual Files
29
30 2.1. Good Files
31
32     good-0-empty.lzma has one Stream with no Blocks.
33
34     good-0pad-empty.lzma has one Stream with no Blocks followed by
35     four-byte Stream Padding.
36
37     good-0cat-empty.lzma has two zero-Block Streams concatenated without
38     Stream Padding.
39
40     good-0catpad-empty.lzma has two zero-Block Streams concatenated with
41     four-byte Stream Padding between the Streams.
42
43     good-1-check-none.lzma has one Stream with one Block with two
44     uncompressed LZMA2 chunks and no integrity check.
45
46     good-1-check-crc32.lzma has one Stream with one Block with two
47     uncompressed LZMA2 chunks and CRC32 check.
48
49     good-1-check-crc64.lzma is like good-1-check-crc32.lzma but with CRC64.
50
51     good-1-check-sha256.lzma is like good-1-check-crc32.lzma but with
52     SHA256.
53
54     good-2-lzma2.lzma has one Stream with two Blocks with one uncompressed
55     LZMA2 chunk in each Block.
56
57     good-1-block_header-1.lzma has both Compressed Size and Uncompressed
58     Size in the Block Header. This has also four extra bytes of Header
59     Padding.
60
61     good-1-block_header-2.lzma has known Compressed Size.
62
63     good-1-block_header-3.lzma has known Uncompressed Size.
64
65     good-1-delta-lzma2.tiff.lzma is an image file that compresses
66     better with Delta+LZMA2 than with plain LZMA2.
67
68     good-1-x86-lzma2.lzma uses the x86 filter (BCJ) and LZMA2. The
69     uncompressed file is compress_prepared_bcj_x86 found from the tests
70     directory.
71
72     good-1-sparc-lzma2.lzma uses the SPARC filter and LZMA. The
73     uncompressed file is compress_prepared_bcj_sparc found from the tests
74     directory.
75
76     good-1-lzma2-1.lzma has two LZMA2 chunks, of which the second sets
77     new properties.
78
79     good-1-lzma2-2.lzma has two LZMA2 chunks, of which the second resets
80     the state without specifying new properties.
81
82     good-1-lzma2-3.lzma has two LZMA2 chunks, of which the first is
83     uncompressed and the second is LZMA. The first chunk resets dictionary
84     and the second sets new properties.
85
86     good-1-3delta-lzma2.lzma has three Delta filters and LZMA2.
87
88
89 2.2. Unsupported Files
90
91     unsupported-check.lzma uses Check ID 0x02 which isn't supported by
92     the current version of the file format. It is implementation-defined
93     how this file handled (it may reject it, or decode it possibly with
94     a warning).
95
96     unsupported-block_header.lzma has a non-nul byte in Header Padding,
97     which may indicate presence of a new unsupported field.
98
99     unsupported-filter_flags-1.lzma has unsupported Filter ID 0x7F.
100
101     unsupported-filter_flags-2.lzma specifies only Delta filter in the
102     List of Filter Flags, but Delta isn't allowed as the last filter in
103     the chain. It could be a little more correct to detect this file as
104     corrupt instead of unsupported, but saying it is unsupported is
105     simpler in case of liblzma.
106
107     unsupported-filter_flags-3.lzma specifies two LZMA2 filters in the
108     List of Filter Flags. LZMA2 is allowed only as the last filter in the
109     chain. It could be a little more correct to detect this file as
110     corrupt instead of unsupported, but saying it is unsupported is
111     simpler in case of liblzma.
112
113
114 2.3. Bad Files
115
116     bad-0pad-empty.lzma has one Stream with no Blocks followed by
117     five-byte Stream Padding. Stream Padding must be a multiple of four
118     bytes, thus this file is corrupt.
119
120     bad-0catpad-empty.lzma has two zero-Block Streams concatenated with
121     five-byte Stream Padding between the Streams.
122
123     bad-0cat-alone.lzma is good-0-empty.lzma concatenated with an empty
124     LZMA_Alone file.
125
126     bad-0cat-header_magic.lzma is good-0cat-empty.lzma but with one byte
127     wrong in the Header Magic Bytes field of the second Stream. liblzma
128     gives LZMA_DATA_ERROR for this. (LZMA_FORMAT_ERROR is used only if
129     the first Stream of a file has invalid Header Magic Bytes.)
130
131     bad-0-header_magic.lzma is good-0-empty.lzma but with one byte wrong
132     in the Header Magic Bytes field. liblzma gives LZMA_FORMAT_ERROR for
133     this.
134
135     bad-0-footer_magic.lzma is good-0-empty.lzma but with one byte wrong
136     in the Footer Magic Bytes field. liblzma gives LZMA_DATA_ERROR for
137     this.
138
139     bad-0-empty-truncated.lzma is good-0-empty.lzma without the last byte
140     of the file.
141
142     bad-0-nonempty_index.lzma has no Blocks but Index claims that there is
143     one Block.
144
145     bad-0-backward_size.lzma has wrong Backward Size in Stream Footer.
146
147     bad-1-stream_flags-1.lzma has different Stream Flags in Stream Header
148     and Stream Footer.
149
150     bad-1-stream_flags-2.lzma has wrong CRC32 in Stream Header.
151
152     bad-1-stream_flags-3.lzma has wrong CRC32 in Stream Footer.
153
154     bad-1-vli-1.lzma has two-byte variable-length integer in the
155     Uncompressed Size field in Block Header while one-byte would be enough
156     for that value. It's important that the file gets rejected due to too
157     big integer encoding instead of due to Uncompressed Size not matching
158     the value stored in the Block Header. That is, the decoder must not
159     try to decode the Compressed Data field.
160
161     bad-1-vli-2.lzma has ten-byte variable-length integer as Uncompressed
162     Size in Block Header. It's important that the file gets rejected due
163     to too big integer encoding instead of due to Uncompressed Size not
164     matching the value stored in the Block Header. That is, the decoder
165     must not try to decode the Compressed Data field.
166
167     bad-1-block_header-1.lzma has Block Header that ends in the middle of
168     the Filter Flags field.
169
170     bad-1-block_header-2.lzma has Block Header that has Compressed Size and
171     Uncompressed Size but no List of Filter Flags field.
172
173     bad-1-block_header-3.lzma has wrong CRC32 in Block Header.
174
175     bad-1-block_header-4.lzma has too big Compressed Size (2^63 bytes while
176     maximum is 2^63 - 4 bytes) in Block Header. It's important that the
177     file gets rejected due to invalid Compressed Size value; the decoder
178     must not try decoding the Compressed Data field.
179
180     bad-2-index-1.lzma has wrong Total Sizes in Index.
181
182     bad-2-index-2.lzma has wrong Uncompressed Sizes in Index.
183
184     bad-2-index-3.lzma has non-nul byte in Index Padding.
185
186     bad-2-index-4.lzma wrong CRC32 in Index.
187
188     bad-2-compressed_data_padding.lzma has non-nul byte in the padding of
189     the Compressed Data field of the first Block.
190
191     bad-1-check-crc32.lzma has wrong Check (CRC32).
192
193     bad-1-check-crc64.lzma has wrong Check (CRC64).
194
195     bad-1-check-sha256.lzma has wrong Check (SHA-256).
196
197     bad-1-lzma2-1.lzma has LZMA2 stream whose first chunk (uncompressed)
198     doesn't reset the dictionary.
199
200     bad-1-lzma2-2.lzma has two LZMA2 chunks, of which the second chunk
201     indicates dictionary reset, but the LZMA compressed data tries to
202     repeat data from the previous chunk.
203
204     bad-1-lzma2-3.lzma sets new invalid properties (lc=8, lp=0, pb=0) in
205     the middle of Block.
206
207     bad-1-lzma2-4.lzma has two LZMA2 chunks, of which the first is
208     uncompressed and the second is LZMA. The first chunk resets dictionary
209     as it should, but the second chunk tries to reset state without
210     specifying properties for LZMA.
211
212     bad-1-lzma2-5.lzma is like bad-1-lzma2-4.lzma but doesn't try to reset
213     anything in the header of the second chunk.
214
215     bad-1-lzma2-6.lzma has reserved LZMA2 control byte value (0x03).
216
217     bad-1-lzma2-7.lzma has EOPM at LZMA level.
218