Skip to content

Commit 216ab62

Browse files
author
Simon Ensslen
committed
Add test commend and correct file location for dummy file
(cherry picked from commit a90e117)
1 parent 29ac1d3 commit 216ab62

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/ICSharpCode.SharpZipLib.Tests/Tar/TarTests.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -899,14 +899,19 @@ public void StreamWithJapaneseName(int length, string encodingName)
899899
File.WriteAllBytes(Path.Combine(Path.GetTempPath(), $"jpnametest_{length}_{encodingName}.tar"), memoryStream.ToArray());
900900
}
901901
}
902+
/// <summary>
903+
/// This test could be considered integration test. it creates a tar archive with the root directory specified
904+
/// Then extracts it and compares the two folders. This used to fail on unix due to issues with root folder handling
905+
/// in the tar archive.
906+
/// </summary>
902907
[Test]
903908
[Category("Tar")]
904909
public void rootPathIsRespected()
905910
{
906911
// create dummy folder structure
907912
var tempDirectory = Path.Combine(Path.GetTempPath(), "sharpziplib_tar_test_folder");
908913
CreateAndClearDirectory(tempDirectory);
909-
using (var dummyfile = File.Create("dummyfile"))
914+
using (var dummyfile = File.Create(Path.Combine(tempDirectory, "dummyfile")))
910915
{
911916
using (var randomStream = new ChaosStream())
912917
{
@@ -956,7 +961,7 @@ private void CreateAndClearDirectory(string path)
956961

957962
public class ChaosStream : MemoryStream
958963
{
959-
private readonly int length = new Random().Next() % 5000 + 200;
964+
private readonly int length = new Random().Next() % 500000 + 200;
960965

961966
// Create constructors as needed to match desired MemoryStream construction
962967

0 commit comments

Comments
 (0)