diff --git a/SWCompression.xcodeproj/project.pbxproj b/SWCompression.xcodeproj/project.pbxproj index 0c6ef1bb..24cfb1c8 100644 --- a/SWCompression.xcodeproj/project.pbxproj +++ b/SWCompression.xcodeproj/project.pbxproj @@ -213,6 +213,8 @@ 06F066771FFB763400312A82 /* test8.bz2 in Resources */ = {isa = PBXBuildFile; fileRef = 06F066111FFB763300312A82 /* test8.bz2 */; }; 06F276DF1F2BAB4A00E67335 /* 7zEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06F276DE1F2BAB4900E67335 /* 7zEntry.swift */; }; 06FEAD921F54B9CD00AD016E /* EncodingTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06FEAD911F54B9CD00AD016E /* EncodingTree.swift */; }; + E652D8F3263D670900FC229B /* test_nonstandard_runlength.bz2 in Resources */ = {isa = PBXBuildFile; fileRef = E652D8F2263D670900FC229B /* test_nonstandard_runlength.bz2 */; }; + E652D8F5263D678000FC229B /* test_nonstandard_runlength.answer in Resources */ = {isa = PBXBuildFile; fileRef = E652D8F4263D678000FC229B /* test_nonstandard_runlength.answer */; }; E66F36242538726E00076A6E /* test_empty.lzma in Resources */ = {isa = PBXBuildFile; fileRef = E66F36232538726E00076A6E /* test_empty.lzma */; }; E66F362C2538E2B700076A6E /* test_empty.zlib in Resources */ = {isa = PBXBuildFile; fileRef = E66F362B2538E2B700076A6E /* test_empty.zlib */; }; /* End PBXBuildFile section */ @@ -435,6 +437,8 @@ 06F276DE1F2BAB4900E67335 /* 7zEntry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 7zEntry.swift; sourceTree = ""; }; 06FEAD911F54B9CD00AD016E /* EncodingTree.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EncodingTree.swift; path = Sources/Common/CodingTree/EncodingTree.swift; sourceTree = SOURCE_ROOT; }; 06FED40B1DD7717E0013DFB2 /* BZip2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BZip2.swift; sourceTree = ""; }; + E652D8F2263D670900FC229B /* test_nonstandard_runlength.bz2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_nonstandard_runlength.bz2; sourceTree = ""; }; + E652D8F4263D678000FC229B /* test_nonstandard_runlength.answer */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_nonstandard_runlength.answer; sourceTree = ""; }; E66F36232538726E00076A6E /* test_empty.lzma */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_empty.lzma; sourceTree = ""; }; E66F362B2538E2B700076A6E /* test_empty.zlib */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_empty.zlib; sourceTree = ""; }; /* End PBXFileReference section */ @@ -723,6 +727,7 @@ 06F065B31FFB763300312A82 /* test7.answer */, 06F065B51FFB763300312A82 /* test8.answer */, 06F065B11FFB763300312A82 /* test9.answer */, + E652D8F4263D678000FC229B /* test_nonstandard_runlength.answer */, ); path = Answers; sourceTree = ""; @@ -886,6 +891,7 @@ 06F0660C1FFB763300312A82 /* test7.bz2 */, 06F066111FFB763300312A82 /* test8.bz2 */, 06F066101FFB763300312A82 /* test9.bz2 */, + E652D8F2263D670900FC229B /* test_nonstandard_runlength.bz2 */, ); path = BZip2; sourceTree = ""; @@ -980,6 +986,7 @@ 06F066661FFB763400312A82 /* test3.7z in Resources */, 06F0664B1FFB763400312A82 /* test.tar in Resources */, 06F066501FFB763400312A82 /* test_gnu.tar in Resources */, + E652D8F5263D678000FC229B /* test_nonstandard_runlength.answer in Resources */, 06F066341FFB763400312A82 /* test1.xz in Resources */, 06F0665F1FFB763400312A82 /* test_multi_blocks.7z in Resources */, 068D070421368617002A6C3B /* test_delta_filter.7z in Resources */, @@ -1051,6 +1058,7 @@ 0698B10F2106344200A7C551 /* test_negative_mtime.tar in Resources */, 06F066561FFB763400312A82 /* SWCompressionSourceCode.tar in Resources */, 069864CA21403CE700755D9B /* test_sha256.xz in Resources */, + E652D8F3263D670900FC229B /* test_nonstandard_runlength.bz2 in Resources */, 06F0663D1FFB763400312A82 /* test2.xz in Resources */, 06F066351FFB763400312A82 /* test5.xz in Resources */, 06F066631FFB763400312A82 /* test_complicated_coding_scheme.7z in Resources */, diff --git a/Tests/BZip2Tests.swift b/Tests/BZip2Tests.swift index a93f6fe3..8fbf2594 100644 --- a/Tests/BZip2Tests.swift +++ b/Tests/BZip2Tests.swift @@ -54,6 +54,10 @@ class BZip2Tests: XCTestCase { try self.perform(test: "test9") } + func testNonStandardRunLength() throws { + try self.perform(test: "test_nonstandard_runlength") + } + func testBadFile_short() { XCTAssertThrowsError(try BZip2.decompress(data: Data([0]))) } diff --git a/Tests/Test Files b/Tests/Test Files index 073da4e0..25a663fd 160000 --- a/Tests/Test Files +++ b/Tests/Test Files @@ -1 +1 @@ -Subproject commit 073da4e01c87d9c1e599e507d1bb21e307c564ad +Subproject commit 25a663fdbeafc4047a6701c830cb7c16af0680a6