Lines Matching +full:test_compat_zip_6 +full:. +full:zip

3  * All rights reserved.
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
12 * documentation and/or other materials provided with the distribution.
16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 #include "test.h"
26 __FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/test/test_compat_zip.c 358088 2020-02-19 01:50:47Z mm $");
28 /* Copy this function for each test file and adjust it accordingly. */
31 char name[] = "test_compat_zip_1.zip";
42 /* Read first entry. */
44 assertEqualString("META-INF/MANIFEST.MF", archive_entry_pathname(ae));
46 /* Read second entry. */
49 skipping("Skipping ZIP compression check: %s",
54 assertEqualString("tmp.class", archive_entry_pathname(ae));
67 * Verify that we skip junk between entries. The compat_zip_2.zip file
68 * has several bytes of junk between 'file1' and 'file2'. Such
69 * junk is routinely introduced by some Zip writers when they manipulate
70 * existing zip archives.
74 char name[] = "test_compat_zip_2.zip";
84 /* Read first entry. */
88 /* Read first entry. */
99 * broke extraction of Zip entries with length-at-end.
103 const char *refname = "test_compat_zip_3.zip";
113 /* First entry. */
115 assertEqualString("soapui-4.0.0/", archive_entry_pathname(ae));
120 /* Second entry. */
122 assertEqualString("soapui-4.0.0/soapui-settings.xml", archive_entry_pathname(ae));
127 /* Extract under a different name. */
128 archive_entry_set_pathname(ae, "test_3.txt");
133 /* Verify the first 12 bytes actually got written to disk correctly. */
134 p = slurpfile(&s, "test_3.txt");
139 skipping("Skipping ZIP compression check, no libz support");
148 * A file with leading garbage (similar to an SFX file).
152 const char *refname = "test_compat_zip_4.zip";
161 /* SFX files require seek support. */
167 /* First entry. */
175 /* Second entry. */
183 /* Third entry. */
194 /* Try reading without seek support and watch it fail. */
205 * believe in populating local file headers at all. This
206 * is only readable with the seeking reader.
210 const char *refname = "test_compat_zip_5.zip";
219 /* Verify with seek support.
220 * Everything works correctly here. */
227 assertEqualString("Metadata/Job_PT.xml", archive_entry_pathname(ae));
233 assertEqualString("Metadata/MXDC_Empty_PT.xml", archive_entry_pathname(ae));
239 assertEqualString("Documents/1/Metadata/Page1_Thumbnail.JPG", archive_entry_pathname(ae));
243 /* TODO: Read some of the file data and verify it.
244 The code to read uncompressed Zip entries with "file at end" semantics
245 is tricky and should be verified more carefully. */
248 assertEqualString("Documents/1/Pages/_rels/1.fpage.rels", archive_entry_pathname(ae));
251 assertEqualString("Documents/1/Pages/1.fpage", archive_entry_pathname(ae));
254 assertEqualString("Documents/1/Resources/Fonts/3DFDBC8B-4514-41F1-A808-DEA1C79BAC2B.odttf", archive_entry_pathname(ae));
257 assertEqualString("Documents/1/_rels/FixedDocument.fdoc.rels", archive_entry_pathname(ae));
260 assertEqualString("Documents/1/FixedDocument.fdoc", archive_entry_pathname(ae));
263 assertEqualString("_rels/FixedDocumentSequence.fdseq.rels", archive_entry_pathname(ae));
266 assertEqualString("FixedDocumentSequence.fdseq", archive_entry_pathname(ae));
269 assertEqualString("_rels/.rels", archive_entry_pathname(ae));
272 assertEqualString("[Content_Types].xml", archive_entry_pathname(ae));
279 /* Try reading without seek support. */
286 assertEqualString("Metadata/Job_PT.xml", archive_entry_pathname(ae));
293 assertEqualString("Metadata/MXDC_Empty_PT.xml", archive_entry_pathname(ae));
300 assertEqualString("Documents/1/Metadata/Page1_Thumbnail.JPG", archive_entry_pathname(ae));
307 assertEqualString("Documents/1/Pages/_rels/1.fpage.rels", archive_entry_pathname(ae));
310 assertEqualString("Documents/1/Pages/1.fpage", archive_entry_pathname(ae));
313 assertEqualString("Documents/1/Resources/Fonts/3DFDBC8B-4514-41F1-A808-DEA1C79BAC2B.odttf", archive_entry_pathname(ae));
316 assertEqualString("Documents/1/_rels/FixedDocument.fdoc.rels", archive_entry_pathname(ae));
319 assertEqualString("Documents/1/FixedDocument.fdoc", archive_entry_pathname(ae));
322 assertEqualString("_rels/FixedDocumentSequence.fdseq.rels", archive_entry_pathname(ae));
325 assertEqualString("FixedDocumentSequence.fdseq", archive_entry_pathname(ae));
328 assertEqualString("_rels/.rels", archive_entry_pathname(ae));
331 assertEqualString("[Content_Types].xml", archive_entry_pathname(ae));
341 * Issue 225: Errors extracting MSDOS Zip archives with directories.
351 /* Zip timestamps are local time, so vary by time zone. */
353 verify that it's within +/- 24 hours of a particular value. */
357 assertEqualString("New Folder/New Folder/New Text Document.txt", archive_entry_pathname(ae));
359 /* Zip timestamps are local time, so vary by time zone. */
365 DEFINE_TEST(test_compat_zip_6)
367 const char *refname = "test_compat_zip_6.zip";
393 * length-at-end marker ends exactly on a block boundary.
397 const char *refname = "test_compat_zip_7.xps";
427 * A file with backslash path separators instead of slashes.
428 * PowerShell's Compress-Archive cmdlet produces such archives.
432 const char *refname = "test_compat_zip_8.zip";