mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
One more label renaming.
This commit is contained in:
@@ -95,8 +95,8 @@ public struct GzipHeader {
|
||||
- Throws: `GzipError`. It may indicate that either the data is damaged or
|
||||
it might not be compressed with gzip at all.
|
||||
*/
|
||||
public init(archiveData: Data) throws {
|
||||
let pointerData = DataWithPointer(data: archiveData, bitOrder: .reversed)
|
||||
public init(archive data: Data) throws {
|
||||
let pointerData = DataWithPointer(data: data, bitOrder: .reversed)
|
||||
try self.init(pointerData)
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class GzipTests: XCTestCase {
|
||||
}
|
||||
|
||||
// Test GZip header parsing
|
||||
guard let testGzipHeader = try? GzipHeader(archiveData: testData) else {
|
||||
guard let testGzipHeader = try? GzipHeader(archive: testData) else {
|
||||
XCTFail("Unable to get archive header.")
|
||||
return
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class GzipTests: XCTestCase {
|
||||
XCTAssertEqual(testGzipHeader.modificationTime, Date(timeIntervalSince1970: TimeInterval(mtime)),
|
||||
"Incorrect mtime.")
|
||||
XCTAssertEqual(testGzipHeader.osType, .unix, "Incorrect OS type.")
|
||||
XCTAssertEqual(testGzipHeader.originalFileName, "\(testName).answer", "Incorrect original file name.")
|
||||
XCTAssertEqual(testGzipHeader.fileName, "\(testName).answer", "Incorrect original file name.")
|
||||
XCTAssertEqual(testGzipHeader.comment, nil, "Incorrect comment.")
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class GzipTests: XCTestCase {
|
||||
}
|
||||
|
||||
// Test output GZip header.
|
||||
guard let testGzipHeader = try? GzipHeader(archiveData: archiveData) else {
|
||||
guard let testGzipHeader = try? GzipHeader(archive: archiveData) else {
|
||||
XCTFail("Unable to get archive header.")
|
||||
return
|
||||
}
|
||||
@@ -114,7 +114,7 @@ class GzipTests: XCTestCase {
|
||||
XCTAssertEqual(testGzipHeader.compressionMethod, .deflate, "Incorrect compression method.")
|
||||
XCTAssertEqual(testGzipHeader.modificationTime?.timeIntervalSince1970, mtime, "Incorrect mtime.")
|
||||
XCTAssertEqual(testGzipHeader.osType, .macintosh, "Incorrect OS type.")
|
||||
XCTAssertEqual(testGzipHeader.originalFileName, "\(testName).answer", "Incorrect original file name.")
|
||||
XCTAssertEqual(testGzipHeader.fileName, "\(testName).answer", "Incorrect original file name.")
|
||||
XCTAssertEqual(testGzipHeader.comment, "some file comment", "Incorrect comment.")
|
||||
XCTAssertTrue(testGzipHeader.isTextFile)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user