From 7989ab2e281cc760c712e5b4ce26f748583b1fcd Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Wed, 14 May 2025 11:18:41 +0200 Subject: [PATCH] modify now-broken test This test tested that skipping over entries using the reader interface for an encrypted multi-volume rar archive worked. However reading those entries doesn't work and the skipping was also not working properly so I believe it's fine to "break" this functionality. --- .../SharpCompress.Test/Rar/RarReaderTests.cs | 45 +++++-------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/tests/SharpCompress.Test/Rar/RarReaderTests.cs b/tests/SharpCompress.Test/Rar/RarReaderTests.cs index 101dd6a9..84f0ada7 100644 --- a/tests/SharpCompress.Test/Rar/RarReaderTests.cs +++ b/tests/SharpCompress.Test/Rar/RarReaderTests.cs @@ -330,43 +330,18 @@ public class RarReaderTests : ReaderTests } [Fact] - public void Rar_NullReference() + public void Rar_SkipEncryptedFilesWithoutPassword() { + using var stream = File.OpenRead( + Path.Combine(TEST_ARCHIVES_PATH, "Rar.encrypted_filesOnly.rar") + ); + using var reader = ReaderFactory.Open( + stream, + new ReaderOptions { LookForHeader = true } + ); + while (reader.MoveToNextEntry()) { - var archives = new[] - { - "Rar.EncryptedParts.part01.rar", - "Rar.EncryptedParts.part02.rar", - "Rar.EncryptedParts.part03.rar", - "Rar.EncryptedParts.part04.rar", - "Rar.EncryptedParts.part05.rar", - "Rar.EncryptedParts.part06.rar", - }; - - using var reader = RarReader.Open( - archives - .Select(s => Path.Combine(TEST_ARCHIVES_PATH, s)) - .Select(p => File.OpenRead(p)), - new ReaderOptions { Password = "test" } - ); - while (reader.MoveToNextEntry()) - { - // - } - } - - { - using var stream = File.OpenRead( - Path.Combine(TEST_ARCHIVES_PATH, "Rar.encrypted_filesOnly.rar") - ); - using var reader = ReaderFactory.Open( - stream, - new ReaderOptions { LookForHeader = true } - ); - while (reader.MoveToNextEntry()) - { - // - } + // } }