mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-11-15 17:02:03 +00:00
Remove openentrystream checks
This commit is contained in:
@@ -102,11 +102,7 @@ public class SevenZipDeflateSolidTests : TestBase
|
||||
continue;
|
||||
}
|
||||
|
||||
#if LEGACY_DOTNET
|
||||
using var stream = await reader.OpenEntryStreamAsync(CancellationToken.None);
|
||||
#else
|
||||
await using var stream = await reader.OpenEntryStreamAsync(CancellationToken.None);
|
||||
#endif
|
||||
if (index == 0 && firstEntryMode == 1)
|
||||
{
|
||||
Assert.True(
|
||||
|
||||
@@ -363,11 +363,7 @@ public class Zip64DescriptorSizeTests
|
||||
);
|
||||
Assert.True(await reader.MoveToNextEntryAsync(CancellationToken.None));
|
||||
var first = reader.Entry;
|
||||
#if LEGACY_DOTNET
|
||||
using (var stream = await reader.OpenEntryStreamAsync(CancellationToken.None))
|
||||
#else
|
||||
await using (var stream = await reader.OpenEntryStreamAsync(CancellationToken.None))
|
||||
#endif
|
||||
{
|
||||
await stream.CopyToAsync(Stream.Null, 81920, CancellationToken.None);
|
||||
}
|
||||
@@ -378,11 +374,7 @@ public class Zip64DescriptorSizeTests
|
||||
}
|
||||
Assert.Equal("second", reader.Entry.Key);
|
||||
using var second = new MemoryStream();
|
||||
#if LEGACY_DOTNET
|
||||
using (var stream = await reader.OpenEntryStreamAsync(CancellationToken.None))
|
||||
#else
|
||||
await using (var stream = await reader.OpenEntryStreamAsync(CancellationToken.None))
|
||||
#endif
|
||||
{
|
||||
await stream.CopyToAsync(second, 81920, CancellationToken.None);
|
||||
}
|
||||
|
||||
@@ -143,11 +143,7 @@ public class Zip64NonSeekableTests
|
||||
continue;
|
||||
}
|
||||
Assert.Equal(entries[index].Name, reader.Entry.Key);
|
||||
#if LEGACY_DOTNET
|
||||
using var source = await reader.OpenEntryStreamAsync(CancellationToken.None);
|
||||
#else
|
||||
await using var source = await reader.OpenEntryStreamAsync(CancellationToken.None);
|
||||
#endif
|
||||
using var extracted = new MemoryStream();
|
||||
await source.CopyToAsync(extracted, 81920, CancellationToken.None);
|
||||
Assert.Equal(entries[index++].Content, extracted.ToArray());
|
||||
|
||||
@@ -77,11 +77,7 @@ public class ZipBZip2CorruptionTests : TestBase
|
||||
{
|
||||
while (await reader.MoveToNextEntryAsync(CancellationToken.None))
|
||||
{
|
||||
#if LEGACY_DOTNET
|
||||
using var entry = await reader.OpenEntryStreamAsync(CancellationToken.None);
|
||||
#else
|
||||
await using var entry = await reader.OpenEntryStreamAsync(CancellationToken.None);
|
||||
#endif
|
||||
if (!skipEntry)
|
||||
{
|
||||
await entry.CopyToAsync(Stream.Null, 81920, CancellationToken.None);
|
||||
|
||||
Reference in New Issue
Block a user