Skip to content

Commit 99170e1

Browse files
authored
PR #587: Remove supported method checks from ZipEntry.CompressionMethod setter
1 parent fa08c7d commit 99170e1

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/ICSharpCode.SharpZipLib/Zip/ZipEntry.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,17 +724,13 @@ public long Crc
724724
/// <summary>
725725
/// Gets/Sets the compression method.
726726
/// </summary>
727-
/// <remarks>Throws exception when set if the method is not valid as per <see cref="IsCompressionMethodSupported()"/></remarks>
728-
/// <exception cref="NotSupportedException"/>
729727
/// <returns>
730728
/// The compression method for this entry
731729
/// </returns>
732730
public CompressionMethod CompressionMethod
733731
{
734732
get => method;
735-
set => method = !IsCompressionMethodSupported(value)
736-
? throw new NotSupportedException("Compression method not supported")
737-
: value;
733+
set => method = value;
738734
}
739735

740736
/// <summary>

test/ICSharpCode.SharpZipLib.Tests/Zip/GeneralHandling.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,6 @@ private string DescribeAttributes(FieldAttributes attributes)
133133
return att;
134134
}
135135

136-
[Test]
137-
[Category("Zip")]
138-
//[ExpectedException(typeof(NotSupportedException))]
139-
public void UnsupportedCompressionMethod()
140-
{
141-
var ze = new ZipEntry("HumblePie");
142-
//ze.CompressionMethod = CompressionMethod.BZip2;
143-
144-
Assert.That(() => ze.CompressionMethod = CompressionMethod.Deflate64,
145-
Throws.TypeOf<NotSupportedException>());
146-
}
147-
148136
/// <summary>
149137
/// Invalid passwords should be detected early if possible, seekable stream
150138
/// Note: Have a 1/255 chance of failing due to CRC collision (hence retried once)

0 commit comments

Comments
 (0)