One more label renaming.

This commit is contained in:
Timofey Solomko
2017-05-31 15:00:58 +03:00
parent f7cac81ef8
commit f45348c568
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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)
}
+4 -4
View File
@@ -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)