Commit 4620f94b authored by Boaz Brickner's avatar Boaz Brickner

Handle super negative timestamp in Wireshark tests.

parent 1ec323a5
......@@ -37,7 +37,7 @@ namespace PcapDotNet.Core.Test
get { return RetryNumber != -1; }
}
private const int RetryNumber = -1;
private const int RetryNumber = 1000;
/// <summary>
/// Gets or sets the test context which provides
......@@ -592,8 +592,13 @@ namespace PcapDotNet.Core.Test
case "frame.time_epoch":
double timeEpoch = double.Parse(field.Show(), CultureInfo.InvariantCulture);
DateTime fieldTimestamp = new DateTime(1970, 1, 1).AddSeconds(timeEpoch);
MoreAssert.IsInRange(fieldTimestamp.AddMilliseconds(-1), fieldTimestamp.AddMilliseconds(1), packet.Timestamp.ToUniversalTime(), "Timestamp");
// TODO: Remove this when https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=11582 fixed.
if (timeEpoch >= -2147483648)
{
DateTime fieldTimestamp = new DateTime(1970, 1, 1).AddSeconds(timeEpoch);
MoreAssert.IsInRange(fieldTimestamp.AddMilliseconds(-1), fieldTimestamp.AddMilliseconds(1), packet.Timestamp.ToUniversalTime(),
"Timestamp");
}
break;
case "frame.cap_len":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment