Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pcap-Net
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Pcap-Net
Commits
136b512d
Commit
136b512d
authored
Aug 03, 2013
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Wireshark tests to work in other locales.
parent
a1d11f17
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
IpV4OptionExtensions.cs
PcapDotNet/src/PcapDotNet.Core.Test/IpV4OptionExtensions.cs
+3
-2
WiresharkCompareTests.cs
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkCompareTests.cs
+2
-2
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/IpV4OptionExtensions.cs
View file @
136b512d
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
PcapDotNet.Base
;
using
PcapDotNet.Base
;
...
@@ -60,9 +61,9 @@ namespace PcapDotNet.Core.Test
...
@@ -60,9 +61,9 @@ namespace PcapDotNet.Core.Test
else
if
(
quickStart
.
RateKbps
<
1024
)
else
if
(
quickStart
.
RateKbps
<
1024
)
quickStartWireshark
.
Append
(
quickStart
.
RateKbps
+
" kbit/s"
);
quickStartWireshark
.
Append
(
quickStart
.
RateKbps
+
" kbit/s"
);
else
if
(
quickStart
.
RateKbps
<
1024
*
1024
)
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
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
)
if
(
quickStart
.
Function
==
IpV4OptionQuickStartFunction
.
RateRequest
)
quickStartWireshark
.
Append
(
", QS TTL "
+
quickStart
.
Ttl
);
quickStartWireshark
.
Append
(
", QS TTL "
+
quickStart
.
Ttl
);
...
...
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkCompareTests.cs
View file @
136b512d
...
@@ -438,7 +438,7 @@ namespace PcapDotNet.Core.Test
...
@@ -438,7 +438,7 @@ namespace PcapDotNet.Core.Test
try
try
{
{
Compare
(
XDocument
.
Load
(
fixedDocumentFilename
),
packets
);
Compare
(
XDocument
.
Load
(
fixedDocumentFilename
,
LoadOptions
.
None
),
packets
);
}
}
catch
(
AssertFailedException
exception
)
catch
(
AssertFailedException
exception
)
{
{
...
@@ -529,7 +529,7 @@ namespace PcapDotNet.Core.Test
...
@@ -529,7 +529,7 @@ namespace PcapDotNet.Core.Test
// break;
// break;
case
"frame.time_epoch"
:
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
);
DateTime
fieldTimestamp
=
new
DateTime
(
1970
,
1
,
1
).
AddSeconds
(
timeEpoch
);
MoreAssert
.
IsInRange
(
fieldTimestamp
.
AddMilliseconds
(-
1
),
fieldTimestamp
.
AddMilliseconds
(
1
),
packet
.
Timestamp
.
ToUniversalTime
(),
"Timestamp"
);
MoreAssert
.
IsInRange
(
fieldTimestamp
.
AddMilliseconds
(-
1
),
fieldTimestamp
.
AddMilliseconds
(
1
),
packet
.
Timestamp
.
ToUniversalTime
(),
"Timestamp"
);
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment