Commit 136b512d authored by Brickner_cp's avatar Brickner_cp

Fix Wireshark tests to work in other locales.

parent a1d11f17
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using PcapDotNet.Base;
......@@ -60,9 +61,9 @@ namespace PcapDotNet.Core.Test
else if (quickStart.RateKbps < 1024)
quickStartWireshark.Append(quickStart.RateKbps + " kbit/s");
else if (quickStart.RateKbps < 1024 * 1024)
quickStartWireshark.Append(((double)quickStart.RateKbps / 1000) + " Mbit/s");
quickStartWireshark.Append(((double)quickStart.RateKbps / 1000).ToString(CultureInfo.InvariantCulture) + " Mbit/s");
else
quickStartWireshark.Append(((double)quickStart.RateKbps / 1000000) + " Gbit/s");
quickStartWireshark.Append(((double)quickStart.RateKbps / 1000000).ToString(CultureInfo.InvariantCulture) + " Gbit/s");
if (quickStart.Function == IpV4OptionQuickStartFunction.RateRequest)
quickStartWireshark.Append(", QS TTL " + quickStart.Ttl);
......
......@@ -438,7 +438,7 @@ namespace PcapDotNet.Core.Test
try
{
Compare(XDocument.Load(fixedDocumentFilename), packets);
Compare(XDocument.Load(fixedDocumentFilename,LoadOptions.None), packets);
}
catch (AssertFailedException exception)
{
......@@ -529,7 +529,7 @@ namespace PcapDotNet.Core.Test
// break;
case "frame.time_epoch":
double timeEpoch = double.Parse(field.Show());
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");
break;
......
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