Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2018-01-24 21:29:16 +0300
committerMarek Safar <marek.safar@gmail.com>2018-01-25 12:36:26 +0300
commit51951358252899ad8efd25bbefad8579d7e258b6 (patch)
treeceafe0c2ce2a08425d11f30d865f79102777bc27 /mcs
parent693a7c896d9490d4590986d155e64acb929d8764 (diff)
[System.IO.Compression.FileSystem] Improve ZipCreateFromEntryChangeTimestamp test
`entry.LastWriteTime` is an unspecified/local DateTime but we're comparing it against `date` which is in UTC. This could lead to issues where the Day isn't matching when running the test around midnight. Examples: https://github.com/xamarin/maccore/issues/597 https://jenkins.mono-project.com/job/xamarin-android-pr-builder/2387/testReport/Xamarin.Android.Bcl_Tests,%20MonoTests.System.IO.Compression.FileSystem/ZipArchiveTests/ZipCreateFromEntryChangeTimestamp___Debug/
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.IO.Compression.FileSystem/Test/System.IO.Compression.FileSystem/ZipTest.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/mcs/class/System.IO.Compression.FileSystem/Test/System.IO.Compression.FileSystem/ZipTest.cs b/mcs/class/System.IO.Compression.FileSystem/Test/System.IO.Compression.FileSystem/ZipTest.cs
index 5b6f786ee3c..ea6c65d4c77 100644
--- a/mcs/class/System.IO.Compression.FileSystem/Test/System.IO.Compression.FileSystem/ZipTest.cs
+++ b/mcs/class/System.IO.Compression.FileSystem/Test/System.IO.Compression.FileSystem/ZipTest.cs
@@ -134,9 +134,10 @@ namespace MonoTests.System.IO.Compression.FileSystem
{
var entry = archive.GetEntry (file);
Assert.IsNotNull (entry);
- Assert.AreEqual(entry.LastWriteTime.Year, date.Year);
- Assert.AreEqual(entry.LastWriteTime.Month, date.Month);
- Assert.AreEqual(entry.LastWriteTime.Day, date.Day);
+ var lastWriteTimeUtc = entry.LastWriteTime.ToUniversalTime ();
+ Assert.AreEqual (date.Year, lastWriteTimeUtc.Year);
+ Assert.AreEqual (date.Month, lastWriteTimeUtc.Month);
+ Assert.AreEqual (date.Day, lastWriteTimeUtc.Day);
}
}
}