Files
sharpcompress/tests/SharpCompress.Test/GZip/GZipReaderTests.cs

29 lines
832 B
C#
Raw Permalink Normal View History

2022-12-20 15:06:44 +00:00
using System.IO;
2021-01-13 10:42:59 +00:00
using SharpCompress.Common;
2021-01-13 14:40:36 +00:00
using SharpCompress.IO;
2024-03-14 08:37:17 +00:00
using SharpCompress.Readers.GZip;
2021-01-13 10:42:59 +00:00
using Xunit;
2022-12-20 15:06:44 +00:00
namespace SharpCompress.Test.GZip;
public class GZipReaderTests : ReaderTests
2021-01-13 10:42:59 +00:00
{
2022-12-20 15:20:49 +00:00
public GZipReaderTests() => UseExtensionInsteadOfNameToVerify = true;
2021-01-13 10:42:59 +00:00
2022-12-20 15:06:44 +00:00
[Fact]
2022-12-20 15:20:49 +00:00
public void GZip_Reader_Generic() => Read("Tar.tar.gz", CompressionType.GZip);
2022-12-20 15:06:44 +00:00
[Fact]
public void GZip_Reader_Generic2()
{
//read only as GZip itme
using Stream stream = File.OpenRead(Path.Combine(TEST_ARCHIVES_PATH, "Tar.tar.gz"));
using var reader = GZipReader.OpenReader(SharpCompressStream.CreateNonDisposing(stream));
2022-12-20 15:06:44 +00:00
while (reader.MoveToNextEntry()) // Crash here
2021-01-13 10:42:59 +00:00
{
2022-12-20 15:06:44 +00:00
Assert.NotEqual(0, reader.Entry.Size);
Assert.NotEqual(0, reader.Entry.Crc);
2021-01-13 10:42:59 +00:00
}
}
}