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
077c5720
Commit
077c5720
authored
Oct 04, 2014
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tests.
parent
d2e2016f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
33 deletions
+28
-33
WiresharkDatagramComparerIpV6.cs
...src/PcapDotNet.Core.Test/WiresharkDatagramComparerIpV6.cs
+1
-0
DnsTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/DnsTests.cs
+10
-8
GreTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/GreTests.cs
+4
-6
HttpTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/HttpTests.cs
+2
-3
IcmpTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IcmpTests.cs
+2
-3
IgmpTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IgmpTests.cs
+2
-3
IpV6Tests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
+2
-3
TcpTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/TcpTests.cs
+3
-4
UdpTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/UdpTests.cs
+2
-3
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkDatagramComparerIpV6.cs
View file @
077c5720
...
@@ -185,6 +185,7 @@ namespace PcapDotNet.Core.Test
...
@@ -185,6 +185,7 @@ namespace PcapDotNet.Core.Test
return
false
;
return
false
;
case
"ipv6.src_sa_mac"
:
case
"ipv6.src_sa_mac"
:
case
"ipv6.dst_sa_mac"
:
case
"ipv6.sa_mac"
:
case
"ipv6.sa_mac"
:
case
"ipv6.dst_6to4_gw_ipv4"
:
case
"ipv6.dst_6to4_gw_ipv4"
:
case
"ipv6.dst_6to4_sla_id"
:
case
"ipv6.dst_6to4_sla_id"
:
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/DnsTests.cs
View file @
077c5720
...
@@ -57,17 +57,19 @@ namespace PcapDotNet.Packets.Test
...
@@ -57,17 +57,19 @@ namespace PcapDotNet.Packets.Test
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
};
};
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
IpV4Layer
ipV4Layer
=
random
.
NextIpV4Layer
(
null
);
Random
random
=
new
Random
(
seed
);
ipV4Layer
.
HeaderChecksum
=
null
;
Layer
ipLayer
=
random
.
NextBool
()
?
(
Layer
)
ipV4Layer
:
random
.
NextIpV6Layer
(
true
);
UdpLayer
udpLayer
=
random
.
NextUdpLayer
();
udpLayer
.
Checksum
=
null
;
for
(
int
i
=
0
;
i
!=
1000
;
++
i
)
for
(
int
i
=
0
;
i
!=
1000
;
++
i
)
{
{
IpV4Layer
ipV4Layer
=
random
.
NextIpV4Layer
(
null
);
ipV4Layer
.
HeaderChecksum
=
null
;
Layer
ipLayer
=
random
.
NextBool
()
?
(
Layer
)
ipV4Layer
:
random
.
NextIpV6Layer
(
true
);
UdpLayer
udpLayer
=
random
.
NextUdpLayer
();
udpLayer
.
Checksum
=
null
;
DnsLayer
dnsLayer
;
DnsLayer
dnsLayer
;
do
do
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/GreTests.cs
View file @
077c5720
...
@@ -54,10 +54,9 @@ namespace PcapDotNet.Packets.Test
...
@@ -54,10 +54,9 @@ namespace PcapDotNet.Packets.Test
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
};
};
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
int
seed
=
random
.
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
Console
.
WriteLine
(
"Seed: "
+
seed
);
random
=
new
Random
(
seed
);
Random
random
=
new
Random
(
seed
);
for
(
int
i
=
0
;
i
!=
200
;
++
i
)
for
(
int
i
=
0
;
i
!=
200
;
++
i
)
{
{
...
@@ -217,10 +216,9 @@ namespace PcapDotNet.Packets.Test
...
@@ -217,10 +216,9 @@ namespace PcapDotNet.Packets.Test
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
};
};
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
int
seed
=
random
.
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
Console
.
WriteLine
(
"Seed: "
+
seed
);
random
=
new
Random
(
seed
);
Random
random
=
new
Random
(
seed
);
for
(
int
i
=
0
;
i
!=
100
;
++
i
)
for
(
int
i
=
0
;
i
!=
100
;
++
i
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/HttpTests.cs
View file @
077c5720
...
@@ -52,10 +52,9 @@ namespace PcapDotNet.Packets.Test
...
@@ -52,10 +52,9 @@ namespace PcapDotNet.Packets.Test
[
TestMethod
]
[
TestMethod
]
public
void
RandomHttpTest
()
public
void
RandomHttpTest
()
{
{
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
int
seed
=
random
.
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
Console
.
WriteLine
(
"Seed: "
+
seed
);
random
=
new
Random
(
seed
);
Random
random
=
new
Random
(
seed
);
for
(
int
i
=
0
;
i
!=
200
;
++
i
)
for
(
int
i
=
0
;
i
!=
200
;
++
i
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/IcmpTests.cs
View file @
077c5720
...
@@ -53,10 +53,9 @@ namespace PcapDotNet.Packets.Test
...
@@ -53,10 +53,9 @@ namespace PcapDotNet.Packets.Test
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
};
};
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
int
seed
=
random
.
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
Console
.
WriteLine
(
"Seed: "
+
seed
);
random
=
new
Random
(
seed
);
Random
random
=
new
Random
(
seed
);
for
(
int
i
=
0
;
i
!=
2000
;
++
i
)
for
(
int
i
=
0
;
i
!=
2000
;
++
i
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/IgmpTests.cs
View file @
077c5720
...
@@ -53,10 +53,9 @@ namespace PcapDotNet.Packets.Test
...
@@ -53,10 +53,9 @@ namespace PcapDotNet.Packets.Test
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
};
};
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
int
seed
=
random
.
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
Console
.
WriteLine
(
"Seed: "
+
seed
);
random
=
new
Random
(
seed
);
Random
random
=
new
Random
(
seed
);
for
(
int
i
=
0
;
i
!=
200
;
++
i
)
for
(
int
i
=
0
;
i
!=
200
;
++
i
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
View file @
077c5720
...
@@ -66,10 +66,9 @@ namespace PcapDotNet.Packets.Test
...
@@ -66,10 +66,9 @@ namespace PcapDotNet.Packets.Test
EtherType
=
EthernetType
EtherType
=
EthernetType
};
};
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
int
seed
=
random
.
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
Console
.
WriteLine
(
"Seed: "
+
seed
);
random
=
new
Random
(
seed
);
Random
random
=
new
Random
(
seed
);
for
(
int
i
=
0
;
i
!=
1000
;
++
i
)
for
(
int
i
=
0
;
i
!=
1000
;
++
i
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/TcpTests.cs
View file @
077c5720
...
@@ -56,10 +56,9 @@ namespace PcapDotNet.Packets.Test
...
@@ -56,10 +56,9 @@ namespace PcapDotNet.Packets.Test
Destination
=
ethernetDestination
Destination
=
ethernetDestination
};
};
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
int
seed
=
random
.
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
Console
.
WriteLine
(
"Seed: {0}"
,
seed
);
Random
random
=
new
Random
(
seed
);
random
=
new
Random
(
seed
);
for
(
int
i
=
0
;
i
!=
1000
;
++
i
)
for
(
int
i
=
0
;
i
!=
1000
;
++
i
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/UdpTests.cs
View file @
077c5720
...
@@ -52,10 +52,9 @@ namespace PcapDotNet.Packets.Test
...
@@ -52,10 +52,9 @@ namespace PcapDotNet.Packets.Test
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
Destination
=
new
MacAddress
(
"A0:A1:A2:A3:A4:A5"
)
};
};
Random
random
=
new
Random
();
int
seed
=
new
Random
().
Next
();
int
seed
=
random
.
Next
();
Console
.
WriteLine
(
"Seed: "
+
seed
);
Console
.
WriteLine
(
"Seed: "
+
seed
);
random
=
new
Random
(
seed
);
Random
random
=
new
Random
(
seed
);
for
(
int
i
=
0
;
i
!=
1000
;
++
i
)
for
(
int
i
=
0
;
i
!=
1000
;
++
i
)
{
{
...
...
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