Imported Upstream version 5.20.0.180

Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-02-04 20:11:37 +00:00
parent 0e2d47d1c8
commit 0510252385
3360 changed files with 83827 additions and 39243 deletions

View File

@@ -6,7 +6,14 @@ LIBRARY = System.IO.Compression.FileSystem.dll
LIB_REFS = System System.IO.Compression
KEYFILE = ../ecma.pub
LIB_MCS_FLAGS = -unsafe -nowarn:436
TEST_MCS_FLAGS =
TEST_RESOURCE_FILES = \
Test/resources/foo/foo.txt \
Test/resources/foo/bar.txt \
Test/resources/foo/foobar/foo.txt \
Test/resources/foo/foobar/bar.txt
TEST_MCS_FLAGS = $(foreach r, $(TEST_RESOURCE_FILES), -resource:$(r),$(r))
TEST_LIB_REFS = System System.Core System.IO.Compression
LIBRARY_WARN_AS_ERROR = yes

View File

@@ -1 +1,2 @@
../../test-helpers/TestResourceHelper.cs
System.IO.Compression.FileSystem/ZipTest.cs

View File

@@ -31,6 +31,8 @@ using System.Linq;
using System.Security.Cryptography;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.IO.Compression.FileSystem
{
[TestFixture]
@@ -55,7 +57,7 @@ namespace MonoTests.System.IO.Compression.FileSystem
if (File.Exists (tmpFile))
File.Delete (tmpFile);
ZipFile.CreateFromDirectory ("foo", tmpFile);
ZipFile.CreateFromDirectory (TestResourceHelper.GetFullPathOfResource ("Test/resources/foo"), tmpFile);
Assert.IsTrue(File.Exists(tmpFile));
using (var archive = new ZipArchive (File.Open (tmpFile, FileMode.Open),
@@ -75,7 +77,7 @@ namespace MonoTests.System.IO.Compression.FileSystem
if (File.Exists (tmpFile))
File.Delete (tmpFile);
ZipFile.CreateFromDirectory ("foo", tmpFile, CompressionLevel.Fastest,
ZipFile.CreateFromDirectory (TestResourceHelper.GetFullPathOfResource ("Test/resources/foo"), tmpFile, CompressionLevel.Fastest,
includeBaseDirectory: true);
Assert.IsTrue (File.Exists (tmpFile));
@@ -100,7 +102,7 @@ namespace MonoTests.System.IO.Compression.FileSystem
if (File.Exists (tmpFile))
File.Delete (tmpFile);
ZipFile.CreateFromDirectory ("foo", tmpFile);
ZipFile.CreateFromDirectory (TestResourceHelper.GetFullPathOfResource ("Test/resources/foo"), tmpFile);
ZipFile.ExtractToDirectory (tmpFile, extractDir);
Assert.IsTrue(Directory.Exists (extractDir));
@@ -120,7 +122,7 @@ namespace MonoTests.System.IO.Compression.FileSystem
if (File.Exists (tmpFile))
File.Delete (tmpFile);
var file = "foo/foo.txt";
var file = TestResourceHelper.GetFullPathOfResource ("Test/resources/foo/foo.txt");
using (var archive = new ZipArchive(File.Open(tmpFile, FileMode.Create),
ZipArchiveMode.Update))
{