Skip to content

Commit 6e95ec2

Browse files
authored
PR #601: pass tests that are within time tolerance
1 parent 5ae4f10 commit 6e95ec2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,9 @@ public void ExtractZipShouldSetTimeOnFilesFromConstructorTimeSetting(TimeSetting
750750
fastZip.ExtractZip(archiveStream, extractDir.Fullpath, FastZip.Overwrite.Always,
751751
_ => true, "", "", true, true, false);
752752
var fi = new FileInfo(Path.Combine(extractDir.Fullpath, SingleEntryFileName));
753-
Assert.AreEqual(targetTime, FileTimeFromTimeSetting(fi, timeSetting));
753+
var actualTime = FileTimeFromTimeSetting(fi, timeSetting);
754+
// Assert that the time is within +/- 2s of the target time to allow for timing/rounding discrepancies
755+
Assert.LessOrEqual(Math.Abs((targetTime - actualTime).TotalSeconds), 2);
754756
}
755757
}
756758

0 commit comments

Comments
 (0)