From b8e3d0c45b62c81dfc6b350556d77cf2c7401edd Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 14 Jul 2022 19:37:42 +0300 Subject: [PATCH] Tests: Add .lzma test files. --- tests/files/README | 63 ++++++++++++++---- tests/files/bad-too_big_size-with_eopm.lzma | Bin 0 -> 37 bytes .../bad-too_small_size-without_eopm-1.lzma | Bin 0 -> 31 bytes .../bad-too_small_size-without_eopm-2.lzma | Bin 0 -> 31 bytes .../bad-too_small_size-without_eopm-3.lzma | Bin 0 -> 36 bytes .../files/bad-unknown_size-without_eopm.lzma | Bin 0 -> 31 bytes tests/files/good-known_size-with_eopm.lzma | Bin 0 -> 37 bytes tests/files/good-known_size-without_eopm.lzma | Bin 0 -> 31 bytes tests/files/good-unknown_size-with_eopm.lzma | Bin 0 -> 37 bytes 9 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 tests/files/bad-too_big_size-with_eopm.lzma create mode 100644 tests/files/bad-too_small_size-without_eopm-1.lzma create mode 100644 tests/files/bad-too_small_size-without_eopm-2.lzma create mode 100644 tests/files/bad-too_small_size-without_eopm-3.lzma create mode 100644 tests/files/bad-unknown_size-without_eopm.lzma create mode 100644 tests/files/good-known_size-with_eopm.lzma create mode 100644 tests/files/good-known_size-without_eopm.lzma create mode 100644 tests/files/good-unknown_size-with_eopm.lzma diff --git a/tests/files/README b/tests/files/README index 59b54e42..ba05aba5 100644 --- a/tests/files/README +++ b/tests/files/README @@ -1,31 +1,31 @@ -.xz Test Files ----------------- +.xz and .lzma Test Files +------------------------ 0. Introduction - This directory contains bunch of files to test handling of .xz files - in .xz decoder implementations. Many of the files have been created - by hand with a hex editor, thus there is no better "source code" than - the files themselves. All the test files (*.xz) and this README have - been put into the public domain. + This directory contains bunch of files to test handling of .xz + and .lzma files in decoder implementations. Many of the files have + been created by hand with a hex editor, thus there is no better + "source code" than the files themselves. All the test files and + this README have been put into the public domain. 1. File Types - Good files (good-*.xz) must decode successfully without requiring - a lot of CPU time or RAM. + Good files (good-*.xz, good-*.lzma) must decode successfully + without requiring a lot of CPU time or RAM. Unsupported files (unsupported-*.xz) are good files, but headers indicate features not supported by the current file format specification. - Bad files (bad-*.xz) must cause the decoder to give an error. Like - with the good files, these files must not require a lot of CPU time - or RAM before they get detected to be broken. + Bad files (bad-*.xz, bad-*.lzma) must cause the decoder to give + an error. Like with the good files, these files must not require + a lot of CPU time or RAM before they get detected to be broken. -2. Descriptions of Individual Files +2. Descriptions of Individual .xz Files 2.1. Good Files @@ -266,3 +266,40 @@ Uncompressed Size bytes of output will have been produced but the LZMA2 decoder doesn't indicate end of stream. + +3. Descriptions of Individual .lzma Files + +3.1. Good Files + + good-unknown_size-with_eopm.lzma has unknown size in the header + and end of payload marker at the end. + + good-known_size-without_eopm.lzma has a known size in the header + and no end of payload marker at the end. + + good-known_size-with_eopm.lzma has a known size in the header + and end of payload marker at the end. XZ Utils 5.2.5 and older + will give an error at the end of the file after producing the + correct uncompressed output. + + +3.2. Bad Files + + bad-unknown_size-without_eopm.lzma has unknown size in the header + but no end of payload marker at the end. This file might be seen + by a decoder as if it were truncated. + + bad-too_big_size-with_eopm.lzma has too big uncompressed size in + the header and the end of payload marker will be detected before + the specified number of bytes have been decoded. + + bad-too_small_size-without_eopm-1.lzma has too small uncompressed + size in the header. The decoder will look for end of payload marker + but instead find a literal that would produce more output. + + bad-too_small_size-without_eopm-2.lzma is like -1 above but instead + of a literal the problem occurs with a short repeated match. + + bad-too_small_size-without_eopm-3.lzma is like -1 above but instead + of a literal the problem occurs in the middle of a match. + diff --git a/tests/files/bad-too_big_size-with_eopm.lzma b/tests/files/bad-too_big_size-with_eopm.lzma new file mode 100644 index 0000000000000000000000000000000000000000..b7cd3b05fcead4afd5d75732ab4ef2ad21dc41a9 GIT binary patch literal 37 ncma!L5MW^7V}Jq`NzWPitfK1byk!*^v@*m+|Nk%j!N33jV+IIi literal 0 HcmV?d00001 diff --git a/tests/files/bad-too_small_size-without_eopm-1.lzma b/tests/files/bad-too_small_size-without_eopm-1.lzma new file mode 100644 index 0000000000000000000000000000000000000000..cc2805cdcde064f79f3376df8940f0fdc9999b26 GIT binary patch literal 31 gcma!L5MW^7VSoY^NzWPitfK1byk!*^G-VYS05n|$pa1{> literal 0 HcmV?d00001 diff --git a/tests/files/bad-too_small_size-without_eopm-2.lzma b/tests/files/bad-too_small_size-without_eopm-2.lzma new file mode 100644 index 0000000000000000000000000000000000000000..e37cab14d6a43ddb6588927c09e9d30d75d136bb GIT binary patch literal 31 gcma!L5MW?nW`F_}NzWPitfK1byk!*^G-VYS05fw0mjD0& literal 0 HcmV?d00001 diff --git a/tests/files/bad-too_small_size-without_eopm-3.lzma b/tests/files/bad-too_small_size-without_eopm-3.lzma new file mode 100644 index 0000000000000000000000000000000000000000..67a1af34570be3920d7e5184ef040efdfa3015e2 GIT binary patch literal 36 mcma!L5MW^7WPkz{NzWPitfGetG}y&2mi{-rGQ-_3fdK$zQ3!GX literal 0 HcmV?d00001 diff --git a/tests/files/bad-unknown_size-without_eopm.lzma b/tests/files/bad-unknown_size-without_eopm.lzma new file mode 100644 index 0000000000000000000000000000000000000000..b3d7a52162dd8102f861159ec434f8e580fc769d GIT binary patch literal 31 hcma!L5MW^V4+RV=lAbg2Sw+>=dCMv;Xv!)u008E342%E( literal 0 HcmV?d00001 diff --git a/tests/files/good-known_size-with_eopm.lzma b/tests/files/good-known_size-with_eopm.lzma new file mode 100644 index 0000000000000000000000000000000000000000..1b45307930a582815373a9aa7ba4eda42cfa5fba GIT binary patch literal 37 ncma!L5MW^7Wq<+|NzWPitfK1byk!*^v@*m+|Nk%j!N33jV&({B literal 0 HcmV?d00001 diff --git a/tests/files/good-known_size-without_eopm.lzma b/tests/files/good-known_size-without_eopm.lzma new file mode 100644 index 0000000000000000000000000000000000000000..83623fde97dbd6e3f939533875e874c1b6a1353d GIT binary patch literal 31 gcma!L5MW^7Wq<+|NzWPitfK1byk!*^G-VYS05o?5p#T5? literal 0 HcmV?d00001 diff --git a/tests/files/good-unknown_size-with_eopm.lzma b/tests/files/good-unknown_size-with_eopm.lzma new file mode 100644 index 0000000000000000000000000000000000000000..0f4ff822e94e7314aba944420b0480a5652db340 GIT binary patch literal 37 ncma!L5MW^V4+RV=lAbg2Sw+>=dCMv;Xl00t{{LV4gMk46L~#&L literal 0 HcmV?d00001