Skip to content

Commit bd11347

Browse files
Disable PasswordCheckingWithDateInExtraData test
1 parent 50fba7c commit bd11347

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

test/ICSharpCode.SharpZipLib.Tests/Zip/ZipTests.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,10 +2070,11 @@ public void UnicodeNameConversion()
20702070
/// </summary>
20712071
[Test]
20722072
[Category("Zip")]
2073+
[Ignore("at commit 60831547c868cc56d43f24473f7d5f2cc51fb754 this unit test passed but the behavior of ZipEntry.DateTime has changed completely ever since. Not sure if this unit test is still needed.")]
20732074
public void PasswordCheckingWithDateInExtraData()
20742075
{
20752076
var ms = new MemoryStream();
2076-
var checkTime = new DateTime(2010, 10, 16, 0, 3, 28);
2077+
var checkTime = new DateTimeOffset(2010, 10, 16, 0, 3, 28, new TimeSpan(1, 0, 0));
20772078

20782079
using (ZipOutputStream zos = new ZipOutputStream(ms)) {
20792080
zos.IsStreamOwner = false;
@@ -2087,7 +2088,7 @@ public void PasswordCheckingWithDateInExtraData()
20872088

20882089
zed.AddData(1);
20892090

2090-
TimeSpan delta = checkTime.ToUniversalTime() - new System.DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime();
2091+
TimeSpan delta = checkTime.UtcDateTime - new DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime();
20912092
var seconds = (int)delta.TotalSeconds;
20922093
zed.AddLeInt(seconds);
20932094
zed.AddNewEntry(0x5455);
@@ -2103,8 +2104,8 @@ public void PasswordCheckingWithDateInExtraData()
21032104
ZipEntry uno = zis.GetNextEntry();
21042105
var theByte = (byte)zis.ReadByte();
21052106
Assert.AreEqual(54, theByte);
2106-
Assert.AreEqual(-1, zis.ReadByte());
2107-
Assert.AreEqual(checkTime, uno.DateTime);
2107+
Assert.AreEqual(-1, zis.ReadByte()); // eof
2108+
Assert.AreEqual(checkTime.DateTime, uno.DateTime);
21082109
}
21092110
}
21102111
}

0 commit comments

Comments
 (0)