Updating to minizip-ng 4.0.7 (#724)

* Updating to minizip-ng 4.0.7

* Adding HAVE_ICONV
This commit is contained in:
Cœur
2024-10-28 18:08:25 +01:00
committed by GitHub
parent df35718ea1
commit 4ce93ff4ff
39 changed files with 797 additions and 712 deletions
@@ -17,7 +17,8 @@
@interface ProgressDelegate : NSObject <SSZipArchiveDelegate>
{
@public
NSMutableArray *progressEvents;
NSMutableArray<NSValue*> *fileInfos;
NSMutableArray<NSNumber*> *progressEvents;
}
@end
@@ -12,6 +12,7 @@
- (instancetype)init
{
self = super.init;
fileInfos = [NSMutableArray array];
progressEvents = [NSMutableArray array];
return self;
}
@@ -27,6 +28,7 @@
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo
{
NSLog(@"*** zipArchiveShouldUnzipFileAtIndex: `%d` totalFiles: `%d` archivePath: `%@` fileInfo:", (int)fileIndex, (int)totalFiles, archivePath);
[fileInfos addObject:[NSValue value:&fileInfo withObjCType:@encode(unz_file_info)]];
return YES;
}
@@ -221,6 +221,14 @@ int twentyMB = 20 * 1024 * 1024;
XCTAssertTrue(619 == [delegate->progressEvents[1] intValue]);
XCTAssertTrue(1114 == [delegate->progressEvents[2] intValue]);
XCTAssertTrue(1436 == [delegate->progressEvents[3] intValue]);
XCTAssertTrue(2 == [delegate->fileInfos count], @"Expected 2 files");
unz_file_info info;
[delegate->fileInfos[0] getValue:&info];
// This test is to ensure that ZipArchive 2.x keeps support of `dos_date` instead of `dosDate`, despite the legacy name at:
// https://github.com/madler/zlib/blame/643e17b7498d12ab8d15565662880579692f769d/contrib/minizip/unzip.h#L138
// In ZipArchive 3, we should hide this outdated structure from public.
XCTAssertNotEqual(info.dos_date, 0);
}